-
-
Notifications
You must be signed in to change notification settings - Fork 198
Add support for custom platform templates #1525
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
Closed
Closed
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
b5d9e1e
Merge remote-tracking branch 'origin/release' into HEAD
45e950d
Merge remote-tracking branch 'origin/release' into HEAD
e2a4388
Merge remote-tracking branch 'origin/release' into HEAD
ff18217
Remove rimraf as dependency
teobugslayer 3e3706a
Merge pull request #1479 from NativeScript/remove-rimraf
teobugslayer 0c2d486
Change docs to recommend production branch
teobugslayer 34efe39
Do not install the CLI
teobugslayer b83c44c
Merge pull request #1487 from NativeScript/dont-install-tns
teobugslayer e677c2c
Update node-winreg dependency
teobugslayer 4532593
Merge branch 'release' into vladimirov/merge-rel-master
rosen-vladimirov 1f37944
Update to latest common lib
rosen-vladimirov 80f400d
Merge pull request #1489 from NativeScript/update-winreg
teobugslayer 8a1820a
Merge pull request #1491 from NativeScript/vladimirov/merge-rel-master
rosen-vladimirov 467f4e7
Set version to 1.7.0
rosen-vladimirov 75fcdc4
Merge pull request #1492 from NativeScript/vladimirov/update-version
rosen-vladimirov e840f7a
Merge remote-tracking branch 'origin/release' into HEAD
1af4441
Merge branch 'release' into vladimirov/merge-rel-master
rosen-vladimirov e9da5ab
Update to latest common lib
rosen-vladimirov 27f38b2
Merge pull request #1509 from NativeScript/vladimirov/merge-rel-master
rosen-vladimirov 3ae1b30
Merge remote-tracking branch 'origin/release' into HEAD
de3b2e0
Introduce `grunt rebuild`
Mitko-Kerezov a08d207
Merge pull request #1527 from NativeScript/kerezov/grunt-rebuild
Mitko-Kerezov f220d3b
Allow build.xcconfig in app/App_Resources/iOS/build.xcconfig
PanayotCankov 3e3aa3d
Merge pull request #1547 from NativeScript/cankov/app-resources-xcconfig
PanayotCankov da63313
Merge branch 'release' into vladimirov/merge-rel-master
rosen-vladimirov 9481127
Update to latest common lib
rosen-vladimirov ea53638
Merge pull request #1553 from NativeScript/vladimirov/merge-rel-master
rosen-vladimirov ec05674
Delete /data/local/tmp/<app-identifier> file if exists on Android device
nadyaA 59a2a42
Merge pull request #1560 from NativeScript/natanasova/android-livesyn…
nadyaA d5bd3ad
Add support for custom platform templates
rosen-vladimirov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,10 +104,16 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ | |
| }).future<void>()(); | ||
| } | ||
|
|
||
| public createProject(frameworkDir: string, frameworkVersion: string): IFuture<void> { | ||
| public createProject(frameworkDir: string, frameworkVersion: string, pathToTemplate?: string): IFuture<void> { | ||
| return (() => { | ||
| this.$fs.ensureDirectoryExists(path.join(this.platformData.projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER)).wait(); | ||
| if(this.$options.symlink) { | ||
| if(pathToTemplate) { | ||
| // Copy everything except the template from the runtime | ||
| this.$fs.readDirectory(frameworkDir).wait() | ||
| .filter(dirName => dirName.indexOf(IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER) === -1) | ||
| .forEach(dirName => shell.cp("-R", path.join(frameworkDir, dirName), this.platformData.projectRoot)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we care that shell.cp can fail? We need to call shell.error to check for failures. |
||
| shell.cp("-rf", path.join(pathToTemplate, "*"), this.platformData.projectRoot); | ||
| } else if(this.$options.symlink) { | ||
| let xcodeProjectName = util.format("%s.xcodeproj", IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER); | ||
|
|
||
| shell.cp("-R", path.join(frameworkDir, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER, "*"), path.join(this.platformData.projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER)); | ||
|
|
@@ -118,7 +124,6 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ | |
| _.each(frameworkFiles, (file: string) => { | ||
| this.$fs.symlink(path.join(frameworkDir, file), path.join(this.platformData.projectRoot, file)).wait(); | ||
| }); | ||
|
|
||
| } else { | ||
| shell.cp("-R", path.join(frameworkDir, "*"), this.platformData.projectRoot); | ||
| } | ||
|
|
@@ -393,6 +398,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ | |
| public processConfigurationFilesFromAppResources(): IFuture<void> { | ||
| return (() => { | ||
| this.mergeInfoPlists().wait(); | ||
| this.mergeProjectXcconfigFiles().wait(); | ||
| _(this.getAllInstalledPlugins().wait()) | ||
| .map(pluginData => this.$pluginVariablesService.interpolatePluginVariables(pluginData, this.platformData.configurationFilePath).wait()) | ||
| .value(); | ||
|
|
@@ -565,8 +571,6 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ | |
|
|
||
| this.executePodInstall().wait(); | ||
| } | ||
|
|
||
| this.regeneratePluginsXcconfigFile().wait(); | ||
| }).future<void>()(); | ||
| } | ||
|
|
||
|
|
@@ -778,7 +782,7 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ | |
| }).future<void>()(); | ||
| } | ||
|
|
||
| private regeneratePluginsXcconfigFile(): IFuture<void> { | ||
| private mergeProjectXcconfigFiles(): IFuture<void> { | ||
| return (() => { | ||
| this.$fs.deleteFile(this.pluginsDebugXcconfigFilePath).wait(); | ||
| this.$fs.deleteFile(this.pluginsReleaseXcconfigFilePath).wait(); | ||
|
|
@@ -793,6 +797,12 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ | |
| } | ||
| } | ||
|
|
||
| let appResourcesXcconfigPath = path.join(this.$projectData.projectDir, constants.APP_FOLDER_NAME, constants.APP_RESOURCES_FOLDER_NAME, this.platformData.normalizedPlatformName, "build.xcconfig"); | ||
| if (this.$fs.exists(appResourcesXcconfigPath).wait()) { | ||
| this.mergeXcconfigFiles(appResourcesXcconfigPath, this.pluginsDebugXcconfigFilePath).wait(); | ||
| this.mergeXcconfigFiles(appResourcesXcconfigPath, this.pluginsReleaseXcconfigFilePath).wait(); | ||
| } | ||
|
|
||
| let podFolder = path.join(this.platformData.projectRoot, "Pods/Target Support Files/Pods/"); | ||
| if (this.$fs.exists(podFolder).wait()) { | ||
| this.mergeXcconfigFiles(path.join(this.platformData.projectRoot, "Pods/Target Support Files/Pods/Pods.debug.xcconfig"), this.pluginsDebugXcconfigFilePath).wait(); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we care that shell.cp can fail? We need to call shell.error to check for failures.