Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ if (flutterVersionName == null) {
apply plugin: "com.android.dynamic-feature"

android {
namespace "io.flutter.integration.deferred_components_test.component1"
compileSdk 35
namespace = "io.flutter.integration.deferred_components_test.component1"
compileSdk = 35

// Flutter's CI installs the NDK at a non-standard path.
// This non-standard structure is initially created by
Expand All @@ -43,15 +43,15 @@ android {
}

defaultConfig {
minSdkVersion 21
targetSdkVersion 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
minSdk = 21
targetSdk = 35
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
}

compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apply plugin: 'com.android.application'

android {
namespace = "io.flutter.addtoapp"
compileSdk 35
compileSdk = 35

// Flutter's CI installs the NDK at a non-standard path.
// This non-standard structure is initially created by
Expand All @@ -23,11 +23,11 @@ android {
}

defaultConfig {
applicationId "io.flutter.addtoapp"
minSdkVersion 21
targetSdkVersion 35
versionCode 1
versionName "1.0"
applicationId = "io.flutter.addtoapp"
minSdk = 21
targetSdk = 35
versionCode = 1
versionName = "1.0"
}
// Test build types.
buildTypes {
Expand Down
45 changes: 44 additions & 1 deletion docs/contributing/Android-API-And-Related-Versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Gradle versions are the least likley to break across minor version updates.
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
```

### kotlin
### Kotlin

Changing kotlin versions is most likley to have an issue with another dependency and not the code under test.

Expand All @@ -120,3 +120,46 @@ ext.kotlin_version = "1.7.10"
...
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
```

### compileOptions and kotlinOptions

- sourceCompatibility must use JavaVersion.*
- targetCompatibility must use JavaVersion.*
- kotlinOptions jvmTarget should match the versions used by compileOptions or there should be a comment explaining why.
- jvmTarget should use JavaVersion.<SOMEVERSION>.toString() or there should be a comment explaining why.
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be useful to include examples as to why they would be different if there's a reason besides things getting out of date.

Also, I know you're not fixing the kotlinOptions jvmTarget usages in this PR but what do you think about leaving comments or todos on those usages as this documentation suggests should be done?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I had examples I would include them but for now I am allowing for me to not know every situation and building in a "break glass" if there is a good reason.

If I was going to modify each file I would just change the implementation rather than leave todos.
That work is done in #164200

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough! Was wondering if there was a blocker.


```
// Ok
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
```

```
// Not ok
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}
```

```
// Not ok
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

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