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
18 changes: 7 additions & 11 deletions system_theme/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The Android Gradle Plugin (AGP) version 4.1.0 is significantly outdated and may not be fully compatible with compileSdkVersion 34 or the modern Kotlin DSL features used later in this file. It is recommended to upgrade to a more recent version (e.g., 7.4.2 or 8.x) to ensure stability and compatibility with current Android build tools.

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The Kotlin Gradle plugin was removed from the buildscript classpath, but the kotlin configuration block at the end of this file (line 40) relies on classes provided by this plugin (specifically org.jetbrains.kotlin.gradle.dsl.JvmTarget). This will cause a build failure during Gradle evaluation. You should retain the Kotlin plugin in the buildscript dependencies.

        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.24"
    }

}

rootProject.allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

For a Flutter plugin containing Kotlin source code, the kotlin-android plugin must still be applied in the plugin's build.gradle file. While the "built-in Kotlin" migration simplifies configuration for the main application, plugin modules still require the Kotlin plugin to compile their source files. Removing this will result in the Kotlin code in src/main/kotlin being ignored during the build.

apply plugin: 'kotlin-android'

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'
}
Expand All @@ -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
}
}
11 changes: 6 additions & 5 deletions system_theme/example/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id("com.android.application")
id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
}
Expand All @@ -15,10 +14,6 @@ android {
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.bruno.system_theme_example"
Expand All @@ -39,6 +34,12 @@ android {
}
}

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

flutter {
source = "../.."
}
4 changes: 4 additions & 0 deletions system_theme/example/android/gradle.properties
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The PR title indicates a migration to built-in Kotlin support, but the flags android.builtInKotlin and android.newDsl are set to false. To actually enable the built-in Kotlin feature introduced in Flutter 3.24, these flags must be set to true.

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

24 changes: 12 additions & 12 deletions system_theme/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.4.1"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -108,26 +108,26 @@ packages:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
url: "https://pub.dev"
source: hosted
version: "0.12.17"
version: "0.12.19"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
version: "0.13.0"
meta:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.18.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -200,10 +200,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.11"
vector_math:
dependency: transitive
description:
Expand All @@ -229,5 +229,5 @@ packages:
source: hosted
version: "1.0.0"
sdks:
dart: ">=3.8.0-0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
dart: ">=3.12.0 <4.0.0"
flutter: ">=3.44.0"
3 changes: 2 additions & 1 deletion system_theme/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The environment constraints sdk: ^3.12.0 and flutter: ">=3.44.0" appear to be incorrect as these versions have not been released (current stable versions are Dart 3.5 and Flutter 3.24). These settings will prevent the package from being resolved by users. If you intended to target the versions that introduced built-in Kotlin support, you likely meant sdk: ^3.5.0 and flutter: ">=3.24.0".

  sdk: ^3.5.0
  flutter: ">=3.24.0"


dependencies:
flutter:
Expand Down
7 changes: 6 additions & 1 deletion system_theme/example/windows/flutter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake)
# https://github.com/flutter/flutter/issues/57146.
set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")

# Set fallback configurations for older versions of the flutter tool.
if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
set(FLUTTER_TARGET_PLATFORM "windows-x64")
endif()

# === Flutter Library ===
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")

Expand Down Expand Up @@ -91,7 +96,7 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E env
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
windows-x64 $<CONFIG>
${FLUTTER_TARGET_PLATFORM} $<CONFIG>
VERBATIM
)
add_custom_target(flutter_assemble DEPENDS
Expand Down
24 changes: 12 additions & 12 deletions system_theme/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.4.1"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -108,26 +108,26 @@ packages:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
url: "https://pub.dev"
source: hosted
version: "0.12.17"
version: "0.12.19"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
version: "0.13.0"
meta:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.18.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -193,10 +193,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.11"
vector_math:
dependency: transitive
description:
Expand All @@ -222,5 +222,5 @@ packages:
source: hosted
version: "1.0.0"
sdks:
dart: ">=3.8.0-0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
dart: ">=3.12.0 <4.0.0"
flutter: ">=3.44.0"
4 changes: 2 additions & 2 deletions system_theme/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The SDK and Flutter constraints specified here (sdk: ^3.12.0 and flutter: ">=3.44.0") refer to versions that do not yet exist in the stable channel. This will make the plugin unusable for all current Flutter users. Please verify and correct these versions to match the intended target (likely Flutter 3.24.0 and its corresponding Dart SDK).

  sdk: ^3.5.0
  flutter: ">=3.24.0"


dependencies:
system_theme_web: ^0.0.4
Expand Down