File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -399,6 +399,11 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
399
399
gradleVersion
400
400
) ;
401
401
402
+ this . replaceGradleAndroidPluginVersion (
403
+ buildGradlePath ,
404
+ runtimeGradleVersions . gradleAndroidPluginVersion
405
+ ) ;
406
+
402
407
// In gradle 8 every android project must have a namespace in "android"
403
408
// and the package property in manifest is now forbidden
404
409
// let s replace it
@@ -631,6 +636,22 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
631
636
) ;
632
637
}
633
638
639
+ private replaceGradleAndroidPluginVersion (
640
+ buildGradlePath : string ,
641
+ version : string
642
+ ) : void {
643
+ const gradleAndroidPluginVersionPlaceholder =
644
+ "{{runtimeAndroidPluginVersion}}" ;
645
+ const gradleAndroidPluginVersion =
646
+ version || AndroidBuildDefaults . GradleAndroidPluginVersion ;
647
+
648
+ this . replaceFileContent (
649
+ buildGradlePath ,
650
+ gradleAndroidPluginVersionPlaceholder ,
651
+ gradleAndroidPluginVersion
652
+ ) ;
653
+ }
654
+
634
655
private replaceFileContent (
635
656
filePath : string ,
636
657
content : string ,
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ buildscript {
209
209
applyBuildScriptConfigurations()
210
210
211
211
def computeKotlinVersion = { -> project. hasProperty(" kotlinVersion" ) ? kotlinVersion : " ${ ns_default_kotlin_version} " }
212
- def computeBuildToolsVersion = { -> project. hasProperty(" androidBuildToolsVersion" ) ? androidBuildToolsVersion : " ${ NS_DEFAULT_ANDROID_BUILD_TOOLS_VERSION } " }
212
+ def computeBuildToolsVersion = { -> project. hasProperty(" androidBuildToolsVersion" ) ? androidBuildToolsVersion : " {{runtimeAndroidPluginVersion} }" }
213
213
def kotlinVersion = computeKotlinVersion()
214
214
def androidBuildToolsVersion = computeBuildToolsVersion()
215
215
You can’t perform that action at this time.
0 commit comments