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 {
399399 gradleVersion
400400 ) ;
401401
402+ this . replaceGradleAndroidPluginVersion (
403+ buildGradlePath ,
404+ runtimeGradleVersions . gradleAndroidPluginVersion
405+ ) ;
406+
402407 // In gradle 8 every android project must have a namespace in "android"
403408 // and the package property in manifest is now forbidden
404409 // let s replace it
@@ -631,6 +636,22 @@ export class AndroidPluginBuildService implements IAndroidPluginBuildService {
631636 ) ;
632637 }
633638
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+
634655 private replaceFileContent (
635656 filePath : string ,
636657 content : string ,
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ buildscript {
209209 applyBuildScriptConfigurations()
210210
211211 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} }" }
213213 def kotlinVersion = computeKotlinVersion()
214214 def androidBuildToolsVersion = computeBuildToolsVersion()
215215
You can’t perform that action at this time.
0 commit comments