Skip to content

Commit

Permalink
Update dependencies (#16)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jdelga authored Dec 4, 2024
1 parent 35021f2 commit c32aae9
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 45 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v2


- uses: actions/setup-java@v3
with:
distribution: 'temurin' # This is the Ubuntu Default
java-version: '17'

- name: Build library
run: 'bash ./gradlew clean :library:assembleRelease'

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'temurin' # This is the Ubuntu Default
java-version: '17'

- name: Run checks
if: success() || failure()
run: ./gradlew check
Expand Down
17 changes: 8 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
alias libs.plugins.com.android.application
alias libs.plugins.kotlin.android
}

android {
compileSdkVersion 33
//noinspection GradleDependency
compileSdk 34

defaultConfig {
applicationId "com.telefonica.androidlogger.app"
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 34
versionCode 1
versionName "1.0.0"

Expand All @@ -23,16 +22,16 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '11'
jvmTarget = '17'
}
namespace 'com.telefonica.androidlogger.app'
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation libs.androidx.appcompat
implementation project(':library')
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MainActivity : AppCompatActivity() {

private fun setupViews() {
findViewById<Button>(R.id.button_add_logs).setOnClickListener {
(1..NUMBER_OF_LOGS_TO_ADD).forEach {
repeat(NUMBER_OF_LOGS_TO_ADD) {
log(
getRandomLogPriority(),
getRandomLogTag(),
Expand Down
19 changes: 7 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.6.21'
ext.support_version = "1.2.1"
repositories {
google()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

plugins {
id("io.gitlab.arturbosch.detekt").version("1.22.0")
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' apply false
alias libs.plugins.kotlin.android apply false
alias libs.plugins.com.android.application apply false
alias libs.plugins.com.android.library apply false
alias libs.plugins.github.gradle.publish.plugin apply false

alias libs.plugins.gitlab.arturbosch.detekt
}

detekt {
Expand All @@ -37,7 +32,7 @@ detekt {
}
}

tasks.detekt.jvmTarget = "11"
tasks.detekt.jvmTarget = "17"

allprojects {

Expand Down
8 changes: 2 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ org.gradle.jvmargs=-Xmx6656m -Dfile.encoding=UTF-8
org.gradle.parallel=true

android.useAndroidX=true
kapt.incremental.apt=true
# It's going to be deleted in Kotlin 1.8
kapt.use.worker.api=true

# This will be default on AGP 8.0
android.r8.failOnMissingClasses=true

###### Project settings ######
kotlin.code.style=official
android.nonTransitiveRClass=false
android.nonFinalResIds=false
25 changes: 25 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[versions]
android-gradle-plugin = "8.7.2"
junit = "4.13.2"
kotlin = "1.9.21"
androidx-lifecycle = "2.2.0"
material = "1.9.0"
elviswhew-xlog = "1.11.1"
okio = "3.9.1"

[libraries]
androidx-annotation = { module = "androidx.annotation:annotation", version = "1.9.1" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version = "1.7.0" }
androidx-lifecycle-extensions = { module = "androidx.lifecycle:lifecycle-extensions", version.ref = "androidx-lifecycle" }
com-google-android-material = { module = "com.google.android.material:material", version.ref = "material" }
com-squareup-okio = { module = "com.squareup.okio:okio", version.ref = "okio" }
junit = { module = "junit:junit", version.ref = "junit" }
org-jetbrains-kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
elvishew-xlog = { module = "com.elvishew:xlog", version.ref = "elviswhew-xlog" }

[plugins]
com-android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" }
com-android-library = { id = "com.android.library", version.ref = "android-gradle-plugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
gitlab-arturbosch-detekt = "io.gitlab.arturbosch.detekt:1.23.7"
github-gradle-publish-plugin = { id = "io.github.gradle-nexus.publish-plugin", version = "1.2.0" }
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
31 changes: 16 additions & 15 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
plugins{
alias libs.plugins.kotlin.android
alias libs.plugins.com.android.library
}

android {
compileSdkVersion 33
compileSdk 34

defaultConfig {
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 34
}

flavorDimensions "loggerMode"
Expand All @@ -24,25 +25,25 @@ android {
lintConfig file('lint-custom.xml')
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '11'
jvmTarget = '17'
}
namespace 'com.telefonica.androidlogger'
}

dependencies {
//noinspection GradleDependency
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.annotation:annotation:1.1.0"
enabledImplementation "com.google.android.material:material:$support_version"
enabledImplementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
enabledImplementation "com.elvishew:xlog:1.11.0"
enabledImplementation "com.squareup.okio:okio:2.7.0"
implementation libs.org.jetbrains.kotlin
implementation libs.androidx.annotation
enabledImplementation libs.com.google.android.material
enabledImplementation libs.androidx.lifecycle.extensions
enabledImplementation libs.elvishew.xlog
enabledImplementation libs.com.squareup.okio

testImplementation 'junit:junit:4.13'
testImplementation libs.junit
}

apply from: "${rootProject.projectDir}/mavencentral.gradle"
8 changes: 8 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

include ':app'
include ':library'

0 comments on commit c32aae9

Please sign in to comment.