Skip to content

Commit

Permalink
Update to Gradle 8.10 and fix deprecation warnings (#45)
Browse files Browse the repository at this point in the history
- Update Gradle from 8.0 to 8.10.
- Fix a couple of warnings in Gradle scripts.
- Migrate `settings.gradle` to Kotlin.
- Make the `code_quality.yml` workflow run on the `main` branch.
  • Loading branch information
MGaetan89 authored Aug 30, 2024
1 parent d1ad3bd commit c399f76
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 140 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Code quality
on:
merge_group:
pull_request:
push:
branches:
- main

jobs:
android-lint:
Expand Down
20 changes: 12 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,24 @@ allprojects {
}
}

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
val clean by tasks.registering(Delete::class) {
delete(rootProject.layout.buildDirectory)
}

/*
* https://detekt.dev/docs/gettingstarted/git-pre-commit-hook
* https://medium.com/@alistair.cerio/android-ktlint-and-pre-commit-git-hook-5dd606e230a9
*/
tasks.register("installGitHook", Copy::class) {
description = "Adding git hook script to local working copy"
println("Installing git hook to ${rootProject.rootDir}/.git/hooks")
from(file("${rootProject.rootDir}/git_hooks/pre-commit"))
into { file("${rootProject.rootDir}/.git/hooks") }
fileMode = 0x777
val installGitHook by tasks.registering(Copy::class) {
description = "Adding Git hook script to local working copy"
from(rootProject.file("git_hooks/pre-commit"))
into(rootProject.file(".git/hooks"))
filePermissions {
unix("rwxr-xr-x")
}
doFirst {
delete(rootProject.file(".git/hooks/pre-commit"))
}
}

tasks.getByPath(":data:preBuild").dependsOn(":installGitHook")
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 4 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Mon Mar 14 11:19:08 CET 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit c399f76

Please sign in to comment.