Skip to content

Commit

Permalink
Merge branch 'update-versions'
Browse files Browse the repository at this point in the history
Not using fast-forward as some commits in the branch do not build.
  • Loading branch information
oakkitten committed Nov 23, 2024
2 parents f3da88c + 6a0f8a6 commit 5acaf7c
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 101 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Install Java 17
- name: Install Java 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'

- name: Checkout repository
uses: actions/checkout@v2
Expand All @@ -25,11 +25,11 @@ jobs:
name: Build release apk
runs-on: ubuntu-latest
steps:
- name: Install Java 17
- name: Install Java 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'

- name: Checkout repository
uses: actions/checkout@v2
Expand All @@ -54,7 +54,7 @@ jobs:
DEVSTOREFILE: /home/runner/work/weechat-android/weechat-android/releases/android.jks

- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: build-outputs
path: app/build/outputs/
Expand All @@ -73,7 +73,7 @@ jobs:
uses: actions/checkout@v2

- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: build-outputs
path: app/build/outputs/
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
fetch-depth: 0

- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: build-outputs
path: app/build/outputs/
Expand Down
72 changes: 31 additions & 41 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,47 @@ dependencies {
implementation(project(":cats"))
implementation(project(":relay"))

implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.20")

// these two are required for logging within the relay module. todo remove?
implementation("org.slf4j:slf4j-api:2.0.9")
implementation("com.noveogroup.android:android-logger:1.3.6")
implementation(libs.slf4j.api)
implementation(libs.androidlogger)

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.legacy:legacy-support-v4:1.0.0")
implementation("androidx.annotation:annotation:1.7.1") // For @Nullable/@NonNull
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.emoji2:emoji2:1.4.0")
implementation("androidx.preference:preference-ktx:1.2.1") // preference fragment & al
implementation("androidx.legacy:legacy-preference-v14:1.0.0") // styling for the fragment
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
implementation("androidx.lifecycle:lifecycle-common-java8:2.6.2")
implementation("androidx.sharetarget:sharetarget:1.2.0")
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.legacy.support.v4)
implementation(libs.androidx.annotation) // For @Nullable/@NonNull
implementation(libs.androidx.appcompat)
implementation(libs.androidx.emoji2)
implementation(libs.androidx.preference.ktx) // preference fragment & al
implementation(libs.androidx.legacy.preference.v14) // styling for the fragment
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.lifecycle.common.java8)
implementation(libs.androidx.sharetarget)

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
implementation(libs.kotlinx.coroutines.android)

implementation("com.github.bumptech.glide:glide:4.16.0")
kapt("com.github.bumptech.glide:compiler:4.16.0")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation(libs.glide.glide)
kapt(libs.glide.compiler)
implementation(libs.okhttp)

val roomVersion = "2.6.1"
implementation("androidx.room:room-runtime:$roomVersion")
annotationProcessor("androidx.room:room-compiler:$roomVersion")
kapt("androidx.room:room-compiler:$roomVersion")
implementation(libs.androidx.room.runtime)
annotationProcessor(libs.androidx.room.compiler)
kapt(libs.androidx.room.compiler)

implementation("org.yaml:snakeyaml:2.2")
implementation(libs.snakeyaml)

implementation("org.bouncycastle:bcpkix-jdk15on:1.70")
implementation(libs.bouncycastle.pkix)

// needed for thread-safe date formatting as SimpleDateFormat isn"t thread-safe
// the alternatives, including apache commons and threetenabp, seem to be much slower
// todo perhaps replace with core library desugaring, if it"s fast
implementation("net.danlew:android.joda:2.12.6")
implementation(libs.joda)

implementation("org.greenrobot:eventbus:3.3.1")
implementation(libs.eventbus)

debugImplementation("org.aspectj:aspectjrt:1.9.21")
debugImplementation("com.squareup.leakcanary:leakcanary-android:2.12")
debugImplementation(libs.aspectj.rt)
debugImplementation(libs.leakcanary)

testImplementation("org.junit.jupiter:junit-jupiter:5.10.1")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.1")
testImplementation(libs.junit.jupiter)
testImplementation(libs.junit.jupiter.params)
}

tasks.withType<JavaCompile> {
Expand All @@ -78,10 +75,6 @@ android {
arguments["room.incremental"] = "true"
}
}

kotlinOptions {
jvmTarget = "17"
}
}

signingConfigs {
Expand All @@ -91,7 +84,7 @@ android {
storePassword = project.properties["devStorePassword"] as String
keyAlias = project.properties["devKeyAlias"] as String
keyPassword = project.properties["devKeyPassword"] as String
} catch (e: Exception) {
} catch (_: Exception) {
project.logger.warn("WARNING: Set the values devStorefile, devStorePassword, " +
"devKeyAlias, and devKeyPassword " +
"in ~/.gradle/gradle.properties to sign the release.")
Expand All @@ -112,7 +105,7 @@ android {
"../cats/proguard-rules.pro")
// kotlinx-coroutines-core debug-only artifact
// see https://github.com/Kotlin/kotlinx.coroutines#avoiding-including-the-debug-infrastructure-in-the-resulting-apk
packagingOptions {
packaging {
resources.excludes += "DebugProbesKt.bin"
}
}
Expand All @@ -124,11 +117,6 @@ android {
versionNameSuffix = "-dev"
signingConfig = signingConfigs.getByName("dev")
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

buildFeatures {
Expand All @@ -146,6 +134,8 @@ fun versionBanner(): String {
return String(os.toByteArray()).trim()
}

java.toolchain.languageVersion = JavaLanguageVersion.of(21)

////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////// cats
////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
33 changes: 15 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ subprojects {
}
}

// to print a sensible task graph, uncomment the following lines and run:
// $ gradlew :app:assembleDebug taskTree --no-repeat
// plugins {
// id("com.dorongold.task-tree") version "1.5"
// }

defaultTasks("assembleDebug")

repositories {
Expand All @@ -28,11 +22,11 @@ buildscript {
}

dependencies {
classpath("com.android.tools.build:gradle:8.2.2")
classpath("org.aspectj:aspectjtools:1.9.21")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
classpath("org.jetbrains.kotlin:kotlin-serialization:1.9.20")
classpath("com.ibotta:plugin:1.4.1")
classpath(libs.gradle)
classpath(libs.aspectj.tools)
classpath(libs.kotlin.gradle.plugin)
classpath(libs.kotlin.serialization)
classpath(libs.aspectjpipeline)
}
}

Expand Down Expand Up @@ -71,17 +65,20 @@ subprojects {
}
}


// The below is a plugin that checks for dependency updates.
// To get a plain text report, run:
// $ ./gradlew dependencyUpdates
// See https://github.com/ben-manes/gradle-versions-plugin
plugins {
id("com.github.ben-manes.versions") version "0.50.0"
// The below is a plugin that checks for dependency updates.
// To get a plain text report, run:
// $ ./gradlew dependencyUpdates
// See https://github.com/ben-manes/gradle-versions-plugin
alias(libs.plugins.gradleversionsplugin)

// to print a sensible task graph, uncomment the following line and run:
// $ gradlew :app:assembleDebug taskTree --no-repeat
//alias(libs.plugins.tasktree)
}

fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) }
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
Expand Down
32 changes: 9 additions & 23 deletions cats/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,20 @@ plugins {
}

dependencies {
implementation("org.aspectj:aspectjrt:1.9.21")
implementation("androidx.annotation:annotation:1.7.1")
implementation(libs.aspectj.rt)
implementation(libs.androidx.annotation)

testImplementation("org.junit.jupiter:junit-jupiter:5.10.1")
testImplementation("org.mockito:mockito-core:5.8.0")
testImplementation(libs.junit.jupiter)
testImplementation(libs.mockito.core)
}

android {
namespace = "com.ubergeek42.cats"
compileSdk = 34

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

buildTypes {
getByName("debug") {}

getByName("release") {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}

create("dev") { initWith(getByName("release")) }
}

defaultConfig {
targetSdk = 34
minSdk = 16
consumerProguardFile("proguard-rules.pro")
}

buildFeatures {
Expand All @@ -50,9 +34,9 @@ tasks.withType<JavaCompile> {

val args = arrayOf("-showWeaveInfo",
"-1.5",
"-inpath", destinationDir.toString(),
"-inpath", destinationDirectory.asFile.get().toString(),
"-aspectpath", classpath.asPath,
"-d", destinationDir.toString(),
"-d", destinationDirectory.asFile.get().toString(),
"-classpath", classpath.asPath,
"-bootclasspath", android.bootClasspath.joinToString(File.pathSeparator))

Expand All @@ -72,3 +56,5 @@ tasks.withType<JavaCompile> {
}
}
}

java.toolchain.languageVersion = JavaLanguageVersion.of(21)
89 changes: 89 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
[versions]
androidlogger = "1.3.6"
androidx-annotation = "1.9.1"
androidx-appcompat = "1.7.0"

# Bumping androidx-core to 1.15.+ requires compileSdk 35.
# However, API level 35 comes with some JDK API changes that, if not addressed in code,
# might lead to crashes on lower API level devices. See:
# https://developer.android.com/about/versions/15/behavior-changes-15#openjdk-api-changes
# https://issuetracker.google.com/issues/350432371
androidx-core = "1.13.1"

androidx-emoji2 = "1.5.0"
androidx-legacy = "1.0.0"
androidx-lifecycle = "2.8.7"
androidx-preference = "1.2.1"
androidx-room = "2.6.1"
androidx-sharetarget = "1.2.0"

# Bumping AspectJ to either 1.9.22 or 1.9.22.1, the currently latest version, leads to the following
# crashes on emulators with API 21 to 23, 24 and beyond behaving nominally:
# ...
# Caused by: java.lang.NoClassDefFoundError: org.aspectj.runtime.reflect.JoinPointImpl$$ExternalSyntheticLambda0
# at org.aspectj.runtime.reflect.JoinPointImpl.<init>(JoinPointImpl.java:145)
# at org.aspectj.runtime.reflect.Factory.makeJP(Factory.java:270)
aspectj = "1.9.21"

aspectjpipeline = "1.4.1"
bouncycastle-pkix = "1.70"
eventbus = "3.3.1"
glide = "4.16.0"
gradle = "8.7.2"
gradleversionsplugin = "0.51.0"
joda = "2.13.0"
junit = "5.11.3"
kotlin = "2.0.21"
kotlinx-coroutines = "1.9.0"
kotlinx-serialization = "1.7.3"
leakcanary = "2.14"
mockito = "5.14.2"
nvwebsocketclient = "2.14"
okhttp = "4.12.0"
slf4j-api = "2.0.16"
snakeyaml = "2.3"
sshlib = "2.2.21"
tasktree = "1.5"


[libraries]
androidlogger = { module = "com.noveogroup.android:android-logger", version.ref = "androidlogger" }
androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidx-annotation" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-core" }
androidx-emoji2 = { module = "androidx.emoji2:emoji2", version.ref = "androidx-emoji2" }
androidx-legacy-preference-v14 = { module = "androidx.legacy:legacy-preference-v14", version.ref = "androidx-legacy" }
androidx-legacy-support-v4 = { module = "androidx.legacy:legacy-support-v4", version.ref = "androidx-legacy" }
androidx-lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "androidx-lifecycle" }
androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle" }
androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "androidx-preference" }
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "androidx-room" } # plugin
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "androidx-room" }
androidx-sharetarget = { module = "androidx.sharetarget:sharetarget", version.ref = "androidx-sharetarget" }
aspectj-rt = { module = "org.aspectj:aspectjrt", version.ref = "aspectj" }
aspectj-tools = { module = "org.aspectj:aspectjtools", version.ref = "aspectj" } # plugin
aspectjpipeline = { module = "com.ibotta:plugin", version.ref = "aspectjpipeline" } # plugin
bouncycastle-pkix = { module = "org.bouncycastle:bcpkix-jdk15on", version.ref = "bouncycastle-pkix" }
eventbus = { module = "org.greenrobot:eventbus", version.ref = "eventbus" }
glide-compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "glide" } # plugin
glide-glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" }
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" } # plugin
joda = { module = "net.danlew:android.joda", version.ref = "joda" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit" }
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } # plugin
kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" } # plugin
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
leakcanary = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanary" }
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" }
nvwebsocketclient = { module = "com.neovisionaries:nv-websocket-client", version.ref = "nvwebsocketclient" }
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j-api" }
snakeyaml = { module = "org.yaml:snakeyaml", version.ref = "snakeyaml" }
sshlib = { module = "com.github.connectbot:sshlib", version.ref = "sshlib" }


[plugins]
gradleversionsplugin = { id = "com.github.ben-manes.versions", version.ref = "gradleversionsplugin" }
tasktree = { id = "com.dorongold.task-tree", version.ref = "tasktree" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
Loading

0 comments on commit 5acaf7c

Please sign in to comment.