Skip to content

Update projects to Kotlin 2.0 #476

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

Merged
merged 15 commits into from
Sep 10, 2024
Merged
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
29 changes: 17 additions & 12 deletions CanonicalLayouts/feed-compose/app/build.gradle
Original file line number Diff line number Diff line change
@@ -17,15 +17,16 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id("org.jetbrains.kotlin.plugin.compose") version "2.0.0"
}

android {
compileSdk 33
compileSdk 35

defaultConfig {
applicationId "com.example.feed_compose"
minSdk 21
targetSdk 33
targetSdk 35
versionCode 1
versionName "1.0"

@@ -51,34 +52,38 @@ android {
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.3.2'
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
namespace 'com.example.feedcompose'
}

composeCompiler {
enableStrongSkippingMode = true

reportsDestination = layout.buildDirectory.dir("compose_compiler")
}

dependencies {
def composeBom = platform('androidx.compose:compose-bom:2022.10.00')
def composeBom = platform('androidx.compose:compose-bom:2024.08.00')
implementation(composeBom)
androidTestImplementation(composeBom)

implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.core:core-ktx:1.13.1'
implementation "androidx.compose.ui:ui"
implementation 'androidx.compose.material3:material3'
implementation 'androidx.compose.material3:material3-window-size-class'
implementation "androidx.compose.ui:ui-tooling-preview"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
implementation 'androidx.activity:activity-compose:1.6.1'
implementation 'androidx.navigation:navigation-compose:2.5.3'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.4'
implementation 'androidx.activity:activity-compose:1.9.1'
implementation 'androidx.navigation:navigation-compose:2.7.7'
implementation 'io.coil-kt:coil-compose:2.2.1'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4"
debugImplementation "androidx.compose.ui:ui-tooling"
debugImplementation "androidx.compose.ui:ui-test-manifest"
Original file line number Diff line number Diff line change
@@ -16,8 +16,7 @@
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.feedcompose">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />

6 changes: 3 additions & 3 deletions CanonicalLayouts/feed-compose/build.gradle
Original file line number Diff line number Diff line change
@@ -15,9 +15,9 @@
*/

plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
id 'com.android.application' version '8.6.0' apply false
id 'com.android.library' version '8.6.0' apply false
id 'org.jetbrains.kotlin.android' version '2.0.0' apply false
id 'com.diffplug.spotless' version '6.9.0'
}

4 changes: 3 additions & 1 deletion CanonicalLayouts/feed-compose/gradle.properties
Original file line number Diff line number Diff line change
@@ -20,4 +20,6 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Aug 10 10:35:30 JST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
21 changes: 11 additions & 10 deletions CanonicalLayouts/feed-view/app/build.gradle
Original file line number Diff line number Diff line change
@@ -20,12 +20,12 @@ plugins {
}

android {
compileSdk 32
compileSdk 35

defaultConfig {
applicationId "com.example.viewbasedfeedlayoutsample"
minSdk 21
targetSdk 32
targetSdk 35
versionCode 1
versionName "1.0"

@@ -48,19 +48,20 @@ android {
buildFeatures {
viewBinding true
}
namespace 'com.example.viewbasedfeedlayoutsample'
}

dependencies {
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.7.0-alpha03'
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7'
implementation 'androidx.navigation:navigation-ui-ktx:2.7.7'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'io.coil-kt:coil:2.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}
3 changes: 1 addition & 2 deletions CanonicalLayouts/feed-view/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -16,8 +16,7 @@
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.viewbasedfeedlayoutsample">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />

8 changes: 4 additions & 4 deletions CanonicalLayouts/feed-view/build.gradle
Original file line number Diff line number Diff line change
@@ -18,14 +18,14 @@ buildscript {
google()
}
dependencies {
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.1"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.7.7"
}
}

plugins {
id 'com.android.application' version '7.2.2' apply false
id 'com.android.library' version '7.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
id 'com.android.application' version '8.6.0' apply false
id 'com.android.library' version '8.6.0' apply false
id 'org.jetbrains.kotlin.android' version '2.0.0' apply false
id 'com.diffplug.spotless' version '6.9.0'
}

3 changes: 2 additions & 1 deletion CanonicalLayouts/feed-view/gradle.properties
Original file line number Diff line number Diff line change
@@ -20,4 +20,5 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true
android.nonFinalResIds=false
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Aug 03 13:58:14 JST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Original file line number Diff line number Diff line change
@@ -19,12 +19,12 @@ plugins {
}

android {
compileSdk 34
compileSdk 35

defaultConfig {
applicationId "com.example.activityembedding"
minSdk 31
targetSdk 34
targetSdk 35
versionCode 1
versionName "1.0"

@@ -73,5 +73,5 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-device:1.0.1'
androidTestImplementation("androidx.test.ext:junit-ktx:1.2.1")
androidTestImplementation("androidx.test.ext:truth:1.6.0")
androidTestImplementation("androidx.test:runner:1.6.1")
androidTestImplementation("androidx.test:runner:1.6.2")
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2022 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,28 +14,26 @@
limitations under the License.
-->
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cardView"
android:layout_height="wrap_content"
android:layout_width="match_parent"
app:cardCornerRadius="12dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
app:cardPreventCornerOverlap="true"
android:clickable="true"
app:cardBackgroundColor="@color/design_default_color_surface"
>
app:cardCornerRadius="12dp"
app:cardPreventCornerOverlap="true">

<TextView
android:id="@+id/textView"
android:layout_margin="8dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_margin="8dp"
android:background="?selectableItemBackground"
android:textAppearance="@style/TextAppearance.AppCompat.Button"

>
android:textColor="@color/design_default_color_primary"
tools:text="TextView">

</TextView>
</androidx.cardview.widget.CardView>
10 changes: 3 additions & 7 deletions CanonicalLayouts/list-detail-activity-embedding/build.gradle
Original file line number Diff line number Diff line change
@@ -15,11 +15,7 @@
*/
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.5.0' apply false
id 'com.android.library' version '8.5.0' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
}

task clean(type: Delete) {
delete rootProject.buildDir
id 'com.android.application' version '8.6.0' apply false
id 'com.android.library' version '8.6.0' apply false
id 'org.jetbrains.kotlin.android' version '2.0.0' apply false
}
Original file line number Diff line number Diff line change
@@ -27,5 +27,4 @@ kotlin.code.style=official
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
10 changes: 7 additions & 3 deletions CanonicalLayouts/list-detail-compose/app/build.gradle
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id("org.jetbrains.kotlin.plugin.compose") version "2.0.0"
}

android {
@@ -51,16 +52,19 @@ android {
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.5.8'
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}

composeCompiler {
enableStrongSkippingMode = true

reportsDestination = layout.buildDirectory.dir("compose_compiler")
}

dependencies {
def composeBom = platform('androidx.compose:compose-bom:2024.09.00')
implementation(composeBom)
2 changes: 1 addition & 1 deletion CanonicalLayouts/list-detail-compose/build.gradle
Original file line number Diff line number Diff line change
@@ -16,5 +16,5 @@
plugins {
id 'com.android.application' version '8.6.0' apply false
id 'com.android.library' version '8.6.0' apply false
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
id 'org.jetbrains.kotlin.android' version '2.0.0' apply false
}
20 changes: 10 additions & 10 deletions CanonicalLayouts/list-detail-sliding-pane/app/build.gradle
Original file line number Diff line number Diff line change
@@ -20,12 +20,12 @@ plugins {

android {
namespace 'com.example.listdetail.slidingpane'
compileSdk 33
compileSdk 35

defaultConfig {
applicationId "com.example.listdetail.slidingpane"
minSdk 21
targetSdk 33
targetSdk 35
versionCode 1
versionName "1.0"

@@ -53,15 +53,15 @@ android {

dependencies {

implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation "androidx.activity:activity:1.7.0-alpha02"
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation "androidx.activity:activity-ktx:1.9.1"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0"
implementation "androidx.navigation:navigation-fragment-ktx:2.5.3"
implementation "androidx.navigation:navigation-ui-ktx:2.5.3"
implementation "androidx.navigation:navigation-fragment-ktx:2.7.7"
implementation "androidx.navigation:navigation-ui-ktx:2.7.7"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}
6 changes: 3 additions & 3 deletions CanonicalLayouts/list-detail-sliding-pane/build.gradle
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
*/
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
id 'org.jetbrains.kotlin.android' version '1.6.21' apply false
id 'com.android.application' version '8.6.0' apply false
id 'com.android.library' version '8.6.0' apply false
id 'org.jetbrains.kotlin.android' version '2.0.0' apply false
}
3 changes: 2 additions & 1 deletion CanonicalLayouts/list-detail-sliding-pane/gradle.properties
Original file line number Diff line number Diff line change
@@ -20,4 +20,5 @@ kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true
android.nonFinalResIds=false
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed May 25 15:14:50 BST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Loading