Skip to content

Commit 77746fe

Browse files
FatmeFatme
Fatme
authored and
Fatme
committed
Merge pull request #822 from NativeScript/fatme/gradle.settings
Respect settings.gradle file from template
2 parents 9370cf7 + 37f5a1c commit 77746fe

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/services/android-project-service.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
5252
deviceBuildOutputPath: path.join(projectRoot, "build", "outputs", "apk"),
5353
validPackageNamesForDevice: [
5454
`${this.$projectData.projectName}-debug.apk`,
55-
`${this.$projectData.projectName}-release.apk`,
56-
"android-debug.apk",
57-
"android-release.apk"
55+
`${this.$projectData.projectName}-release.apk`
5856
],
5957
frameworkFilesExtensions: [".jar", ".dat", ".so"],
6058
configurationFileName: "AndroidManifest.xml",
@@ -96,9 +94,10 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
9694
this.symlinkDirectory("src", projectRoot, frameworkDir).wait();
9795

9896
this.$fs.symlink(path.join(frameworkDir, "build.gradle"), path.join(projectRoot, "build.gradle")).wait();
97+
this.$fs.symlink(path.join(frameworkDir, "settings.gradle"), path.join(projectRoot, "settings.gradle")).wait();
9998
} else {
10099
this.copy(projectRoot, frameworkDir, "build-tools libs src", "-R");
101-
this.copy(projectRoot, frameworkDir, "build.gradle", "-f");
100+
this.copy(projectRoot, frameworkDir, "build.gradle settings.gradle", "-f");
102101
}
103102

104103
this.copyResValues(projectRoot, frameworkDir, versionNumber).wait();
@@ -145,6 +144,9 @@ class AndroidProjectService extends projectServiceBaseLib.PlatformProjectService
145144
let stringsFilePath = path.join(this.platformData.appResourcesDestinationDirectoryPath, 'values', 'strings.xml');
146145
shell.sed('-i', /__NAME__/, this.$projectData.projectName, stringsFilePath);
147146
shell.sed('-i', /__TITLE_ACTIVITY__/, this.$projectData.projectName, stringsFilePath);
147+
148+
let gradleSettingsFilePath = path.join(this.platformData.projectRoot, "settings.gradle");
149+
shell.sed('-i', /__PROJECT_NAME__/, this.$projectData.projectName, gradleSettingsFilePath);
148150
}).future<void>()();
149151
}
150152

lib/services/doctor-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class DoctorService implements IDoctorService {
7070
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
7171
+ "To be able to build for Android and run apps in the emulator on on a connected device, verify that you have installed Gradle.");
7272
}
73-
73+
7474
if(sysInfo.gradleVer && helpers.versionCompare(sysInfo.gradleVer, DoctorService.MIN_SUPPORTED_GRADLE_VERSION) === -1) {
7575
this.$logger.warn(`WARNING: Gradle version is lower than ${DoctorService.MIN_SUPPORTED_GRADLE_VERSION}.`);
7676
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

0 commit comments

Comments
 (0)