-
-
Notifications
You must be signed in to change notification settings - Fork 197
Kddimitrov/add platform application identifier setting #3120
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
KristianDD
merged 3 commits into
master
from
kddimitrov/add-platform-application-identifier-setting
Sep 20, 2018
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
Submodule common
updated
6 files
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 |
---|---|---|
|
@@ -120,7 +120,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject | |
} | ||
|
||
public async validate(projectData: IProjectData, options: IOptions, notConfiguredEnvOptions?: INotConfiguredEnvOptions): Promise<IValidatePlatformOutput> { | ||
this.validatePackageName(projectData.projectId); | ||
this.validatePackageName(projectData.projectIdentifiers.android); | ||
this.validateProjectName(projectData.projectName); | ||
|
||
const checkEnvironmentRequirementsOutput = await this.$platformEnvironmentRequirements.checkEnvironmentRequirements({ | ||
|
@@ -269,16 +269,17 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject | |
// will replace applicationId in app/App_Resources/Android/app.gradle if it has not been edited by the user | ||
const appGradleContent = this.$fs.readText(projectData.appGradlePath); | ||
if (appGradleContent.indexOf(constants.PACKAGE_PLACEHOLDER_NAME) !== -1) { | ||
shell.sed('-i', new RegExp(constants.PACKAGE_PLACEHOLDER_NAME), projectData.projectId, projectData.appGradlePath); | ||
//TODO: For compatibility with old templates. Once all templates are updated should delete. | ||
shell.sed('-i', new RegExp(constants.PACKAGE_PLACEHOLDER_NAME), projectData.projectIdentifiers.android, projectData.appGradlePath); | ||
} | ||
} catch (e) { | ||
this.$logger.warn(`\n${e}.\nCheck if you're using an outdated template and update it.`); | ||
this.$logger.trace(`Templates updated and no need for replace in app.gradle.`); | ||
} | ||
} | ||
|
||
public interpolateConfigurationFile(projectData: IProjectData, platformSpecificData: IPlatformSpecificData): void { | ||
const manifestPath = this.getPlatformData(projectData).configurationFilePath; | ||
shell.sed('-i', /__PACKAGE__/, projectData.projectId, manifestPath); | ||
shell.sed('-i', /__PACKAGE__/, projectData.projectIdentifiers.android, manifestPath); | ||
if (this.$androidToolsInfo.getToolsInfo().androidHomeEnvVar) { | ||
const sdk = (platformSpecificData && platformSpecificData.sdk) || (this.$androidToolsInfo.getToolsInfo().compileSdkVersion || "").toString(); | ||
shell.sed('-i', /__APILEVEL__/, sdk, manifestPath); | ||
|
@@ -287,8 +288,8 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject | |
|
||
private getProjectNameFromId(projectData: IProjectData): string { | ||
let id: string; | ||
if (projectData && projectData.projectId) { | ||
const idParts = projectData.projectId.split("."); | ||
if (projectData && projectData.projectIdentifiers && projectData.projectIdentifiers.android) { | ||
const idParts = projectData.projectIdentifiers.android.split("."); | ||
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. @Plamen5kov(accidently deleted the comment) Yes there is validation for the identifier. |
||
id = idParts[idParts.length - 1]; | ||
} | ||
|
||
|
@@ -532,7 +533,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject | |
const filesForInterpolation = this.$fs.enumerateFilesInDirectorySync(resourcesDestinationDirectoryPath, file => this.$fs.getFsStats(file).isDirectory() || path.extname(file) === constants.XML_FILE_EXTENSION) || []; | ||
for (const file of filesForInterpolation) { | ||
this.$logger.trace(`Interpolate data for plugin file: ${file}`); | ||
await this.$pluginVariablesService.interpolate(pluginData, file, projectData); | ||
await this.$pluginVariablesService.interpolate(pluginData, file, projectData.projectDir, projectData.projectIdentifiers.android); | ||
} | ||
} | ||
|
||
|
@@ -642,7 +643,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject | |
|
||
public async cleanDeviceTempFolder(deviceIdentifier: string, projectData: IProjectData): Promise<void> { | ||
const adb = this.$injector.resolve(DeviceAndroidDebugBridge, { identifier: deviceIdentifier }); | ||
const deviceRootPath = `${LiveSyncPaths.ANDROID_TMP_DIR_NAME}/${projectData.projectId}`; | ||
const deviceRootPath = `${LiveSyncPaths.ANDROID_TMP_DIR_NAME}/${projectData.projectIdentifiers.android}`; | ||
await adb.executeShellCommand(["rm", "-rf", deviceRootPath]); | ||
} | ||
|
||
|
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
Oops, something went wrong.
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.
What's the case when the android and ios package identifiers should be set to an empty string? Shouldn't we throw an error/warning here? (nvm, I got this is a default setting, but rename method)