Skip to content
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

Upgrade to Compose-BoM 2023.01.00 (1.3.1), Kotlin 1.8.10 and compileSdk 33 #65

Open
wants to merge 3 commits into
base: ray/take-two
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ subprojects {
}

freeCompilerArgs = listOf(
"-Xopt-in=kotlin.RequiresOptIn"
"-opt-in=kotlin.RequiresOptIn"
)
}
}
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repositories {
}

dependencies {
implementation("com.android.tools.build:gradle:7.1.3")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.6.10")
implementation("com.android.tools.build:gradle:7.4.1")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.7.20")
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/DefaultAndroidConfigPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DefaultAndroidConfigPlugin : Plugin<Project> {
}

composeOptions {
kotlinCompilerExtensionVersion = Versions.compose
kotlinCompilerExtensionVersion = Versions.composeCompiler
}

packagingOptions {
Expand Down
24 changes: 13 additions & 11 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
object Versions {
const val compileSdk = 31
const val compileSdk = 33
const val minSdk = 21
const val targetSdk = 30
const val compose = "1.1.0"
const val targetSdk = 33
const val composeCompiler = "1.4.2"
const val composeBom = "2023.01.00"
}

object Dependencies {
object AndroidX {
const val appcompat = "androidx.appcompat:appcompat:1.3.1"
const val appcompat = "androidx.appcompat:appcompat:1.6.1"

// Note that we're not using the actual androidx material dep yet, it's still alpha.
const val material = "com.google.android.material:material:1.1.0"
Expand All @@ -16,13 +17,14 @@ object Dependencies {
}

object Compose {
const val activity = "androidx.activity:activity-compose:1.3.1"
const val foundation = "androidx.compose.foundation:foundation:${Versions.compose}"
const val icons = "androidx.compose.material:material-icons-extended:${Versions.compose}"
const val material = "androidx.compose.material:material:${Versions.compose}"
const val test = "androidx.compose.ui:ui-test-junit4:${Versions.compose}"
const val tooling = "androidx.compose.ui:ui-tooling:${Versions.compose}"
const val util = "androidx.compose.ui:ui-util:${Versions.compose}"
const val activity = "androidx.activity:activity-compose:1.6.1"
const val bom = "androidx.compose:compose-bom:${Versions.composeBom}"
const val foundation = "androidx.compose.foundation:foundation"
const val icons = "androidx.compose.material:material-icons-extended"
const val material = "androidx.compose.material:material"
const val test = "androidx.compose.ui:ui-test-junit4"
const val tooling = "androidx.compose.ui:ui-tooling"
const val util = "androidx.compose.ui:ui-util"
}

object Kotlin {
Expand Down
14 changes: 1 addition & 13 deletions buildSrc/src/main/java/ReleaseConfigPlugin.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.android.build.gradle.LibraryExtension
import org.gradle.api.GradleException
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.JavaBasePlugin
Expand Down Expand Up @@ -42,18 +41,7 @@ class ReleaseConfigPlugin : Plugin<Project> {
}

target.afterEvaluate {
val composeVersion = target.configurations
.flatMap { configuration ->
configuration.dependencies.filter { dependency ->
"androidx.compose" in dependency.group.orEmpty()
}
}
.map { it.version }
.distinct()
.singleOrNull()
?: throw GradleException("Found multiple Compose versions.")

target.version = "$releaseVersion+$composeVersion"
target.version = "$releaseVersion+${Versions.composeBom}"
.let { if (isRelease) it else "$it-SNAPSHOT" }

target.configure<PublishingExtension> {
Expand Down
7 changes: 7 additions & 0 deletions compose-backstack-viewer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ plugins {
}

android {
namespace = "com.zachklipp.compose.backstack.viewer"
testNamespace = "com.zachklipp.compose.backstack.viewer.test"

lintOptions {
// Workaround for lint bug.
disable += "InvalidFragmentVersionForActivityResult"
}
}

dependencies {
val composeBom = platform(Dependencies.Compose.bom)
implementation(composeBom)

compileOnly(Dependencies.Compose.tooling)

api(project(":compose-backstack"))
Expand All @@ -26,6 +32,7 @@ dependencies {
testImplementation(Dependencies.Test.junit)
testImplementation(Dependencies.Test.truth)

androidTestImplementation(composeBom)
androidTestImplementation(Dependencies.AndroidX.junitExt)
androidTestImplementation(Dependencies.Compose.test)
}
3 changes: 1 addition & 2 deletions compose-backstack-viewer/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zachklipp.compose.backstack.viewer.test">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<activity android:name="androidx.activity.ComponentActivity" android:theme="@style/TestTheme"/>
Expand Down
2 changes: 1 addition & 1 deletion compose-backstack-viewer/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="com.zachklipp.compose.backstack.viewer" />
<manifest />
7 changes: 7 additions & 0 deletions compose-backstack-xray/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ plugins {
}

android {
namespace = "com.zachklipp.compose.backstack.xray"
testNamespace = "com.zachklipp.compose.backstack.xray.test"

lintOptions {
// Workaround for lint bug.
disable += "InvalidFragmentVersionForActivityResult"
}
}

dependencies {
val composeBom = platform(Dependencies.Compose.bom)
implementation(composeBom)

api(project(":compose-backstack"))

implementation(Dependencies.Compose.foundation)
Expand All @@ -21,5 +27,6 @@ dependencies {
testImplementation(Dependencies.Test.truth)

androidTestImplementation(Dependencies.AndroidX.junitExt)
androidTestImplementation(composeBom)
androidTestImplementation(Dependencies.Compose.test)
}
3 changes: 1 addition & 2 deletions compose-backstack-xray/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zachklipp.compose.backstack.xray.test">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<activity android:name="android.app.Activity" android:theme="@style/TestTheme"/>
Expand Down
2 changes: 1 addition & 1 deletion compose-backstack-xray/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="com.zachklipp.compose.backstack.xray" />
<manifest />
9 changes: 9 additions & 0 deletions compose-backstack/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ plugins {
id("release-config")
}

android {
namespace = "com.zachklipp.compose.backstack"
testNamespace = "com.zachklipp.compose.backstack.test"
}

dependencies {
val composeBom = platform(Dependencies.Compose.bom)
implementation(composeBom)

compileOnly(Dependencies.Compose.tooling)

implementation(Dependencies.Compose.foundation)
Expand All @@ -13,6 +21,7 @@ dependencies {
testImplementation(Dependencies.Test.truth)

androidTestImplementation(Dependencies.AndroidX.junitExt)
androidTestImplementation(composeBom)
androidTestImplementation(Dependencies.Compose.test)
androidTestImplementation(Dependencies.Test.truth)
}
3 changes: 1 addition & 2 deletions compose-backstack/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zachklipp.compose.backstack.test">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<activity android:name="androidx.activity.ComponentActivity" android:theme="@style/TestTheme"/>
Expand Down
2 changes: 1 addition & 1 deletion compose-backstack/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="com.zachklipp.compose.backstack" />
<manifest />
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.zachklipp.compose.backstack

import androidx.annotation.VisibleForTesting
import androidx.annotation.VisibleForTesting.PRIVATE
import androidx.annotation.VisibleForTesting.Companion.PRIVATE
import androidx.compose.runtime.State
import androidx.compose.ui.layout.LayoutModifier
import androidx.compose.ui.layout.Measurable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.zachklipp.compose.backstack

import android.annotation.SuppressLint
import androidx.annotation.VisibleForTesting
import androidx.annotation.VisibleForTesting.PRIVATE
import androidx.annotation.VisibleForTesting.Companion.PRIVATE
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.AnimationSpec
import androidx.compose.animation.core.TweenSpec
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Mon Feb 20 21:19:48 EET 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 4 additions & 0 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
}

android {
namespace = "com.zachklipp.compose.backstack.sample"
defaultConfig {
applicationId = "com.zachklipp.compose.backstack.sample"
}
Expand All @@ -15,12 +16,15 @@ android {
}

dependencies {
val composeBom = platform(Dependencies.Compose.bom)
implementation(composeBom)
implementation(project(":compose-backstack-viewer"))
implementation(Dependencies.AndroidX.appcompat)
implementation(Dependencies.Compose.activity)
implementation(Dependencies.Compose.foundation)
implementation(Dependencies.Compose.util)

androidTestImplementation(Dependencies.AndroidX.junitExt)
androidTestImplementation(composeBom)
androidTestImplementation(Dependencies.Compose.test)
}
6 changes: 3 additions & 3 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zachklipp.compose.backstack.sample">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="false"
Expand All @@ -11,7 +10,8 @@

<activity
android:name=".ComposeBackstackActivity"
android:configChanges="orientation|screenSize|smallestScreenSize|fontScale|density|layoutDirection">
android:configChanges="orientation|screenSize|smallestScreenSize|fontScale|density|layoutDirection"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down