Skip to content

Commit c32aae9

Browse files
authored
Update dependencies (#16)
* Use TOML file * Update AGP * Update libraries * Update Java * Fix detekt * Execute GA with Java 17 * Fix other GA * Remove deprecated config * Update elvishew * Update Okio * Update kotlin
1 parent 35021f2 commit c32aae9

File tree

10 files changed

+81
-45
lines changed

10 files changed

+81
-45
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ jobs:
88
steps:
99
- name: Checkout repo
1010
uses: actions/checkout@v2
11-
11+
12+
- uses: actions/setup-java@v3
13+
with:
14+
distribution: 'temurin' # This is the Ubuntu Default
15+
java-version: '17'
16+
1217
- name: Build library
1318
run: 'bash ./gradlew clean :library:assembleRelease'
1419

.github/workflows/tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ jobs:
1010
- name: Checkout
1111
uses: actions/checkout@v3
1212

13+
- uses: actions/setup-java@v3
14+
with:
15+
distribution: 'temurin' # This is the Ubuntu Default
16+
java-version: '17'
17+
1318
- name: Run checks
1419
if: success() || failure()
1520
run: ./gradlew check

app/build.gradle

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
plugins {
2-
id 'com.android.application'
3-
id 'kotlin-android'
2+
alias libs.plugins.com.android.application
3+
alias libs.plugins.kotlin.android
44
}
55

66
android {
7-
compileSdkVersion 33
8-
//noinspection GradleDependency
7+
compileSdk 34
98

109
defaultConfig {
1110
applicationId "com.telefonica.androidlogger.app"
1211
minSdkVersion 21
13-
targetSdkVersion 33
12+
targetSdkVersion 34
1413
versionCode 1
1514
versionName "1.0.0"
1615

@@ -23,16 +22,16 @@ android {
2322
}
2423
}
2524
compileOptions {
26-
sourceCompatibility JavaVersion.VERSION_11
27-
targetCompatibility JavaVersion.VERSION_11
25+
sourceCompatibility JavaVersion.VERSION_17
26+
targetCompatibility JavaVersion.VERSION_17
2827
}
2928
kotlinOptions {
30-
jvmTarget = '11'
29+
jvmTarget = '17'
3130
}
3231
namespace 'com.telefonica.androidlogger.app'
3332
}
3433

3534
dependencies {
36-
implementation 'androidx.appcompat:appcompat:1.2.0'
35+
implementation libs.androidx.appcompat
3736
implementation project(':library')
3837
}

app/src/main/java/com/telefonica/androidlogger/app/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class MainActivity : AppCompatActivity() {
2020

2121
private fun setupViews() {
2222
findViewById<Button>(R.id.button_add_logs).setOnClickListener {
23-
(1..NUMBER_OF_LOGS_TO_ADD).forEach {
23+
repeat(NUMBER_OF_LOGS_TO_ADD) {
2424
log(
2525
getRandomLogPriority(),
2626
getRandomLogTag(),

build.gradle

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
3-
ext.kotlin_version = '1.6.21'
4-
ext.support_version = "1.2.1"
53
repositories {
64
google()
75
jcenter()
86
maven {
97
url "https://plugins.gradle.org/m2/"
108
}
119
}
12-
dependencies {
13-
classpath 'com.android.tools.build:gradle:7.4.2'
14-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
15-
16-
// NOTE: Do not place your application dependencies here; they belong
17-
// in the individual module build.gradle files
18-
}
1910
}
2011

2112
plugins {
22-
id("io.gitlab.arturbosch.detekt").version("1.22.0")
23-
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' apply false
13+
alias libs.plugins.kotlin.android apply false
14+
alias libs.plugins.com.android.application apply false
15+
alias libs.plugins.com.android.library apply false
16+
alias libs.plugins.github.gradle.publish.plugin apply false
17+
18+
alias libs.plugins.gitlab.arturbosch.detekt
2419
}
2520

2621
detekt {
@@ -37,7 +32,7 @@ detekt {
3732
}
3833
}
3934

40-
tasks.detekt.jvmTarget = "11"
35+
tasks.detekt.jvmTarget = "17"
4136

4237
allprojects {
4338

gradle.properties

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@ org.gradle.jvmargs=-Xmx6656m -Dfile.encoding=UTF-8
1414
org.gradle.parallel=true
1515

1616
android.useAndroidX=true
17-
kapt.incremental.apt=true
18-
# It's going to be deleted in Kotlin 1.8
19-
kapt.use.worker.api=true
20-
21-
# This will be default on AGP 8.0
22-
android.r8.failOnMissingClasses=true
2317

2418
###### Project settings ######
2519
kotlin.code.style=official
20+
android.nonTransitiveRClass=false
21+
android.nonFinalResIds=false

gradle/libs.versions.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[versions]
2+
android-gradle-plugin = "8.7.2"
3+
junit = "4.13.2"
4+
kotlin = "1.9.21"
5+
androidx-lifecycle = "2.2.0"
6+
material = "1.9.0"
7+
elviswhew-xlog = "1.11.1"
8+
okio = "3.9.1"
9+
10+
[libraries]
11+
androidx-annotation = { module = "androidx.annotation:annotation", version = "1.9.1" }
12+
androidx-appcompat = { module = "androidx.appcompat:appcompat", version = "1.7.0" }
13+
androidx-lifecycle-extensions = { module = "androidx.lifecycle:lifecycle-extensions", version.ref = "androidx-lifecycle" }
14+
com-google-android-material = { module = "com.google.android.material:material", version.ref = "material" }
15+
com-squareup-okio = { module = "com.squareup.okio:okio", version.ref = "okio" }
16+
junit = { module = "junit:junit", version.ref = "junit" }
17+
org-jetbrains-kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
18+
elvishew-xlog = { module = "com.elvishew:xlog", version.ref = "elviswhew-xlog" }
19+
20+
[plugins]
21+
com-android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" }
22+
com-android-library = { id = "com.android.library", version.ref = "android-gradle-plugin" }
23+
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
24+
gitlab-arturbosch-detekt = "io.gitlab.arturbosch.detekt:1.23.7"
25+
github-gradle-publish-plugin = { id = "io.github.gradle-nexus.publish-plugin", version = "1.2.0" }
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

library/build.gradle

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
apply plugin: 'com.android.library'
2-
apply plugin: 'kotlin-android'
3-
apply plugin: 'kotlin-android-extensions'
1+
plugins{
2+
alias libs.plugins.kotlin.android
3+
alias libs.plugins.com.android.library
4+
}
45

56
android {
6-
compileSdkVersion 33
7+
compileSdk 34
78

89
defaultConfig {
910
minSdkVersion 21
10-
targetSdkVersion 33
11+
targetSdkVersion 34
1112
}
1213

1314
flavorDimensions "loggerMode"
@@ -24,25 +25,25 @@ android {
2425
lintConfig file('lint-custom.xml')
2526
}
2627
compileOptions {
27-
sourceCompatibility JavaVersion.VERSION_11
28-
targetCompatibility JavaVersion.VERSION_11
28+
sourceCompatibility JavaVersion.VERSION_17
29+
targetCompatibility JavaVersion.VERSION_17
2930
}
3031
kotlinOptions {
31-
jvmTarget = '11'
32+
jvmTarget = '17'
3233
}
3334
namespace 'com.telefonica.androidlogger'
3435
}
3536

3637
dependencies {
3738
//noinspection GradleDependency
38-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
39-
implementation "androidx.annotation:annotation:1.1.0"
40-
enabledImplementation "com.google.android.material:material:$support_version"
41-
enabledImplementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
42-
enabledImplementation "com.elvishew:xlog:1.11.0"
43-
enabledImplementation "com.squareup.okio:okio:2.7.0"
39+
implementation libs.org.jetbrains.kotlin
40+
implementation libs.androidx.annotation
41+
enabledImplementation libs.com.google.android.material
42+
enabledImplementation libs.androidx.lifecycle.extensions
43+
enabledImplementation libs.elvishew.xlog
44+
enabledImplementation libs.com.squareup.okio
4445

45-
testImplementation 'junit:junit:4.13'
46+
testImplementation libs.junit
4647
}
4748

4849
apply from: "${rootProject.projectDir}/mavencentral.gradle"

settings.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
pluginManagement {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
gradlePluginPortal()
6+
}
7+
}
8+
19
include ':app'
210
include ':library'

0 commit comments

Comments
 (0)