Skip to content

Commit

Permalink
fix: reverted from after_compile to after_prepare to catch cordova ru…
Browse files Browse the repository at this point in the history
…n edge case
  • Loading branch information
ethanneff committed Jan 31, 2017
1 parent 7ab4c69 commit 798f9c0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
4 changes: 2 additions & 2 deletions hooks/afterCompile.js → hooks/afterPrepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'use strict'
var configPrefrences = require('./lib/sdk/configXml.js')
var iosPlist = require('./lib/ios/plist.js')
var iosPreferences = require('./lib/ios/preferences.js')
var iosCapabilities = require('./lib/ios/capabilities.js')
var iosAssociatedDomains = require('./lib/ios/associatedDomains.js')
var iosDevelopmentTeam = require('./lib/ios/developmentTeam.js')
var androidManifest = require('./lib/android/androidManifest.js')
Expand All @@ -25,7 +25,7 @@
}
if (platform === IOS) {
iosPlist.addBranchSettings(preferences)
iosPreferences.enableAssociatedDomains(preferences)
iosCapabilities.enableAssociatedDomains(preferences)
iosAssociatedDomains.addAssociatedDomains(preferences)
iosDevelopmentTeam.addDevelopmentTeam(context, preferences)
}
Expand Down
16 changes: 1 addition & 15 deletions hooks/lib/ios/preferences.js → hooks/lib/ios/capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
var configurations = removeComments(xcodeProject.pbxXCBuildConfigurationSection())
var config
var buildSettings
var deploymentTargetIsUpdated

for (config in configurations) {
buildSettings = configurations[config].buildSettings
Expand All @@ -39,30 +38,17 @@
var buildDeploymentTarget = buildSettings.IPHONEOS_DEPLOYMENT_TARGET.toString()
if (compare(buildDeploymentTarget, IOS_DEPLOYMENT_TARGET) === -1) {
buildSettings.IPHONEOS_DEPLOYMENT_TARGET = IOS_DEPLOYMENT_TARGET
deploymentTargetIsUpdated = true
}
} else {
buildSettings.IPHONEOS_DEPLOYMENT_TARGET = IOS_DEPLOYMENT_TARGET
deploymentTargetIsUpdated = true
}
}

if (deploymentTargetIsUpdated) {
console.warn('IOS project now has deployment target set as: ' + IOS_DEPLOYMENT_TARGET)
}

console.warn('IOS project Code Sign Entitlements now set to: ' + entitlementsFile)
}

function addPbxReference (xcodeProject, entitlementsFile) {
var fileReferenceSection = removeComments(xcodeProject.pbxFileReferenceSection())

if (isPbxReferenceAlreadySet(fileReferenceSection, entitlementsFile)) {
console.warn('Entitlements file is in reference section.')
return
}

console.warn('Entitlements file is not in references section, adding it')
if (isPbxReferenceAlreadySet(fileReferenceSection, entitlementsFile)) return
xcodeProject.addResourceFile(path.basename(entitlementsFile))
}

Expand Down
2 changes: 1 addition & 1 deletion plugin.template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ SOFTWARE.

<!-- Hooks -->
<hook src="hooks/beforePluginInstall.js" type="before_plugin_install" />
<hook src="hooks/afterCompile.js" type="after_compile" />
<hook src="hooks/afterPrepare.js" type="after_prepare" />

<engines>
<engine name="cordova" version=">=3.5.0" />
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ SOFTWARE.

<!-- Hooks -->
<hook src="hooks/beforePluginInstall.js" type="before_plugin_install" />
<hook src="hooks/afterCompile.js" type="after_compile" />
<hook src="hooks/afterPrepare.js" type="after_prepare" />

<engines>
<engine name="cordova" version=">=3.5.0" />
Expand Down

0 comments on commit 798f9c0

Please sign in to comment.