Skip to content

Commit c0991dd

Browse files
committed
consolidate versions
1 parent d031f07 commit c0991dd

9 files changed

Lines changed: 69 additions & 31 deletions

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up JDK
1919
uses: actions/setup-java@v3
2020
with:
21-
java-version: '11'
21+
java-version: '17'
2222
distribution: 'temurin'
2323
cache: gradle
2424
- name: Setup Gradle

build.gradle.kts

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import io.github.zenhelix.gradle.plugin.task.PublishBundleMavenCentralTask
12
import pl.allegro.tech.build.axion.release.domain.PredefinedVersionCreator
23

34
plugins {
45
`maven-publish`
5-
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
6-
id("pl.allegro.tech.build.axion-release") version "1.18.16"
6+
alias(libs.plugins.axion)
7+
alias(libs.plugins.mavenCentralPublish) apply false
78
}
89

910
description = "JavaCAN is a binding to Linux' socketcan subsystem that feels native to Java developers."
@@ -26,12 +27,6 @@ allprojects {
2627
version = gitVersion
2728
}
2829

29-
nexusPublishing {
30-
this.repositories {
31-
sonatype()
32-
}
33-
}
34-
3530
val publishAllToMavenLocal by tasks.registering(DefaultTask::class) {
3631
group = "publishing"
3732

@@ -59,11 +54,20 @@ val mavenCentralDeploy by tasks.registering(DefaultTask::class) {
5954
group = "publishing"
6055
val isSnapshot = project.version.toString().endsWith("-SNAPSHOT")
6156

62-
val publishTasks = subprojects
63-
.flatMap { it.tasks.withType<PublishToMavenRepository>() }
64-
.filter { it.repository.name == "sonatype" }
65-
dependsOn(publishTasks)
66-
if (!isSnapshot) {
67-
dependsOn(tasks.closeAndReleaseStagingRepositories)
57+
if (isSnapshot) {
58+
logger.lifecycle("Snapshot deployment!")
59+
for (project in allprojects) {
60+
val tasks = project.tasks
61+
.withType<PublishToMavenRepository>()
62+
.matching { it.repository.name == "mavenCentralSnapshots" }
63+
dependsOn(tasks)
64+
}
65+
} else {
66+
logger.lifecycle("Release deployment!")
67+
for (project in allprojects) {
68+
val tasks = project.tasks
69+
.withType<PublishBundleMavenCentralTask>()
70+
dependsOn(tasks)
71+
}
6872
}
6973
}

conventions/build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ repositories {
88
}
99

1010
dependencies {
11-
api(plugin("tel.schich.dockcross", version = "0.2.3"))
12-
implementation("io.github.zenhelix.maven-central-publish:io.github.zenhelix.maven-central-publish.gradle.plugin:0.8.0")
11+
api(plugin(libs.plugins.dockcross))
12+
implementation(plugin(libs.plugins.mavenCentralPublish))
1313
}
1414

15-
fun plugin(id: String, version: String) = "$id:$id.gradle.plugin:$version"
15+
fun plugin(plugin: Provider<PluginDependency>) =
16+
plugin.map { "${it.pluginId}:${it.pluginId}.gradle.plugin:${it.version}" }

conventions/settings.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ pluginManagement {
55
}
66
}
77

8+
plugins {
9+
id("dev.panuszewski.typesafe-conventions") version "0.7.4"
10+
}
11+
812
dependencyResolutionManagement {
913
repositories {
1014
mavenCentral()

conventions/src/main/kotlin/tel.schich.javacan.convention.base.gradle.kts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ repositories {
2828
}
2929

3030
dependencies {
31-
compileOnly("org.eclipse.jdt:org.eclipse.jdt.annotation:2.3.100")
32-
implementation("org.slf4j:slf4j-api:2.0.16")
31+
compileOnly(libs.jdtAnnotations)
32+
implementation(libs.slf4j)
3333

34-
testImplementation("ch.qos.logback:logback-classic:1.3.14")
34+
testImplementation(libs.logbackClassic)
3535

36-
"org.junit.jupiter:junit-jupiter-engine:5.11.3".also {
37-
testFixturesImplementation(it)
38-
testImplementation(it)
39-
}
36+
testFixturesImplementation(libs.junitJupiter)
37+
testImplementation(libs.junitJupiter)
4038
}
4139

conventions/src/main/kotlin/tel.schich.javacan.convention.native.gradle.kts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,8 @@ tasks.test {
189189
}
190190

191191
dependencies {
192-
"tel.schich:jni-access-generator:1.1.8".also {
193-
annotationProcessor(it)
194-
compileOnly(it)
195-
}
192+
annotationProcessor(libs.jniAccessGenerator)
193+
compileOnly(libs.jniAccessGenerator)
196194

197195
files(packageNativeForHost).also {
198196
testImplementation(it)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#This file is generated by updateDaemonJvm
2+
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/fd88a209e0f18ca6eaf97d9fa9e45e01/redirect
3+
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/1543f336911ae3d7d37bedec8b74d98c/redirect
4+
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/fd88a209e0f18ca6eaf97d9fa9e45e01/redirect
5+
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/1543f336911ae3d7d37bedec8b74d98c/redirect
6+
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7799fb2cb9f9eb382df2b8b6fb793b77/redirect
7+
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/99a42fd36e2e41c7c8ed49f423f49fdf/redirect
8+
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/fd88a209e0f18ca6eaf97d9fa9e45e01/redirect
9+
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/1543f336911ae3d7d37bedec8b74d98c/redirect
10+
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3087f28f30be41ab6818c16a488f5f8a/redirect
11+
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/638dfeab250dbbb0639b82816307982e/redirect
12+
toolchainVersion=21

gradle/libs.versions.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[versions]
2+
axion = "1.18.16"
3+
dockcross = "0.2.3"
4+
mavenCentralPublish = "0.8.0"
5+
jdtAnnotations = "2.3.100"
6+
slf4j = "2.0.16"
7+
logback = "1.3.14"
8+
junitJupiter = "5.11.3"
9+
jniAccessGenerator = "1.1.8"
10+
11+
[libraries]
12+
jdtAnnotations = { module = "org.eclipse.jdt:org.eclipse.jdt.annotation", version.ref = "jdtAnnotations" }
13+
slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
14+
logbackClassic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
15+
junitJupiter = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junitJupiter" }
16+
jniAccessGenerator = { module = "tel.schich:jni-access-generator", version.ref = "jniAccessGenerator" }
17+
18+
[plugins]
19+
axion = { id = "pl.allegro.tech.build.axion-release", version.ref = "axion" }
20+
dockcross = { id = "tel.schich.dockcross", version.ref = "dockcross" }
21+
mavenCentralPublish = { id = "io.github.zenhelix.maven-central-publish", version.ref = "mavenCentralPublish" }

settings.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
rootProject.name = "javacan"
22

3+
includeBuild("conventions")
34
pluginManagement {
4-
includeBuild("conventions")
55
}
66

77
plugins {
8-
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
8+
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
99
}
1010

1111
include("core")

0 commit comments

Comments
 (0)