Skip to content

Commit

Permalink
Just revamping the gradle build to use up-to-date tooling.
Browse files Browse the repository at this point in the history
None of this changes should change the build logic or output, but will hopefully help maintenance by keeping the build to the latest Gradle's recommendations.

- Update the gradle wrapper to version 8.6
- Replace deprecated "version" by "archiveVersion" in the common build config within the jar.manifest.attributes {}
- Put all dependencies in the libs.versions.toml catalog
- Apply the unit testing dependencies by default to all subprojects in the common build config
- Update the checkout and setup-java github actions to the v4
- Run the CI for all branches
  • Loading branch information
GuillaumeTaffin committed Feb 24, 2024
1 parent d32faa9 commit 60a4c7b
Show file tree
Hide file tree
Showing 14 changed files with 247 additions and 168 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Java CI with Gradle

on:
push:
branches: [ master ]
branches: [ '*' ]
pull_request:
branches: [ master ]

Expand All @@ -19,9 +19,9 @@ jobs:
max-parallel: 1

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ subprojects { proj ->
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'

sourceCompatibility = 17
targetCompatibility = 17

java {
withJavadocJar()
withSourcesJar()
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

jar {
manifest {
attributes(
"Implementation-Title": "Structurizr for Java",
"Implementation-Version": version
"Implementation-Version": archiveVersion
)
}
}
Expand Down
22 changes: 22 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[versions]
junit = "5.9.2"
jackson = "2.16.0"

[libraries]
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" }
httpclient5 = { module = "org.apache.httpcomponents.client5:httpclient5", version = "5.2.1" }
jaxb-api = { module = "javax.xml.bind:jaxb-api", version = "2.4.0-b180830.0359" }
jsr305 = { module = "com.google.code.findbugs:jsr305", version = "3.0.2" }
commons-logging = { module = "commons-logging:commons-logging", version = "1.2" }
groovy-jsr223 = { module = "org.codehaus.groovy:groovy-jsr223", version = "3.0.19" }
kotlin-scripting-jsr223 = { module = "org.jetbrains.kotlin:kotlin-scripting-jsr223", version = "1.8.10" }
jruby-core = { module = "org.jruby:jruby-core", version = "9.4.4.0" }

# Tests
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit" }
assertj-core = { module = "org.assertj:assertj-core", version = "3.24.2" }

[bundles]
testing-libs = ["junit-jupiter", "junit-jupiter-params", "assertj-core"]
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 60a4c7b

Please sign in to comment.