Skip to content

Respect settings.gradle file from template #822

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
merged 1 commit into from
Aug 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/services/android-project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
deviceBuildOutputPath: path.join(projectRoot, "build", "outputs", "apk"),
validPackageNamesForDevice: [
`${this.$projectData.projectName}-debug.apk`,
`${this.$projectData.projectName}-release.apk`,
"android-debug.apk",
"android-release.apk"
`${this.$projectData.projectName}-release.apk`
],
frameworkFilesExtensions: [".jar", ".dat", ".so"],
configurationFileName: "AndroidManifest.xml",
Expand Down Expand Up @@ -96,9 +94,10 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
this.symlinkDirectory("src", projectRoot, frameworkDir).wait();

this.$fs.symlink(path.join(frameworkDir, "build.gradle"), path.join(projectRoot, "build.gradle")).wait();
this.$fs.symlink(path.join(frameworkDir, "settings.gradle"), path.join(projectRoot, "settings.gradle")).wait();
} else {
this.copy(projectRoot, frameworkDir, "build-tools libs src", "-R");
this.copy(projectRoot, frameworkDir, "build.gradle", "-f");
this.copy(projectRoot, frameworkDir, "build.gradle settings.gradle", "-f");
}

this.copyResValues(projectRoot, frameworkDir, versionNumber).wait();
Expand Down Expand Up @@ -145,6 +144,9 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
let stringsFilePath = path.join(this.platformData.appResourcesDestinationDirectoryPath, 'values', 'strings.xml');
shell.sed('-i', /__NAME__/, this.$projectData.projectName, stringsFilePath);
shell.sed('-i', /__TITLE_ACTIVITY__/, this.$projectData.projectName, stringsFilePath);

let gradleSettingsFilePath = path.join(this.platformData.projectRoot, "settings.gradle");
shell.sed('-i', /__PROJECT_NAME__/, this.$projectData.projectName, gradleSettingsFilePath);
}).future<void>()();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/services/doctor-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class DoctorService implements IDoctorService {
this.$logger.out("You will not be able to build your projects for Android or run them in the emulator or on a connected device." + EOL
+ "To be able to build for Android and run apps in the emulator on on a connected device, verify that you have installed Gradle.");
}

if(sysInfo.gradleVer && helpers.versionCompare(sysInfo.gradleVer, DoctorService.MIN_SUPPORTED_GRADLE_VERSION) === -1) {
this.$logger.warn(`WARNING: Gradle version is lower than ${DoctorService.MIN_SUPPORTED_GRADLE_VERSION}.`);
this.$logger.out("You will not be able to build your projects for Android or run them in the emulator or on a connected device." + EOL
Expand Down