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
40 changes: 16 additions & 24 deletions wakelock_plus/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
group 'dev.fluttercommunity.plus.wakelock'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '2.2.0'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:8.12.1'
}
plugins {
id 'com.android.library'
}

rootProject.allprojects {
repositories {
google()
mavenCentral()
}
// Conditionally apply KGP only if AGP version is earlier than 9.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
if (agpMajor < 9) {
project.pluginManager.apply('org.jetbrains.kotlin.android')
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
group 'dev.fluttercommunity.plus.wakelock'
version '1.0-SNAPSHOT'

android {
namespace 'dev.fluttercommunity.plus.wakelock'
Expand All @@ -32,9 +20,6 @@ android {
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}
lintOptions {
disable 'InvalidPackage'
}
Expand All @@ -51,7 +36,6 @@ android {
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testImplementation 'org.jetbrains.kotlin:kotlin-test'
testImplementation 'org.mockito:mockito-core:5.0.0'
}
Expand All @@ -69,3 +53,11 @@ android {
}
}
}


kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}

18 changes: 14 additions & 4 deletions wakelock_plus/example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'dev.flutter.flutter-gradle-plugin'
}

// Conditionally apply KGP only if AGP version is earlier than 9.
def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
if (agpMajor < 9) {
project.pluginManager.apply('org.jetbrains.kotlin.android')
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand Down Expand Up @@ -31,9 +37,6 @@ android {
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -59,6 +62,13 @@ android {
}
}

kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}


flutter {
source '../..'
}
Expand Down
5 changes: 5 additions & 0 deletions wakelock_plus/example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
org.gradle.jvmargs=-Xmx4g
android.useAndroidX=true
android.enableJetifier=true

# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=false
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=false
Loading