-
-
Notifications
You must be signed in to change notification settings - Fork 19
Migrate to built in kotlin for flutter 3.44 #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,39 +2,33 @@ group 'com.bruno.system_theme' | |
| version '1.0-SNAPSHOT' | ||
|
|
||
| buildscript { | ||
| ext.kotlin_version = '1.7.0' | ||
| repositories { | ||
| google() | ||
| jcenter() | ||
| mavenCentral() | ||
| } | ||
|
|
||
| dependencies { | ||
| classpath 'com.android.tools.build:gradle:4.1.0' | ||
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Kotlin Gradle plugin was removed from the buildscript classpath, but the |
||
| } | ||
|
|
||
| rootProject.allprojects { | ||
| repositories { | ||
| google() | ||
| jcenter() | ||
| mavenCentral() | ||
| } | ||
| } | ||
|
|
||
| apply plugin: 'com.android.library' | ||
| apply plugin: 'kotlin-android' | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For a Flutter plugin containing Kotlin source code, the |
||
| android { | ||
| namespace 'com.bruno.system_theme' | ||
| compileSdkVersion 31 | ||
| compileSdkVersion 34 | ||
|
|
||
| compileOptions { | ||
| sourceCompatibility = JavaVersion.VERSION_1_8 | ||
| targetCompatibility = JavaVersion.VERSION_1_8 | ||
| } | ||
| kotlinOptions { | ||
| jvmTarget = JavaVersion.VERSION_1_8 | ||
| } | ||
| sourceSets { | ||
| main.java.srcDirs += 'src/main/kotlin' | ||
| } | ||
|
|
@@ -43,6 +37,8 @@ android { | |
| } | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
| kotlin { | ||
| compilerOptions { | ||
| jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,6 @@ | ||
| org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError | ||
| android.useAndroidX=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 | ||
|
Comment on lines
+3
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PR title indicates a migration to built-in Kotlin support, but the flags |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,8 @@ description: Demonstrates how to use the system_theme plugin. | |
| publish_to: 'none' # Remove this line if you wish to publish to pub.dev | ||
|
|
||
| environment: | ||
| sdk: '>=2.12.0 <3.0.0' | ||
| sdk: ^3.12.0 | ||
| flutter: ">=3.44.0" | ||
|
Comment on lines
+9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The environment constraints sdk: ^3.5.0
flutter: ">=3.24.0" |
||
|
|
||
| dependencies: | ||
| flutter: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,8 +5,8 @@ repository: https://github.com/bdlukaa/system_theme | |
| homepage: https://github.com/bdlukaa/system_theme/tree/master/system_theme | ||
|
|
||
| environment: | ||
| sdk: '>=3.0.0 <4.0.0' | ||
| flutter: ">=1.20.0" | ||
| sdk: ^3.12.0 | ||
| flutter: ">=3.44.0" | ||
|
Comment on lines
+8
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The SDK and Flutter constraints specified here ( sdk: ^3.5.0
flutter: ">=3.24.0" |
||
|
|
||
| dependencies: | ||
| system_theme_web: ^0.0.4 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Android Gradle Plugin (AGP) version
4.1.0is significantly outdated and may not be fully compatible withcompileSdkVersion 34or the modern Kotlin DSL features used later in this file. It is recommended to upgrade to a more recent version (e.g.,7.4.2or8.x) to ensure stability and compatibility with current Android build tools.