Use Gradle KTS in new Android app projects by default (2nd try) (#157195)

This PR resolves #151166

This PR relands #154061
This commit is contained in:
Bartek Pacia
2024-10-22 19:28:31 +02:00
committed by GitHub
parent 9edd1ae008
commit eb5ef69d6b
20 changed files with 162 additions and 131 deletions

View File

@@ -29,14 +29,17 @@ Future<void> main() async {
await runProjectTest((FlutterProject flutterProject) async {
await inDirectory(path.join(flutterProject.rootPath, 'android'), () async {
section('Insert gradle testing script');
final File build = File(path.join(
flutterProject.rootPath, 'android', 'app', 'build.gradle',
));
build.writeAsStringSync(
final File buildFile = getAndroidBuildFile(path.join(flutterProject.rootPath, 'android', 'app'));
buildFile.writeAsStringSync(
'''
task printEngineMavenUrl() {
tasks.register("printEngineMavenUrl") {
doLast {
println project.repositories.find { it.name == 'maven' }.url
project.repositories.forEach { repo ->
if (repo.name == "maven") {
repo as MavenArtifactRepository
logger.quiet(repo.url.toString())
}
}
}
}
''',