Skip to content

Commit a369715

Browse files
committed
feat: overrideRuntimeGradleFiles option
1 parent faeb5b2 commit a369715

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

lib/declarations.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ interface IAndroidOptions {
582582
gradleFlavor: string;
583583
gradlePath: string;
584584
gradleArgs: string[];
585+
overrideRuntimeGradleFiles: boolean;
585586
}
586587

587588
interface ITypingsOptions {

lib/options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ export class Options {
226226
hasSensitiveValue: false,
227227
},
228228
flavor: { type: OptionType.String, hasSensitiveValue: false },
229+
overrideRuntimeGradleFiles: { type: OptionType.Boolean, hasSensitiveValue: false },
229230
gradlePath: { type: OptionType.String, hasSensitiveValue: false },
230231
gradleArgs: { type: OptionType.String, hasSensitiveValue: false, array: true },
231232
aab: { type: OptionType.Boolean, hasSensitiveValue: false },

lib/services/android-project-service.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,15 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
357357
"*",
358358
"-R"
359359
);
360-
361-
// override app build.gradle from cli vendor to allow updates faster than the runtime
362-
const gradleTemplatePath = path.resolve(
363-
path.join(__dirname, "../../vendor/gradle-app")
364-
);
365-
const allGradleTemplateFiles = path.join(gradleTemplatePath, "*");
366-
367-
this.$fs.copyFile(allGradleTemplateFiles, path.join(this.getPlatformData(projectData).projectRoot));
368-
360+
if (this.$options.overrideRuntimeGradleFiles !== false) {
361+
// override app build.gradle from cli vendor to allow updates faster than the runtime
362+
const gradleTemplatePath = path.resolve(
363+
path.join(__dirname, "../../vendor/gradle-app")
364+
);
365+
const allGradleTemplateFiles = path.join(gradleTemplatePath, "*");
366+
367+
this.$fs.copyFile(allGradleTemplateFiles, path.join(this.getPlatformData(projectData).projectRoot));
368+
}
369369
// TODO: Check if we actually need this and if it should be targetSdk or compileSdk
370370
this.cleanResValues(targetSdkVersion, projectData);
371371
}

0 commit comments

Comments
 (0)