Skip to content

Commit cff154a

Browse files
authored
Update to versions catalog and newer dependencies (#48)
1 parent 8952453 commit cff154a

File tree

387 files changed

+8467
-10040
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

387 files changed

+8467
-10040
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ trim_trailing_whitespace = true
1111
[*.gradle]
1212
ij_continuation_indent_size = 8
1313

14-
[{*.kt, *.kts}]
14+
[{*.kt,*.kts}]
1515
ij_continuation_indent_size = 8
1616
ij_kotlin_assignment_wrap = normal
1717
ij_kotlin_call_parameters_new_line_after_left_paren = true

.github/workflows/build.yml

+16-57
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,23 @@ on:
1111
- main
1212

1313
jobs:
14-
validation:
15-
name: "Validation"
16-
runs-on: ubuntu-latest
17-
steps:
18-
- uses: actions/checkout@v2
19-
- uses: gradle/wrapper-validation-action@v1
20-
21-
create_staging_repository:
22-
runs-on: ubuntu-latest
23-
needs: [ validation ]
24-
name: Create staging repository
25-
outputs:
26-
repository_id: ${{ steps.create.outputs.repository_id }}
27-
steps:
28-
- id: create
29-
if: startsWith(github.ref, 'refs/tags/')
30-
uses: nexus-actions/[email protected]
31-
with:
32-
username: appmattus
33-
password: ${{ secrets.SONATYPE_PASSWORD }}
34-
staging_profile_id: ${{ secrets.SONATYPE_PROFILE_ID }}
35-
description: ${{ github.repository }}/${{ github.workflow }}#${{ github.run_number }}
36-
3714
build:
38-
needs: [ create_staging_repository ]
39-
runs-on: ${{ matrix.os }}
40-
strategy:
41-
matrix:
42-
os: [ macOS-latest, ubuntu-latest, windows-latest ]
15+
runs-on: macos-11
4316
steps:
44-
- uses: actions/checkout@v2
45-
- uses: actions/setup-java@v2
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-java@v4
4619
with:
4720
distribution: 'zulu'
48-
java-version: '11'
21+
java-version: '17'
22+
23+
- name: Setup Gradle
24+
uses: gradle/actions/setup-gradle@v3
25+
26+
- name: konan cache
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.konan
30+
key: ${{ runner.os }}-konan
4931

5032
- name: Check
5133
run: ./gradlew check
@@ -54,42 +36,19 @@ jobs:
5436
run: ./gradlew build -x check -x lintVitalRelease
5537

5638
- name: Prepare tag properties (*nix)
39+
if: runner.os != 'Windows' && startsWith(github.ref, 'refs/tags/')
5740
run: |
5841
echo "${{secrets.GPG_SIGNING_SECRET_KEY_RING_FILE_BASE64}}" > $HOME/.gradle/sonatype-appmattus-keys.gpg.b64
5942
base64 -d $HOME/.gradle/sonatype-appmattus-keys.gpg.b64 > $HOME/.gradle/sonatype-appmattus-keys.gpg
6043
echo "${{secrets.GPG_GRADLE_PROPERTIES}}" > $HOME/.gradle/gradle.properties
61-
if: runner.os != 'Windows' && startsWith(github.ref, 'refs/tags/')
6244
6345
- name: Prepare tag properties (windows)
46+
if: runner.os == 'Windows' && startsWith(github.ref, 'refs/tags/')
6447
run: |
6548
echo "${{secrets.GPG_SIGNING_SECRET_KEY_RING_FILE_BASE64}}" > $HOME/.gradle/sonatype-appmattus-keys.gpg.b64
6649
certutil -decode $HOME/.gradle/sonatype-appmattus-keys.gpg.b64 $HOME/.gradle/sonatype-appmattus-keys.gpg
6750
echo "${{secrets.GPG_GRADLE_PROPERTIES}}" > $HOME/.gradle/gradle.properties
68-
if: runner.os == 'Windows' && startsWith(github.ref, 'refs/tags/')
6951
7052
- name: Upload tag
7153
if: startsWith(github.ref, 'refs/tags/')
72-
env:
73-
SONATYPE_REPOSITORY_ID: ${{ needs.create_staging_repository.outputs.repository_id }}
74-
run: ./gradlew publish -P"signing.secretKeyRingFile=$(echo $HOME/.gradle/sonatype-appmattus-keys.gpg)"
75-
76-
close:
77-
if: startsWith(github.ref, 'refs/tags/')
78-
needs: [ build ]
79-
runs-on: ubuntu-latest
80-
steps:
81-
- uses: actions/checkout@v2
82-
- uses: actions/setup-java@v2
83-
with:
84-
distribution: 'zulu'
85-
java-version: '11'
86-
87-
- name: Prepare tag properties (*nix)
88-
run: |
89-
mkdir -p $HOME/.gradle
90-
echo "${{secrets.GPG_SIGNING_SECRET_KEY_RING_FILE_BASE64}}" > $HOME/.gradle/sonatype-appmattus-keys.gpg.b64
91-
base64 -d $HOME/.gradle/sonatype-appmattus-keys.gpg.b64 > $HOME/.gradle/sonatype-appmattus-keys.gpg
92-
echo "${{secrets.GPG_GRADLE_PROPERTIES}}" > $HOME/.gradle/gradle.properties
93-
94-
- name: Close and release tag
95-
run: ./gradlew closeAndReleaseRepository
54+
run: ./gradlew publishAllPublicationsToMavenCentral -P"signing.secretKeyRingFile=$(echo $HOME/.gradle/sonatype-appmattus-keys.gpg)"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: "Validate Gradle Wrapper"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '**'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
validation:
15+
name: "Validation"
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: gradle/actions/wrapper-validation@v3

build.gradle.kts

+40-45
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 Appmattus Limited
2+
* Copyright 2021-2024 Appmattus Limited
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,58 +14,59 @@
1414
* limitations under the License.
1515
*/
1616

17-
import com.vanniktech.maven.publish.MavenPublishBaseExtension
18-
import com.vanniktech.maven.publish.SonatypeHost.DEFAULT
19-
import io.gitlab.arturbosch.detekt.Detekt
20-
21-
plugins {
22-
id("io.gitlab.arturbosch.detekt") version Versions.detektGradlePlugin
23-
id("com.appmattus.markdown") version Versions.markdownlintGradlePlugin
24-
id("com.vanniktech.maven.publish") version Versions.gradleMavenPublishPlugin apply false
25-
id("org.jetbrains.dokka") version Versions.dokkaPlugin
26-
}
17+
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
2718

2819
buildscript {
29-
repositories {
30-
gradlePluginPortal()
31-
google()
32-
mavenCentral()
33-
}
3420
dependencies {
35-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}")
36-
classpath("com.android.tools.build:gradle:${Versions.androidGradlePlugin}")
37-
classpath("com.google.dagger:hilt-android-gradle-plugin:${Versions.Google.dagger}")
38-
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:${Versions.AndroidX.navigation}")
21+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlin.get()}")
22+
classpath("com.google.dagger:hilt-android-gradle-plugin:${libs.versions.google.dagger.get()}")
23+
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:${libs.versions.androidX.navigation.get()}")
3924
}
4025
}
4126

42-
apply(from = "$rootDir/gradle/scripts/dependencyUpdates.gradle.kts")
27+
plugins {
28+
alias(libs.plugins.android.application) apply false
29+
alias(libs.plugins.android.library) apply false
30+
alias(libs.plugins.markdownlintGradlePlugin)
31+
alias(libs.plugins.gradleMavenPublishPlugin) apply false
32+
alias(libs.plugins.dokkaPlugin)
33+
alias(libs.plugins.gradleVersionsPlugin)
34+
}
4335

4436
allprojects {
4537
repositories {
46-
gradlePluginPortal()
38+
//noinspection JcenterRepositoryObsolete Just needed for Groupie
39+
@Suppress("DEPRECATION")
40+
jcenter()
4741
google()
4842
mavenCentral()
49-
maven(url = "https://kotlin.bintray.com/kotlinx/")
5043
}
5144
}
5245

53-
dependencies {
54-
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:${Versions.detektGradlePlugin}")
55-
}
56-
57-
tasks.withType<Detekt> {
58-
jvmTarget = "1.8"
59-
}
60-
61-
detekt {
62-
input = files(subprojects.map { File(it.projectDir, "src") })
63-
64-
buildUponDefaultConfig = true
65-
66-
autoCorrect = true
67-
68-
config = files("detekt-config.yml")
46+
apply(from = "gradle/scripts/detekt.gradle.kts")
47+
48+
tasks.withType<DependencyUpdatesTask> {
49+
resolutionStrategy {
50+
componentSelection {
51+
all {
52+
fun isNonStable(version: String) = listOf(
53+
"alpha",
54+
"beta",
55+
"rc",
56+
"cr",
57+
"m",
58+
"preview",
59+
"b",
60+
"ea"
61+
).any { qualifier ->
62+
version.matches(Regex("(?i).*[.-]$qualifier[.\\d-+]*"))
63+
}
64+
if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
65+
reject("Release candidate")
66+
}
67+
}
68+
}
69+
}
6970
}
7071

7172
tasks.maybeCreate("check").dependsOn(tasks.named("detekt"))
@@ -92,10 +93,4 @@ allprojects {
9293
}
9394
}
9495
}
95-
96-
plugins.withId("com.vanniktech.maven.publish.base") {
97-
configure<MavenPublishBaseExtension> {
98-
publishToMavenCentral(DEFAULT, System.getenv("SONATYPE_REPOSITORY_ID"))
99-
}
100-
}
10196
}

buildSrc/src/main/kotlin/Versions.kt

-50
This file was deleted.

0 commit comments

Comments
 (0)