diff --git a/ComposeAdvanced/app/build.gradle b/ComposeAdvanced/app/build.gradle index 5d6098a9c..15b1be7f3 100644 --- a/ComposeAdvanced/app/build.gradle +++ b/ComposeAdvanced/app/build.gradle @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + plugins { - id "com.android.application" - id "kotlin-android" + id 'com.android.application' + id 'org.jetbrains.kotlin.android' } android { @@ -41,7 +42,6 @@ android { } kotlinOptions { jvmTarget = "1.8" - useIR = true freeCompilerArgs += "-Xjvm-default=compatibility" freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" // Allow for widescale experimental APIs in Alpha libraries we build upon @@ -53,7 +53,7 @@ android { compose true } composeOptions { - kotlinCompilerExtensionVersion "$compose_version" + kotlinCompilerExtensionVersion libs.versions.compose.get() } packagingOptions { resources { @@ -79,9 +79,8 @@ dependencies { // Annotation processor implementation libs.androidx.lifecycle.common.java8 - // Compose for Wear OS Dependencies - // Developer Preview starts with Alpha 07, with new releases coming soon. + // Developer Preview currently Alpha, with new releases coming soon. // NOTE: DO NOT INCLUDE a dependency on androidx.compose.material:material. // androidx.wear.compose:compose-material is designed as a replacement not an addition to // androidx.compose.material:material. If there are features from that you feel are missing from diff --git a/ComposeAdvanced/build.gradle b/ComposeAdvanced/build.gradle index 253d3a590..27d1453ec 100644 --- a/ComposeAdvanced/build.gradle +++ b/ComposeAdvanced/build.gradle @@ -14,44 +14,19 @@ * limitations under the License. */ // Top-level build file where you can add configuration options common to all sub-projects/modules. -buildscript { - ext { - // Dependency versions. - activity_compose_version = "1.4.0" - compose_version = "1.2.0-alpha02" - lifecycle_version = "2.4.0" - wear_compose_version = "1.0.0-alpha15" - - junit_version = "4.13.2" - androidx_test_ext_junit_version = "1.1.3" - espresso_version = "3.4.0" - } - repositories { - google() - mavenCentral() - } +buildscript { dependencies { - classpath libs.android.build.gradle classpath libs.kotlin.gradle.plugin - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files } } plugins { - id "com.diffplug.spotless" version "6.0.1" - id "com.github.ben-manes.versions" version "0.41.0" - id "nl.littlerobots.version-catalog-update" version "0.3.0" + alias(libs.plugins.com.diffplug.spotless) apply(false) + alias(libs.plugins.com.android.application) apply(false) } subprojects { - repositories { - google() - mavenCentral() - } - apply plugin: "com.diffplug.spotless" spotless { @@ -65,17 +40,3 @@ subprojects { } } } - -tasks.named("dependencyUpdates").configure { - rejectVersionIf { - (it.candidate.version ==~ /.*-alpha.*/ && !(it.currentVersion ==~ /.*-alpha.*/)) || - (it.candidate.version ==~ /.*-beta.*/ && !(it.currentVersion ==~ /.*-(beta|alpha).*/)) || - (it.candidate.version ==~ /.*1.6.20-M.*/) - } -} - -versionCatalogUpdate { - keep { - keepUnusedVersions = true - } -} diff --git a/ComposeAdvanced/gradle/libs.versions.toml b/ComposeAdvanced/gradle/libs.versions.toml index f945157b5..b4574e6d2 100644 --- a/ComposeAdvanced/gradle/libs.versions.toml +++ b/ComposeAdvanced/gradle/libs.versions.toml @@ -1,52 +1,51 @@ [versions] -compose-ui = "1.2.0-alpha02" -androidx-lifecycle = "2.4.0" -androidx-wear-compose = "1.0.0-alpha15" +androidx-lifecycle = "2.4.1" +androidx-wear-compose = "1.0.0-alpha16" +compose = "1.2.0-alpha03" [libraries] +android-build-gradle = "com.android.tools.build:gradle:7.1.1" androidx-activity-compose = "androidx.activity:activity-compose:1.4.0" -compose-compiler = "androidx.compose.compiler:compiler:1.2.0-alpha02" -compose-foundation = "androidx.compose.foundation:foundation:1.2.0-alpha02" -compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose-ui" } -compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose-ui" } -compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose-ui" } androidx-lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "androidx-lifecycle" } androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" } androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" } androidx-lifecycle-viewmodel-savedstate = { module = "androidx.lifecycle:lifecycle-viewmodel-savedstate", version.ref = "androidx-lifecycle" } +compose-compiler = "androidx.compose.compiler:compiler:1.2.0-alpha03" +compose-foundation = "androidx.compose.foundation:foundation:1.2.0-alpha03" +compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose" } +compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" } +compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" } +jacoco-ant = "org.jacoco:org.jacoco.ant:0.8.7" +junit = "junit:junit:4.13.2" +kotlin-gradle-plugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10" test-espresso-core = "androidx.test.espresso:espresso-core:3.4.0" test-ext-junit = "androidx.test.ext:junit:1.1.3" wear-compose-foundation = { module = "androidx.wear.compose:compose-foundation", version.ref = "androidx-wear-compose" } wear-compose-material = { module = "androidx.wear.compose:compose-material", version.ref = "androidx-wear-compose" } wear-compose-navigation = { module = "androidx.wear.compose:compose-navigation", version.ref = "androidx-wear-compose" } -android-build-gradle = "com.android.tools.build:gradle:7.1.0" -junit = "junit:junit:4.13.2" -jacoco-ant = "org.jacoco:org.jacoco.ant:0.8.3" -kotlin-gradle-plugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10" [plugins] -android = "android:7.1.0" -android-library = "android-library:7.1.0" -android-reporting = "android-reporting:7.1.0" -com-android-application = "com.android.application:7.1.0" -com-android-asset-pack = "com.android.asset-pack:7.1.0" -com-android-asset-pack-bundle = "com.android.asset-pack-bundle:7.1.0" -com-android-base = "com.android.base:7.1.0" -com-android-dynamic-feature = "com.android.dynamic-feature:7.1.0" -com-android-internal-application = "com.android.internal.application:7.1.0" -com-android-internal-asset-pack = "com.android.internal.asset-pack:7.1.0" -com-android-internal-asset-pack-bundle = "com.android.internal.asset-pack-bundle:7.1.0" -com-android-internal-dynamic-feature = "com.android.internal.dynamic-feature:7.1.0" -com-android-internal-library = "com.android.internal.library:7.1.0" -com-android-internal-reporting = "com.android.internal.reporting:7.1.0" -com-android-internal-test = "com.android.internal.test:7.1.0" -com-android-internal-version-check = "com.android.internal.version-check:7.1.0" -com-android-library = "com.android.library:7.1.0" -com-android-lint = "com.android.lint:7.1.0" -com-android-reporting = "com.android.reporting:7.1.0" -com-android-test = "com.android.test:7.1.0" -com-diffplug-spotless = "com.diffplug.spotless:6.0.1" -com-github-ben-manes-versions = "com.github.ben-manes.versions:0.41.0" +android = "android:7.1.1" +android-library = "android-library:7.1.1" +android-reporting = "android-reporting:7.1.1" +com-android-application = "com.android.application:7.1.1" +com-android-asset-pack = "com.android.asset-pack:7.1.1" +com-android-asset-pack-bundle = "com.android.asset-pack-bundle:7.1.1" +com-android-base = "com.android.base:7.1.1" +com-android-dynamic-feature = "com.android.dynamic-feature:7.1.1" +com-android-internal-application = "com.android.internal.application:7.1.1" +com-android-internal-asset-pack = "com.android.internal.asset-pack:7.1.1" +com-android-internal-asset-pack-bundle = "com.android.internal.asset-pack-bundle:7.1.1" +com-android-internal-dynamic-feature = "com.android.internal.dynamic-feature:7.1.1" +com-android-internal-library = "com.android.internal.library:7.1.1" +com-android-internal-reporting = "com.android.internal.reporting:7.1.1" +com-android-internal-test = "com.android.internal.test:7.1.1" +com-android-internal-version-check = "com.android.internal.version-check:7.1.1" +com-android-library = "com.android.library:7.1.1" +com-android-lint = "com.android.lint:7.1.1" +com-android-reporting = "com.android.reporting:7.1.1" +com-android-test = "com.android.test:7.1.1" +com-diffplug-spotless = "com.diffplug.spotless:6.3.0" kotlin = "kotlin:1.6.10" kotlin-android = "kotlin-android:1.6.10" kotlin-android-extensions = "kotlin-android-extensions:1.6.10" @@ -62,7 +61,6 @@ kotlin-platform-js = "kotlin-platform-js:1.6.10" kotlin-platform-jvm = "kotlin-platform-jvm:1.6.10" kotlin-scripting = "kotlin-scripting:1.6.10" kotlin2js = "kotlin2js:1.6.10" -nl-littlerobots-version-catalog-update = "nl.littlerobots.version-catalog-update:0.3.0" org-jetbrains-kotlin-android = "org.jetbrains.kotlin.android:1.6.10" org-jetbrains-kotlin-android-extensions = "org.jetbrains.kotlin.android.extensions:1.6.10" org-jetbrains-kotlin-js = "org.jetbrains.kotlin.js:1.6.10" diff --git a/ComposeAdvanced/settings.gradle b/ComposeAdvanced/settings.gradle index 1a3b929c4..a14d9d42f 100644 --- a/ComposeAdvanced/settings.gradle +++ b/ComposeAdvanced/settings.gradle @@ -13,6 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} + +// https://docs.gradle.org/7.4/userguide/declaring_dependencies.html#sec:type-safe-project-accessors +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { @@ -20,8 +31,6 @@ dependencyResolutionManagement { mavenCentral() } } + rootProject.name = "ComposeAdvanced" include ":app" - -// https://docs.gradle.org/7.4/userguide/declaring_dependencies.html#sec:type-safe-project-accessors -enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")