Skip to content

Commit

Permalink
Merge pull request #669 from theimpulson/gradleUpdates
Browse files Browse the repository at this point in the history
Misc Gradle updates
  • Loading branch information
grote authored May 31, 2024
2 parents d9642ae + d166099 commit af15b4a
Show file tree
Hide file tree
Showing 13 changed files with 309 additions and 245 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
java-version: 17
cache: 'gradle'

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Build
env:
NEXTCLOUD_URL: ${{ vars.NEXTCLOUD_URL }}
Expand Down
11 changes: 6 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import java.io.ByteArrayOutputStream

plugins {
id("com.android.application")
kotlin("android")
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
}

val gitDescribe = {
Expand Down Expand Up @@ -72,9 +72,10 @@ android {
languageVersion = "1.8"
}

packagingOptions {
exclude("META-INF/LICENSE.md")
exclude("META-INF/LICENSE-notice.md")
packaging {
resources {
excludes += listOf("META-INF/LICENSE.md", "META-INF/LICENSE-notice.md")
}
}

testOptions.unitTests {
Expand Down
24 changes: 7 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,14 @@

import org.jlleitschuh.gradle.ktlint.KtlintExtension

buildscript {
repositories {
google()
}
}

plugins {
id("com.android.application") version plugins.versions.androidGradle apply false
id("com.android.library") version plugins.versions.androidGradle apply false
id("com.google.protobuf") version plugins.versions.protobuf apply false
id("org.jetbrains.kotlin.android") version plugins.versions.kotlin apply false
id("org.jetbrains.kotlin.kapt") version plugins.versions.kotlin apply false
id("org.jetbrains.dokka") version plugins.versions.kotlin apply false
id("org.jlleitschuh.gradle.ktlint") version plugins.versions.ktlint apply false
}

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.google.ksp) apply false
alias(libs.plugins.google.protobuf) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
alias(libs.plugins.jetbrains.dokka) apply false
alias(libs.plugins.jlleitschuh.ktlint) apply false
}

subprojects {
Expand Down
20 changes: 0 additions & 20 deletions build.plugins.toml

This file was deleted.

13 changes: 7 additions & 6 deletions contactsbackup/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import java.io.FileInputStream
import java.util.Properties

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
}

android {
Expand All @@ -20,7 +20,7 @@ android {
targetSdk = libs.versions.targetSdk.get().toInt()

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments(mapOf("disableAnalytics" to "true"))
testInstrumentationRunnerArguments["disableAnalytics"] = "true"
}

compileOptions {
Expand All @@ -32,9 +32,10 @@ android {
jvmTarget = JavaVersion.VERSION_17.toString()
}

packagingOptions {
exclude("META-INF/LICENSE.md")
exclude("META-INF/LICENSE-notice.md")
packaging {
resources {
excludes += listOf("META-INF/LICENSE.md", "META-INF/LICENSE-notice.md")
}
}

testOptions.unitTests {
Expand Down
36 changes: 27 additions & 9 deletions build.libs.toml → gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#
# SPDX-FileCopyrightText: 2023 The Calyx Institute
# SPDX-FileCopyrightText: 2024 The Calyx Institute
# SPDX-License-Identifier: Apache-2.0
#

[metadata]

[versions]
# Gradle plugin versions
androidGradlePlugin = "8.4.1"
protobufPlugin = "0.9.4"
ktlint = "11.5.0"

# Android SDK versions
compileSdk = "34"
minSdk = "33"
Expand All @@ -21,9 +24,15 @@ espresso = "3.4.0"
# We use "strictly" to enforce the version cannot be overriden by transitive dependencies.
# We need to enforce that the versions we use are the same as AOSP to ensure compatibility.

# Kotlin versions
# https://android.googlesource.com/platform/external/kotlinc/+/refs/tags/android-14.0.0_r29/build.txt
aosp-kotlin = { strictly = "1.9.0" }
# 1.3.61 Android 11
# 1.4.30 Android 12
# 1.6.10 Android 13
# 1.7.20 Android 13 (QPR2)
# 1.8.10 Android 14
# 1.9.0 Android 14 (QPR2)
# Check: https://android.googlesource.com/platform/external/kotlinc/+/refs/tags/android-14.0.0_r29/build.txt
kotlin = { strictly = "1.9.0" }
ksp = "1.9.0-1.0.13" # Keep in match with kotlin version

# Lint versions
lint-rules = { strictly = "0.1.0" }
Expand Down Expand Up @@ -64,9 +73,9 @@ androidx-work-runtime = { strictly = "2.10.0-alpha01" }

[libraries]
# Kotlin standard dependencies
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "aosp-kotlin" }
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "aosp-kotlin" }
kotlin-stdlib-common = { module = "org.jetbrains.kotlin:kotlin-stdlib-common", version.ref = "aosp-kotlin" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlin-stdlib-common = { module = "org.jetbrains.kotlin:kotlin-stdlib-common", version.ref = "kotlin" }

# Lint dependencies
thirdegg-lint-rules = { module = "com.github.thirdegg:lint-rules", version.ref = "lint-rules" }
Expand Down Expand Up @@ -96,3 +105,12 @@ androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "
[bundles]
kotlin = ["kotlin-stdlib", "kotlin-stdlib-jdk8", "kotlin-stdlib-common"]
coroutines = ["kotlinx-coroutines-core-jvm", "kotlinx-coroutines-android"]

[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
google-ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
google-protobuf = { id = "com.google.protobuf", version.ref = "protobufPlugin" }
jetbrains-dokka = { id = "org.jetbrains.dokka", version.ref = "kotlin" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
jlleitschuh-ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
10 changes: 6 additions & 4 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#Fri Aug 19 10:56:09 IST 2022
#Thu May 30 09:49:42 IST 2024
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
distributionSha256Sum=03ec176d388f2aa99defcadc3ac6adf8dd2bce5145a129659537c0874dea5ad1
zipStorePath=wrapper/dists
Loading

0 comments on commit af15b4a

Please sign in to comment.