Remove conditionality in templates that was for AGP <= 4.2 support (#151845)
Not needed after https://github.com/flutter/flutter/pull/149204 (as long as nothing has changed since the comment was made ð). Fixes https://github.com/flutter/flutter/issues/145105.
This commit is contained in:
parent
6e189a7452
commit
8c5fbb4021
@ -24,11 +24,7 @@ apply plugin: "com.android.library"
|
||||
apply plugin: "kotlin-android"
|
||||
|
||||
android {
|
||||
// Conditional for compatibility with AGP <4.2.
|
||||
if (project.android.hasProperty("namespace")) {
|
||||
namespace = "{{androidIdentifier}}"
|
||||
}
|
||||
|
||||
namespace = "{{androidIdentifier}}"
|
||||
compileSdk = {{compileSdkVersion}}
|
||||
defaultConfig {
|
||||
minSdk = {{minSdkVersion}}
|
||||
|
@ -3,11 +3,7 @@ def flutterPluginVersion = "managed"
|
||||
apply plugin: "com.android.application"
|
||||
|
||||
android {
|
||||
// Conditional for compatibility with AGP <4.2.
|
||||
if (project.android.hasProperty("namespace")) {
|
||||
namespace = "{{androidIdentifier}}.host"
|
||||
}
|
||||
|
||||
namespace = "{{androidIdentifier}}.host"
|
||||
compileSdk = {{compileSdkVersion}}
|
||||
|
||||
compileOptions {
|
||||
|
@ -30,11 +30,7 @@ group = "{{androidIdentifier}}"
|
||||
version = "1.0"
|
||||
|
||||
android {
|
||||
// Conditional for compatibility with AGP <4.2.
|
||||
if (project.android.hasProperty("namespace")) {
|
||||
namespace = "{{androidIdentifier}}"
|
||||
}
|
||||
|
||||
namespace = "{{androidIdentifier}}"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
|
@ -3054,8 +3054,6 @@ void main() {
|
||||
final String buildGradleContent = await buildGradleFile.readAsString();
|
||||
|
||||
expect(buildGradleContent.contains('namespace = "com.bar.foo.flutter_project"'), true);
|
||||
// The namespace should be conditionalized for AGP <4.2.
|
||||
expect(buildGradleContent.contains('if (project.android.hasProperty("namespace")) {'), true);
|
||||
});
|
||||
|
||||
testUsingContext('Android FFI plugin contains namespace', () async {
|
||||
@ -3077,8 +3075,6 @@ void main() {
|
||||
final String buildGradleContent = await buildGradleFile.readAsString();
|
||||
|
||||
expect(buildGradleContent.contains('namespace = "com.bar.foo.flutter_project"'), true);
|
||||
// The namespace should be conditionalized for AGP <4.2.
|
||||
expect(buildGradleContent.contains('if (project.android.hasProperty("namespace")) {'), true);
|
||||
});
|
||||
|
||||
testUsingContext('Android Kotlin plugin contains namespace', () async {
|
||||
@ -3101,8 +3097,6 @@ void main() {
|
||||
final String buildGradleContent = await buildGradleFile.readAsString();
|
||||
|
||||
expect(buildGradleContent.contains('namespace = "com.bar.foo.flutter_project"'), true);
|
||||
// The namespace should be conditionalized for AGP <4.2.
|
||||
expect(buildGradleContent.contains('if (project.android.hasProperty("namespace")) {'), true);
|
||||
});
|
||||
|
||||
testUsingContext('Flutter module Android project contains namespace', () async {
|
||||
@ -3128,13 +3122,6 @@ void main() {
|
||||
expect(moduleFlutterBuildGradleFileContent.contains(expectedNameSpace), true);
|
||||
const String expectedHostNameSpace = 'namespace = "com.bar.foo.flutter_project.host"';
|
||||
expect(moduleAppBuildGradleFileContent.contains(expectedHostNameSpace), true);
|
||||
|
||||
// The namespaces should be conditionalized for AGP <4.2.
|
||||
const String expectedConditional = 'if (project.android.hasProperty("namespace")) {';
|
||||
expect(moduleBuildGradleFileContent.contains(expectedConditional), true);
|
||||
expect(moduleAppBuildGradleFileContent.contains(expectedConditional), true);
|
||||
expect(moduleFlutterBuildGradleFileContent.contains(expectedConditional), true);
|
||||
|
||||
}, overrides: <Type, Generator>{
|
||||
Pub: () => Pub.test(
|
||||
fileSystem: globals.fs,
|
||||
|
Loading…
x
Reference in New Issue
Block a user