flutter/packages/flutter_tools/templates/plugin/android-java.tmpl/build.gradle.tmpl
stuartmorgan aa230140e7
Add namespace to Android plugin templates (#126354)
Adds the `namespace` property necessary for AGP 8 compatibility to the plugin templates, with the conditional logic to ensure that it doesn't break AGP <4.2, so that new plugins will be maximally compatible.

Part of https://github.com/flutter/flutter/issues/125181
2023-05-12 22:16:06 +00:00

55 lines
1.1 KiB
Cheetah

group '{{androidIdentifier}}'
version '1.0'
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
}
}
rootProject.allprojects {
repositories {
google()
mavenCentral()
}
}
apply plugin: 'com.android.library'
android {
if (project.android.hasProperty("namespace")) {
namespace '{{androidIdentifier}}'
}
compileSdkVersion {{compileSdkVersion}}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion {{minSdkVersion}}
}
dependencies {
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:5.0.0'
}
testOptions {
unitTests.all {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
outputs.upToDateWhen {false}
showStandardStreams = true
}
}
}
}