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
19 changes: 13 additions & 6 deletions wakelock_plus/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ group 'dev.fluttercommunity.plus.wakelock'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '2.2.0'
repositories {
google()
mavenCentral()
Expand All @@ -21,7 +20,11 @@ rootProject.allprojects {
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int
if (agpMajor < 9) {
apply plugin: 'kotlin-android'
}

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

kotlinOptions {
jvmTarget = '17'
}
lintOptions {
disable 'InvalidPackage'
}
Expand All @@ -51,7 +51,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 +68,11 @@ android {
}
}
}


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

11 changes: 7 additions & 4 deletions wakelock_plus/example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'dev.flutter.flutter-gradle-plugin'
}
def localProperties = new Properties()
Expand Down Expand Up @@ -31,9 +30,6 @@ android {
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -59,6 +55,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
8 changes: 4 additions & 4 deletions wakelock_plus/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: wakelock_plus
description: >-2
description: >2-
Plugin that allows you to keep the device screen awake, i.e. prevent the screen from sleeping on
Android, iOS, macOS, Windows, Linux, and web.
version: 1.6.1
repository: https://github.com/fluttercommunity/wakelock_plus/tree/main/wakelock_plus

environment:
sdk: '>=3.10.0 <4.0.0'
sdk: ">=3.10.0 <4.0.0"
flutter: ">=3.38.0"

dependencies:
Expand All @@ -33,7 +33,7 @@ dev_dependencies:
flutter_lints: ^6.0.0
pigeon: ^26.2.3 # dart run pigeon --input "pigeons/messages.dart"
mocktail: ^1.0.5

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

Expand Down Expand Up @@ -99,4 +99,4 @@ flutter:
# https://flutter.dev/custom-fonts/#from-packages

assets:
- packages/wakelock_plus/assets/no_sleep.js
- packages/wakelock_plus/assets/no_sleep.js