Skip to content

Commit

Permalink
style: renamed bundlename to projectname
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Mar 7, 2017
1 parent b9c198a commit 4507dd0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/scripts/ios/associatedDomains.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
// get the xcode .entitlements and provisioning profile .plist
function getEntitlementFiles (preferences) {
var files = []
var entitlements = path.join(preferences.projectRoot, 'platforms', 'ios', preferences.bundleName, 'Resources', preferences.bundleName + '.entitlements')
var entitlements = path.join(preferences.projectRoot, 'platforms', 'ios', preferences.projectName, 'Resources', preferences.projectName + '.entitlements')
files.push(entitlements)

for (var i = 0; i < BUILD_TYPES.length; i++) {
var buildType = BUILD_TYPES[i]
var plist = path.join(preferences.projectRoot, 'platforms', 'ios', preferences.bundleName, 'Entitlements-' + buildType + '.plist')
var plist = path.join(preferences.projectRoot, 'platforms', 'ios', preferences.projectName, 'Entitlements-' + buildType + '.plist')
files.push(plist)
}

Expand Down
2 changes: 1 addition & 1 deletion src/scripts/ios/capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
function enableAssociatedDomains (preferences) {
console.log('BRANCH SDK: Updating iOS Xcode preferences')

var entitlementsFile = path.join(preferences.projectRoot, 'platforms', 'ios', preferences.bundleName, 'Resources', preferences.bundleName + '.entitlements')
var projectFile = preferences.projectPlatform.parseProjectFile(path.join(preferences.projectRoot, 'platforms', 'ios'))
var entitlementsFile = path.join(preferences.projectRoot, 'platforms', 'ios', preferences.projectName, 'Resources', preferences.projectName + '.entitlements')

activateAssociativeDomains(projectFile.xcode, entitlementsFile)
addPbxReference(projectFile.xcode, entitlementsFile)
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/ios/plist.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
function addBranchSettings (preferences) {
console.log('BRANCH SDK: Updating iOS info.plist')

var filePath = 'platforms/ios/' + preferences.bundleName + '/' + preferences.bundleName + '-Info.plist'
var filePath = 'platforms/ios/' + preferences.projectName + '/' + preferences.projectName + '-Info.plist'
var xml = readPlist(filePath)
var obj = convertXmlToObject(xml)

Expand Down
8 changes: 6 additions & 2 deletions src/scripts/sdk/configXml.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,24 @@
'projectRoot': projectRoot,
'projectPlatform': projectPlatform,
'bundleId': bundleId,
'bundleName': bundleName,
'branchKey': branchKey,
'uriScheme': uriScheme,
'linkDomain': linkDomain,
'iosTeamRelease': iosTeamRelease,
'iosTeamDebug': iosTeamDebug, // optional
'androidPrefix': androidPrefix, // optional
'androidTestMode': androidTestMode // optional
'projectName': getProjectName(configXml),
}
}

// read app project location
function getProjectRoot (context) {
return context.opts.projectRoot
// read project name from config.xml
function getProjectName (configXml) {
return (configXml.widget.hasOwnProperty('name')) ? configXml.widget.name[0] : null
}
}

// read project platform
Expand All @@ -93,7 +97,7 @@
if (preferences.bundleId === null) {
throw new Error('BRANCH SDK: Invalid "widget id" in your config.xml. Docs https://goo.gl/GijGKP')
}
if (preferences.bundleName === null) {
if (preferences.projectName === null) {
throw new Error('BRANCH SDK: Invalid "name" in your config.xml. Docs https://goo.gl/GijGKP')
}
if (preferences.branchKey === null) {
Expand Down

0 comments on commit 4507dd0

Please sign in to comment.