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

Update dependencies and remove automated plugins for other projects #217

Merged
merged 14 commits into from
Feb 21, 2022
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
31 changes: 2 additions & 29 deletions AlwaysOnKotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,17 @@
*/

buildscript {
ext.kotlin_version = "1.6.10"
repositories {
google()
mavenCentral()
}

dependencies {
classpath libs.android.build.gradle
classpath libs.kotlin.gradle.plugin
}
}

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 {
Expand All @@ -52,17 +39,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
}
}
6 changes: 3 additions & 3 deletions AlwaysOnKotlin/compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/

plugins {
id "com.android.application"
id "kotlin-android"
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
Expand Down Expand Up @@ -52,7 +52,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion "1.1.0-rc02"
kotlinCompilerExtensionVersion libs.versions.compose.get()
}

// Workaround for https://github.com/Kotlin/kotlinx.coroutines/issues/2023
Expand Down
1 change: 0 additions & 1 deletion AlwaysOnKotlin/compose/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
the same (already active) Activity.
-->
<activity android:name="com.example.android.wearable.wear.alwayson.MainActivity"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:configChanges="orientation|keyboardHidden"
android:exported="true">
Expand Down
80 changes: 40 additions & 40 deletions AlwaysOnKotlin/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
[versions]
androidx-activity = "1.4.0"
compose-ui = "1.1.0-rc01"
androidx-test = "1.4.0"
androidx-wear-compose = "1.0.0-alpha13"
androidx-wear-compose = "1.0.0-alpha16"
compose = "1.2.0-alpha03"
org-jetbrains-kotlinx = "1.6.0"

[libraries]
android-build-gradle = "com.android.tools.build:gradle:7.1.1"
android-lint-gradle = "com.android.tools.lint:lint-gradle:30.1.1"
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems stricter, from CI failures.

> Task :views:lintDebug FAILED
/home/runner/work/wear-os-samples/wear-os-samples/AlwaysOnKotlin/views/src/main/AndroidManifest.xml:43: Error: Redundant label can be removed [RedundantLabel]
            android:label="@string/app_name"
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, but it's even better. Should be fixed now

androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "androidx-activity" }
compose-compiler = "androidx.compose.compiler:compiler:1.1.0-rc02"
compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose-ui" }
compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose-ui" }
compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "compose-ui" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose-ui" }
androidx-core-ktx = "androidx.core:core-ktx:1.7.0"
androidx-databinding-viewbinding = "androidx.databinding:viewbinding:7.0.4"
androidx-lifecycle-runtime-ktx = "androidx.lifecycle:lifecycle-runtime-ktx:2.4.0"
androidx-databinding-viewbinding = "androidx.databinding:viewbinding:7.1.1"
androidx-lifecycle-runtime-ktx = "androidx.lifecycle:lifecycle-runtime-ktx:2.4.1"
androidx-wear = "androidx.wear:wear:1.2.0"
androidx-window = "androidx.window:window:1.0.0"
com-google-truth = "com.google.truth:truth:1.1.3"
compose-compiler = "androidx.compose.compiler:compiler:1.1.0"
compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose" }
compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "compose" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
jacoco-ant = "org.jacoco:org.jacoco.ant:0.8.7"
kotlin-gradle-plugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "org-jetbrains-kotlinx" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "org-jetbrains-kotlinx" }
test-core = { module = "androidx.test:core", version.ref = "androidx-test" }
test-core-ktx = { module = "androidx.test:core-ktx", version.ref = "androidx-test" }
test-espresso-core = "androidx.test.espresso:espresso-core:3.4.0"
Expand All @@ -25,41 +34,32 @@ test-ext-truth = "androidx.test.ext:truth:1.4.0"
test-rules = { module = "androidx.test:rules", version.ref = "androidx-test" }
test-runner = { module = "androidx.test:runner", version.ref = "androidx-test" }
test-uiautomator = "androidx.test.uiautomator:uiautomator:2.2.0"
androidx-wear = "androidx.wear:wear:1.2.0"
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" }
androidx-window = "androidx.window:window:1.0.0-rc01"
android-build-gradle = "com.android.tools.build:gradle:7.0.4"
android-lint-gradle = "com.android.tools.lint:lint-gradle:30.0.4"
com-google-truth = "com.google.truth:truth:1.1.2"
jacoco-ant = "org.jacoco:org.jacoco.ant:0.8.3"
kotlin-gradle-plugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "org-jetbrains-kotlinx" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "org-jetbrains-kotlinx" }

[plugins]
android = "android:7.0.4"
android-library = "android-library:7.0.4"
android-reporting = "android-reporting:7.0.4"
com-android-application = "com.android.application:7.0.4"
com-android-asset-pack = "com.android.asset-pack:7.0.4"
com-android-asset-pack-bundle = "com.android.asset-pack-bundle:7.0.4"
com-android-base = "com.android.base:7.0.4"
com-android-dynamic-feature = "com.android.dynamic-feature:7.0.4"
com-android-internal-application = "com.android.internal.application:7.0.4"
com-android-internal-asset-pack = "com.android.internal.asset-pack:7.0.4"
com-android-internal-asset-pack-bundle = "com.android.internal.asset-pack-bundle:7.0.4"
com-android-internal-dynamic-feature = "com.android.internal.dynamic-feature:7.0.4"
com-android-internal-library = "com.android.internal.library:7.0.4"
com-android-internal-reporting = "com.android.internal.reporting:7.0.4"
com-android-internal-test = "com.android.internal.test:7.0.4"
com-android-internal-version-check = "com.android.internal.version-check:7.0.4"
com-android-library = "com.android.library:7.0.4"
com-android-lint = "com.android.lint:7.0.4"
com-android-reporting = "com.android.reporting:7.0.4"
com-android-test = "com.android.test:7.0.4"
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"
com-github-ben-manes-versions = "com.github.ben-manes.versions:0.42.0"
kotlin = "kotlin:1.6.10"
kotlin-android = "kotlin-android:1.6.10"
kotlin-android-extensions = "kotlin-android-extensions:1.6.10"
Expand Down
20 changes: 18 additions & 2 deletions AlwaysOnKotlin/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,24 @@
* limitations under the License.
*/

include ":compose"
include ":views"
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 {
google()
mavenCentral()
}
}

include ":compose"
include ":views"
4 changes: 2 additions & 2 deletions AlwaysOnKotlin/views/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/

plugins {
id "com.android.application"
id "kotlin-android"
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
Expand Down
1 change: 0 additions & 1 deletion AlwaysOnKotlin/views/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
the same (already active) Activity.
-->
<activity android:name="com.example.android.wearable.wear.alwayson.MainActivity"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:configChanges="orientation|keyboardHidden"
android:exported="true">
Expand Down
6 changes: 3 additions & 3 deletions ComposeStarter/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/
plugins {
id "com.android.application"
id "kotlin-android"
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
Expand Down Expand Up @@ -49,7 +49,7 @@ android {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion "$compose_version"
kotlinCompilerExtensionVersion libs.versions.compose.get()
}
packagingOptions {
resources {
Expand Down
40 changes: 2 additions & 38 deletions ComposeStarter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,7 @@
*/
// 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.1.0-rc01"
wear_compose_version = "1.0.0-alpha13"

junit_version = "4.13.2"
androidx_test_ext_junit_version = "1.1.3"
espresso_version = "3.4.0"
}

repositories {
google()
mavenCentral()
}
dependencies {
classpath libs.android.build.gradle
classpath libs.kotlin.gradle.plugin

// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -40,17 +24,11 @@ buildscript {
}

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 {
Expand All @@ -64,17 +42,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
}
}
Loading