Skip to content

Support xcconfig file from plugin - close #883 #910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 15, 2015

Conversation

jasssonpet
Copy link
Contributor

Set the xcconfig to the project template, so that building from the Xcode project is the same as from the CLI: NativeScript/ios-jsc#302

If the added plugin has a build.xcconfig file in platforms/ios, an include directive gets appended to the build.xcconfig in the project template.

Example (incomplete) Facebook plugin:

package.json
platforms/ios/FBSDKCoreKit.framework
platforms/ios/build.xcconfig

FBSDKCoreKit is a static framework and has a dependency to CoreGraphics. So we add it In the build.xcconfig: OTHER_LDFLAGS = $(inherited) -framework CoreGraphics.

Ping @fealebenpae

@@ -575,6 +604,10 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
let modulemap = `module ${libraryName} { explicit module ${libraryName} { ${headers.join(" ")} } }`;
this.$fs.writeFile(path.join(headersFolderPath, "module.modulemap"), modulemap).wait();
}

private buildXcconfigContent(xcconfigFilePath: string, xcconfigFileContent: string): string {
return `${os.EOL}// Begin xcconfig - ${xcconfigFilePath} ${os.EOL} ${xcconfigFileContent} ${os.EOL} // End xcconfig ${os.EOL}`;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change this to #include directive instead of copy-paste.

@jasssonpet jasssonpet force-pushed the jasssonpet/xcconfig-files branch 2 times, most recently from d8a2234 to 3844b50 Compare September 14, 2015 08:16
@jasssonpet jasssonpet force-pushed the jasssonpet/xcconfig-files branch from 3844b50 to 86fd968 Compare September 14, 2015 08:20
@ns-bot
Copy link

ns-bot commented Sep 14, 2015

@jasssonpet jasssonpet added this to the 1.4.0 (Under review) milestone Sep 14, 2015
@jasssonpet jasssonpet self-assigned this Sep 14, 2015
@jasssonpet
Copy link
Contributor Author

ping @Fatme

I think that this PR is ready to be merged.

let pluginXcconfigFilePath = path.join(pluginPlatformsFolderPath, "build.xcconfig");
if(this.$fs.exists(pluginXcconfigFilePath).wait()) {
let contentToWrite = this.buildXcconfigContent(pluginXcconfigFilePath);
this.$fs.appendFile(this.projectXcconfigFilePath, contentToWrite).wait();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we import the file instead append?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We append an #include "pluginFileXcconfig", is that what you mean?

@teobugslayer
Copy link
Contributor

👍

jasssonpet added a commit that referenced this pull request Sep 15, 2015
@jasssonpet jasssonpet merged commit 5c88305 into master Sep 15, 2015
@jasssonpet jasssonpet deleted the jasssonpet/xcconfig-files branch September 15, 2015 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants