Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions packages/cloud_functions/cloud_functions/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ version = '1.0-SNAPSHOT'
apply plugin: 'com.android.library'
apply from: file("local-config.gradle")

// AGP 9+ uses built-in Kotlin unless android.builtInKotlin=false.
// Do not apply the Kotlin Gradle Plugin. Flutter flags that apply line
// even inside a version check, and AGP 10 rejects it.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
def builtInKotlin = providers.gradleProperty("android.builtInKotlin")
.map { it.toBoolean() }
.orElse(agpMajor >= 9)
.get()

buildscript {
repositories {
google()
Expand Down Expand Up @@ -86,7 +77,9 @@ android {

}

if (agpMajor >= 9 && builtInKotlin) {
// Built-in Kotlin registers this extension before the script gets here.
// When it is off, Flutter applies the Kotlin plugin after this script.
if (extensions.findByName("kotlin") != null) {
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(project.ext.javaVersion.toString())
Expand Down
13 changes: 3 additions & 10 deletions packages/firebase_ai/firebase_ai/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ version = '1.0-SNAPSHOT'
apply plugin: 'com.android.library'
apply from: file("local-config.gradle")

// AGP 9+ uses built-in Kotlin unless android.builtInKotlin=false.
// Do not apply the Kotlin Gradle Plugin. Flutter flags that apply line
// even inside a version check, and AGP 10 rejects it.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
def builtInKotlin = providers.gradleProperty("android.builtInKotlin")
.map { it.toBoolean() }
.orElse(agpMajor >= 9)
.get()

buildscript {
repositories {
google()
Expand Down Expand Up @@ -74,7 +65,9 @@ android {
}
}

if (agpMajor >= 9 && builtInKotlin) {
// Built-in Kotlin registers this extension before the script gets here.
// When it is off, Flutter applies the Kotlin plugin after this script.
if (extensions.findByName("kotlin") != null) {
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(project.ext.javaVersion.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ rootProject.allprojects {
}
}

// AGP 9+ uses built-in Kotlin unless android.builtInKotlin=false.
// Do not apply the Kotlin Gradle Plugin. Flutter flags that apply line
// even inside a version check, and AGP 10 rejects it.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
def builtInKotlin = providers.gradleProperty("android.builtInKotlin")
.map { it.toBoolean() }
.orElse(agpMajor >= 9)
.get()

def firebaseCoreProject = findProject(':firebase_core')
if (firebaseCoreProject == null) {
throw new GradleException('Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?')
Expand Down Expand Up @@ -79,7 +70,9 @@ android {
}
}

if (agpMajor >= 9 && builtInKotlin) {
// Built-in Kotlin registers this extension before the script gets here.
// When it is off, Flutter applies the Kotlin plugin after this script.
if (extensions.findByName("kotlin") != null) {
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(project.ext.javaVersion.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ rootProject.allprojects {
}
}

// AGP 9+ uses built-in Kotlin unless android.builtInKotlin=false.
// Do not apply the Kotlin Gradle Plugin. Flutter flags that apply line
// even inside a version check, and AGP 10 rejects it.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
def builtInKotlin = providers.gradleProperty("android.builtInKotlin")
.map { it.toBoolean() }
.orElse(agpMajor >= 9)
.get()

def firebaseCoreProject = findProject(':firebase_core')
if (firebaseCoreProject == null) {
throw new GradleException('Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?')
Expand Down Expand Up @@ -81,7 +72,9 @@ android {
}
}

if (agpMajor >= 9 && builtInKotlin) {
// Built-in Kotlin registers this extension before the script gets here.
// When it is off, Flutter applies the Kotlin plugin after this script.
if (extensions.findByName("kotlin") != null) {
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(project.ext.javaVersion.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ rootProject.allprojects {
}
}

// AGP 9+ uses built-in Kotlin unless android.builtInKotlin=false.
// Do not apply the Kotlin Gradle Plugin. Flutter flags that apply line
// even inside a version check, and AGP 10 rejects it.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
def builtInKotlin = providers.gradleProperty("android.builtInKotlin")
.map { it.toBoolean() }
.orElse(agpMajor >= 9)
.get()

def firebaseCoreProject = rootProject.subprojects.find { it.name == "firebase_core" }
if (firebaseCoreProject == null) {
throw new GradleException('Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?')
Expand Down Expand Up @@ -82,7 +73,9 @@ dependencies {
implementation 'androidx.annotation:annotation:1.7.0'
}

if (agpMajor >= 9 && builtInKotlin) {
// Built-in Kotlin registers this extension before the script gets here.
// When it is off, Flutter applies the Kotlin plugin after this script.
if (extensions.findByName("kotlin") != null) {
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(project.ext.javaVersion.toString())
Expand Down
13 changes: 3 additions & 10 deletions packages/firebase_auth/firebase_auth/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ rootProject.allprojects {
}
}

// AGP 9+ uses built-in Kotlin unless android.builtInKotlin=false.
// Do not apply the Kotlin Gradle Plugin. Flutter flags that apply line
// even inside a version check, and AGP 10 rejects it.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
def builtInKotlin = providers.gradleProperty("android.builtInKotlin")
.map { it.toBoolean() }
.orElse(agpMajor >= 9)
.get()

def firebaseCoreProject = findProject(':firebase_core')
if (firebaseCoreProject == null) {
throw new GradleException('Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?')
Expand Down Expand Up @@ -78,7 +69,9 @@ android {
}
}

if (agpMajor >= 9 && builtInKotlin) {
// Built-in Kotlin registers this extension before the script gets here.
// When it is off, Flutter applies the Kotlin plugin after this script.
if (extensions.findByName("kotlin") != null) {
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(project.ext.javaVersion.toString())
Expand Down
13 changes: 3 additions & 10 deletions packages/firebase_core/firebase_core/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ rootProject.allprojects {
}
}

// AGP 9+ uses built-in Kotlin unless android.builtInKotlin=false.
// Do not apply the Kotlin Gradle Plugin. Flutter flags that apply line
// even inside a version check, and AGP 10 rejects it.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
def builtInKotlin = providers.gradleProperty("android.builtInKotlin")
.map { it.toBoolean() }
.orElse(agpMajor >= 9)
.get()

def getRootProjectExtOrDefaultProperty(name) {
if (!rootProject.ext.has("FlutterFire")) return project.properties[name]
if (!rootProject.ext.get("FlutterFire")[name]) return project.properties[name]
Expand Down Expand Up @@ -72,7 +63,9 @@ android {
}
}

if (agpMajor >= 9 && builtInKotlin) {
// Built-in Kotlin registers this extension before the script gets here.
// When it is off, Flutter applies the Kotlin plugin after this script.
if (extensions.findByName("kotlin") != null) {
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(project.ext.javaVersion.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ rootProject.allprojects {
}
}

// AGP 9+ uses built-in Kotlin unless android.builtInKotlin=false.
// Do not apply the Kotlin Gradle Plugin. Flutter flags that apply line
// even inside a version check, and AGP 10 rejects it.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
def builtInKotlin = providers.gradleProperty("android.builtInKotlin")
.map { it.toBoolean() }
.orElse(agpMajor >= 9)
.get()

def firebaseCoreProject = findProject(':firebase_core')
if (firebaseCoreProject == null) {
throw new GradleException('Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?')
Expand Down Expand Up @@ -83,7 +74,9 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
}

if (agpMajor >= 9 && builtInKotlin) {
// Built-in Kotlin registers this extension before the script gets here.
// When it is off, Flutter applies the Kotlin plugin after this script.
if (extensions.findByName("kotlin") != null) {
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(project.ext.javaVersion.toString())
Expand Down
13 changes: 3 additions & 10 deletions packages/firebase_database/firebase_database/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ version = '1.0-SNAPSHOT'
apply plugin: 'com.android.library'
apply from: file("local-config.gradle")

// AGP 9+ uses built-in Kotlin unless android.builtInKotlin=false.
// Do not apply the Kotlin Gradle Plugin. Flutter flags that apply line
// even inside a version check, and AGP 10 rejects it.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
def builtInKotlin = providers.gradleProperty("android.builtInKotlin")
.map { it.toBoolean() }
.orElse(agpMajor >= 9)
.get()

buildscript {
repositories {
google()
Expand Down Expand Up @@ -82,7 +73,9 @@ android {
}
}

if (agpMajor >= 9 && builtInKotlin) {
// Built-in Kotlin registers this extension before the script gets here.
// When it is off, Flutter applies the Kotlin plugin after this script.
if (extensions.findByName("kotlin") != null) {
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(project.ext.javaVersion.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ rootProject.allprojects {
}
}

// AGP 9+ uses built-in Kotlin unless android.builtInKotlin=false.
// Do not apply the Kotlin Gradle Plugin. Flutter flags that apply line
// even inside a version check, and AGP 10 rejects it.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
def builtInKotlin = providers.gradleProperty("android.builtInKotlin")
.map { it.toBoolean() }
.orElse(agpMajor >= 9)
.get()

def firebaseCoreProject = findProject(':firebase_core')
if (firebaseCoreProject == null) {
throw new GradleException('Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?')
Expand Down Expand Up @@ -84,7 +75,9 @@ android {
}
}

if (agpMajor >= 9 && builtInKotlin) {
// Built-in Kotlin registers this extension before the script gets here.
// When it is off, Flutter applies the Kotlin plugin after this script.
if (extensions.findByName("kotlin") != null) {
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(project.ext.javaVersion.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ version = '1.0-SNAPSHOT'
apply plugin: 'com.android.library'
apply from: file("local-config.gradle")

// AGP 9+ uses built-in Kotlin unless android.builtInKotlin=false.
// Do not apply the Kotlin Gradle Plugin. Flutter flags that apply line
// even inside a version check, and AGP 10 rejects it.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
def builtInKotlin = providers.gradleProperty("android.builtInKotlin")
.map { it.toBoolean() }
.orElse(agpMajor >= 9)
.get()

buildscript {
repositories {
google()
Expand Down Expand Up @@ -79,7 +70,9 @@ android {
}
}

if (agpMajor >= 9 && builtInKotlin) {
// Built-in Kotlin registers this extension before the script gets here.
// When it is off, Flutter applies the Kotlin plugin after this script.
if (extensions.findByName("kotlin") != null) {
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(project.ext.javaVersion.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ rootProject.allprojects {
}
}

// AGP 9+ uses built-in Kotlin unless android.builtInKotlin=false.
// Do not apply the Kotlin Gradle Plugin. Flutter flags that apply line
// even inside a version check, and AGP 10 rejects it.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
def builtInKotlin = providers.gradleProperty("android.builtInKotlin")
.map { it.toBoolean() }
.orElse(agpMajor >= 9)
.get()

def firebaseCoreProject = findProject(':firebase_core')
if (firebaseCoreProject == null) {
throw new GradleException('Could not find the firebase_core FlutterFire plugin, have you added it as a dependency in your pubspec?')
Expand Down Expand Up @@ -79,7 +70,9 @@ android {
}
}

if (agpMajor >= 9 && builtInKotlin) {
// Built-in Kotlin registers this extension before the script gets here.
// When it is off, Flutter applies the Kotlin plugin after this script.
if (extensions.findByName("kotlin") != null) {
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(project.ext.javaVersion.toString())
Expand Down
13 changes: 3 additions & 10 deletions packages/firebase_storage/firebase_storage/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@ def getRootProjectExtOrCoreProperty(name, firebaseCoreProject) {
return rootProject.ext.get('FlutterFire').get(name)
}

// AGP 9+ uses built-in Kotlin unless android.builtInKotlin=false.
// Do not apply the Kotlin Gradle Plugin. Flutter flags that apply line
// even inside a version check, and AGP 10 rejects it.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
def builtInKotlin = providers.gradleProperty("android.builtInKotlin")
.map { it.toBoolean() }
.orElse(agpMajor >= 9)
.get()

android {
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
Expand Down Expand Up @@ -87,7 +78,9 @@ android {
}
}

if (agpMajor >= 9 && builtInKotlin) {
// Built-in Kotlin registers this extension before the script gets here.
// When it is off, Flutter applies the Kotlin plugin after this script.
if (extensions.findByName("kotlin") != null) {
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(project.ext.javaVersion.toString())
Expand Down
Loading