Skip to content

Commit 989c8e8

Browse files
authored
Bump Java to 17 (#42)
* raise Android SDK to 35 * raise min Android SDK to 21 as required by the Flutter 3.22 constraint * raise Dart SDK constraint to match Flutter 3.22 constraint * bump Gradle/Kotlin/AGP to match
1 parent 35f4292 commit 989c8e8

File tree

8 files changed

+28
-35
lines changed

8 files changed

+28
-35
lines changed

.github/workflows/test.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ jobs:
1717
- ubuntu-latest
1818
- macos-latest
1919
steps:
20-
- uses: actions/checkout@v1
21-
- uses: actions/setup-java@v1
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-java@v4
2222
with:
23-
java-version: '12.x'
24-
- uses: subosito/flutter-action@v1
23+
distribution: 'temurin'
24+
java-version: '17'
25+
- uses: subosito/flutter-action@v2
2526
with:
2627
channel: 'stable'
2728
- run: dart --version

android/build.gradle

+14-16
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ group 'net.wolverinebeach.flutter_timezone'
22
version '1.0-SNAPSHOT'
33

44
buildscript {
5-
ext.kotlin_version = '1.6.21'
5+
ext.kotlin_version = '1.7.10'
66
repositories {
77
google()
88
mavenCentral()
99
}
1010

1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:4.2.2'
12+
classpath 'com.android.tools.build:gradle:7.3.0'
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414
}
1515
}
@@ -26,30 +26,28 @@ apply plugin: 'kotlin-android'
2626

2727
android {
2828
namespace 'net.wolverinebeach.flutter_timezone'
29-
compileSdkVersion 34
29+
compileSdkVersion 35
30+
31+
compileOptions {
32+
sourceCompatibility = JavaVersion.VERSION_17
33+
targetCompatibility = JavaVersion.VERSION_17
34+
}
35+
36+
kotlinOptions {
37+
jvmTarget = JavaVersion.VERSION_17
38+
}
3039

3140
sourceSets {
3241
main.java.srcDirs += 'src/main/kotlin'
3342
}
3443
defaultConfig {
35-
targetSdkVersion 34
36-
minSdkVersion 16
44+
minSdkVersion 21
3745
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
3846
}
3947
lintOptions {
4048
disable 'InvalidPackage'
4149
}
4250
kotlinOptions {
43-
jvmTarget = JavaVersion.VERSION_1_8
51+
jvmTarget = JavaVersion.VERSION_17
4452
}
4553
}
46-
47-
dependencies {
48-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
49-
50-
}
51-
52-
java {
53-
sourceCompatibility = JavaVersion.VERSION_1_8
54-
targetCompatibility = JavaVersion.VERSION_1_8
55-
}

android/gradle/wrapper/gradle-wrapper.properties

-6
This file was deleted.

example/android/app/build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ if (flutterVersionName == null) {
2424

2525
android {
2626
namespace "net.wolverinebeach.flutter_timezone_example"
27-
compileSdk flutter.compileSdkVersion
27+
compileSdk 35
2828
ndkVersion flutter.ndkVersion
2929

3030
compileOptions {
31-
sourceCompatibility JavaVersion.VERSION_1_8
32-
targetCompatibility JavaVersion.VERSION_1_8
31+
sourceCompatibility JavaVersion.VERSION_17
32+
targetCompatibility JavaVersion.VERSION_17
3333
}
3434

3535
kotlinOptions {
36-
jvmTarget = '1.8'
36+
jvmTarget = JavaVersion.VERSION_17
3737
}
3838

3939
sourceSets {
@@ -46,7 +46,7 @@ android {
4646
// You can update the following values to match your application needs.
4747
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
4848
minSdkVersion flutter.minSdkVersion
49-
targetSdkVersion flutter.targetSdkVersion
49+
targetSdkVersion 35
5050
versionCode flutterVersionCode.toInteger()
5151
versionName flutterVersionName
5252
}

example/android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip

example/android/settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pluginManagement {
1919

2020
plugins {
2121
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
22-
id "com.android.application" version "7.3.0" apply false
22+
id "com.android.application" version "8.1.0" apply false
2323
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
2424
}
2525

example/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: "Demonstrates how to use the flutter_timezone plugin."
55
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
66

77
environment:
8-
sdk: '>=3.3.0 <4.0.0'
8+
sdk: '>=3.4.0 <4.0.0'
99

1010
# Dependencies specify other packages that your package needs in order to work.
1111
# To automatically upgrade your package dependencies to the latest versions

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 3.0.1
44
homepage: https://github.com/tjarvstrand/flutter_timezone
55

66
environment:
7-
sdk: '>=2.12.0 <4.0.0'
7+
sdk: '>=3.4.0 <4.0.0'
88
flutter: ">=3.22.0"
99

1010
dependencies:

0 commit comments

Comments
 (0)