mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

* Apply multidex login in kotlin dsl gradle file * Cleanup * Remove plugin parameter passing * Cleanup * Restore dependencies block * Analyzer * Compiles * Cleanup * Cleanup
34 lines
1.6 KiB
Plaintext
34 lines
1.6 KiB
Plaintext
// Copyright 2014 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
apply<FlutterPluginKts>()
|
|
|
|
class FlutterPluginKts : Plugin<Project> {
|
|
override fun apply(project: Project) {
|
|
// Use withGroovyBuilder and getProperty() to access Groovy metaprogramming.
|
|
project.withGroovyBuilder {
|
|
getProperty("android").withGroovyBuilder {
|
|
getProperty("defaultConfig").withGroovyBuilder {
|
|
if (project.hasProperty("multidex-enabled") &&
|
|
project.property("multidex-enabled").toString().toBoolean()) {
|
|
setProperty("multiDexEnabled", true)
|
|
getProperty("manifestPlaceholders").withGroovyBuilder {
|
|
setProperty("applicationName", "io.flutter.app.FlutterMultiDexApplication")
|
|
}
|
|
} else {
|
|
var baseApplicationName: String = "android.app.Application"
|
|
if (project.hasProperty("base-application-name")) {
|
|
baseApplicationName = project.property("base-application-name").toString()
|
|
}
|
|
// Setting to android.app.Application is the same as omitting the attribute.
|
|
getProperty("manifestPlaceholders").withGroovyBuilder {
|
|
setProperty("applicationName", baseApplicationName)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|