Skip to content

Commit

Permalink
Fix apple template bugs (BrainiumLLC#68)
Browse files Browse the repository at this point in the history
* Fix bug in project.yml.hbs that caused build script sections to be duplicated for each script

* Fix bug in Podfile.hbs that caused all generated macos pods to show up as [Object] in the podfile

Co-authored-by: Spenser Saling <[email protected]>
  • Loading branch information
spensbot and Spenser Saling committed Feb 22, 2022
1 parent 449ae38 commit 4a3d2e4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 19 deletions.
2 changes: 1 addition & 1 deletion templates/platforms/xcode/Podfile.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ target '{{app.name}}_macOS' do
platform :osx, '{{apple.macos-version}}'
# Pods for {{app.name}}_macOS
{{~#each macos-pods}}
pod '{{this}}'{{/each}}
pod '{{this.name}}'{{#if this.version}}, '{{this.version}}'{{/if}}{{/each}}
end

# Delete the deployment target for iOS and macOS, causing it to be inherited from the Podfile
Expand Down
54 changes: 36 additions & 18 deletions templates/platforms/xcode/project.yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ targets:
- sdk: UIKit.framework
{{~#each ios-frameworks}}
- sdk: {{this}}.framework{{/each}}
{{~#each ios-pre-build-scripts}}
preBuildScripts:{{#if this.path}}
{{~#if ios-pre-build-scripts}}
preBuildScripts:
{{~#each ios-pre-build-scripts}}{{#if this.path}}
- path {{this.path}}{{/if}}{{#if this.script}}
- script: {{this.script}}{{/if}}{{#if this.name}}
name: {{this.name}}{{/if}}{{#if this.input-files}}
Expand All @@ -104,9 +105,12 @@ targets:
showEnvVars: {{this.show_env_vars}}{{/if}}{{#if this.run-only-when-installing}}
runOnlyWhenInstalling: {{this.run-only-when-installing}}{{/if}}{{#if this.based-on-dependency-analysis}}
basedOnDependencyAnalysis: {{this.based-on-dependency-analysis}}{{/if}}{{#if this.discovered-dependency-file}}
discoveredDependencyFile: {{this.discovered-dependency-file}}{{/if}}{{/each}}
{{~#each ios-post-compile-scripts}}
postCompileScripts:{{#if this.path}}
discoveredDependencyFile: {{this.discovered-dependency-file}}{{/if}}
{{~/each~}}
{{~/if~}}
{{~#if ios-post-compile-scripts}}
postCompileScripts:
{{~#each ios-post-compile-scripts}}{{#if this.path}}
- path {{this.path}}{{/if}}{{#if this.script}}
- script: {{this.script}}{{/if}}{{#if this.name}}
name: {{this.name}}{{/if}}{{#if this.input-files}}
Expand All @@ -122,9 +126,12 @@ targets:
showEnvVars: {{this.show_env_vars}}{{/if}}{{#if this.run-only-when-installing}}
runOnlyWhenInstalling: {{this.run-only-when-installing}}{{/if}}{{#if this.based-on-dependency-analysis}}
basedOnDependencyAnalysis: {{this.based-on-dependency-analysis}}{{/if}}{{#if this.discovered-dependency-file}}
discoveredDependencyFile: {{this.discovered-dependency-file}}{{/if}}{{/each}}
{{~#each ios-post-build-scripts}}
postBuildScripts:{{#if this.path}}
discoveredDependencyFile: {{this.discovered-dependency-file}}{{/if}}
{{~/each~}}
{{~/if~}}
{{~#if ios-post-build-scripts}}
postBuildScripts:
{{~#each ios-post-build-scripts}}{{#if this.path}}
- path {{this.path}}{{/if}}{{#if this.script}}
- script: {{this.script}}{{/if}}{{#if this.name}}
name: {{this.name}}{{/if}}{{#if this.input-files}}
Expand All @@ -140,7 +147,9 @@ targets:
showEnvVars: {{this.show_env_vars}}{{/if}}{{#if this.run-only-when-installing}}
runOnlyWhenInstalling: {{this.run-only-when-installing}}{{/if}}{{#if this.based-on-dependency-analysis}}
basedOnDependencyAnalysis: {{this.based-on-dependency-analysis}}{{/if}}{{#if this.discovered-dependency-file}}
discoveredDependencyFile: {{this.discovered-dependency-file}}{{/if}}{{/each}}
discoveredDependencyFile: {{this.discovered-dependency-file}}{{/if}}
{{~/each~}}
{{~/if}}
{{app.name}}_macOS:
type: application
platform: macOS
Expand Down Expand Up @@ -172,8 +181,9 @@ targets:
- sdk: Metal.framework
{{~#each macos-frameworks}}
- sdk: {{this}}.framework{{/each}}
{{~#each macos-pre-build-scripts}}
preBuildScripts:{{#if this.path}}
{{~#if macos-pre-build-scripts}}
preBuildScripts:
{{~#each macos-pre-build-scripts}}{{#if this.path}}
- path {{this.path}}{{/if}}{{#if this.script}}
- script: {{this.script}}{{/if}}{{#if this.name}}
name: {{this.name}}{{/if}}{{#if this.input-files}}
Expand All @@ -189,9 +199,12 @@ targets:
showEnvVars: {{this.show_env_vars}}{{/if}}{{#if this.run-only-when-installing}}
runOnlyWhenInstalling: {{this.run-only-when-installing}}{{/if}}{{#if this.based-on-dependency-analysis}}
basedOnDependencyAnalysis: {{this.based-on-dependency-analysis}}{{/if}}{{#if this.discovered-dependency-file}}
discoveredDependencyFile: {{this.discovered-dependency-file}}{{/if}}{{/each}}
{{~#each macos-post-compile-scripts}}
postCompileScripts:{{#if this.path}}
discoveredDependencyFile: {{this.discovered-dependency-file}}{{/if}}
{{~/each~}}
{{~/if~}}
{{#if macos-post-compile-scripts}}
postCompileScripts:
{{~#each macos-post-compile-scripts}}{{#if this.path}}
- path {{this.path}}{{/if}}{{#if this.script}}
- script: {{this.script}}{{/if}}{{#if this.name}}
name: {{this.name}}{{/if}}{{#if this.input-files}}
Expand All @@ -207,9 +220,12 @@ targets:
showEnvVars: {{this.show_env_vars}}{{/if}}{{#if this.run-only-when-installing}}
runOnlyWhenInstalling: {{this.run-only-when-installing}}{{/if}}{{#if this.based-on-dependency-analysis}}
basedOnDependencyAnalysis: {{this.based-on-dependency-analysis}}{{/if}}{{#if this.discovered-dependency-file}}
discoveredDependencyFile: {{this.discovered-dependency-file}}{{/if}}{{/each}}
{{~#each macos-post-build-scripts}}
postBuildScripts:{{#if this.path}}
discoveredDependencyFile: {{this.discovered-dependency-file}}{{/if}}
{{~/each~}}
{{~/if~}}
{{#if macos-post-build-scripts}}
postBuildScripts:
{{~#each macos-post-build-scripts}}{{#if this.path}}
- path {{this.path}}{{/if}}{{#if this.script}}
- script: {{this.script}}{{/if}}{{#if this.name}}
name: {{this.name}}{{/if}}{{#if this.input-files}}
Expand All @@ -225,7 +241,9 @@ targets:
showEnvVars: {{this.show_env_vars}}{{/if}}{{#if this.run-only-when-installing}}
runOnlyWhenInstalling: {{this.run-only-when-installing}}{{/if}}{{#if this.based-on-dependency-analysis}}
basedOnDependencyAnalysis: {{this.based-on-dependency-analysis}}{{/if}}{{#if this.discovered-dependency-file}}
discoveredDependencyFile: {{this.discovered-dependency-file}}{{/if}}{{/each}}
discoveredDependencyFile: {{this.discovered-dependency-file}}{{/if}}
{{~/each~}}
{{~/if}}
lib_{{app.name}}_iOS:
type: ""
platform: iOS
Expand Down

0 comments on commit 4a3d2e4

Please sign in to comment.