Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/loxone-java-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
java-version: '17'
distribution: 'temurin'
- name: Check with Gradle
uses: gradle/gradle-build-action@v2
with:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/loxone-java-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
ref: master
token: ${{ secrets.SMARTEON_GIT_TOKEN }}

- name: Setup JDK 11
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
java-version: '17'
distribution: 'temurin'

- name: Set up git configuration
run: |
Expand All @@ -50,9 +50,9 @@ jobs:
- name: Publish to OSS Sonatype
shell: bash
env:
OSS_USER: ${{ secrets.OSS_USER }}
OSS_PASS: ${{ secrets.OSS_PASS }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASS: ${{ secrets.SIGNING_PASS }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSS_USER }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSS_PASS }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASS }}
run: |
./gradlew publishLibraryPublicationToProjectLocalRepository zipMavenCentralPortalPublication releaseMavenCentralPortalPublication
./gradlew publishToMavenCentral
150 changes: 63 additions & 87 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

group = "cz.smarteon"

scmVersion {
Expand All @@ -11,20 +15,20 @@ project.version = scmVersion.version

plugins {
`java-library`
signing
`maven-publish`
jacoco
id("pl.allegro.tech.build.axion-release") version "1.18.18"
id("org.danilopianini.publish-on-central") version "8.0.7"
id("com.vanniktech.maven.publish") version "0.34.0"
id("ru.vyarus.quality") version "6.0.1"
kotlin("jvm") version "1.7.10"
kotlin("jvm") version "2.2.20"
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
// javadoc and sources configured in publishing plugin
}

repositories {
Expand Down Expand Up @@ -58,6 +62,7 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")

val striktVersion = "0.34.1"
testImplementation("io.strikt:strikt-core:$striktVersion")
Expand Down Expand Up @@ -88,88 +93,59 @@ dependencies {
testImplementation("org.awaitility:awaitility-kotlin:4.1.1")
}

val ossUser: String? = System.getenv("OSS_USER")
val ossPass: String? = System.getenv("OSS_PASS")

publishing {
publications {
create<MavenPublication>("library") {
from(components["java"])

pom {
name.set(project.name)
url.set("https://github.com/Smarteon/loxone-java")
description.set("Java implementation of the Loxone&trade; communication protocol (Web Socket)")
organization {
name.set("Smarteon Systems s.r.o")
url.set("https://smarteon.cz")
}
licenses {
license {
name.set("3-Clause BSD License")
url.set("https://opensource.org/licenses/BSD-3-Clause")
distribution.set("repo")
}
}
developers {
developer {
name.set("Jiří Mikulášek")
email.set("jiri.mikulasek@smarteon.cz")
}
developer {
name.set("Vojtěch Zavřel")
email.set("vojtech.zavrel@smarteon.cz")
}
developer {
name.set("Tomáš Knotek")
email.set("tomas.knotek@smarteon.cz")
}
}
contributors {
contributor {
name.set("Petr Žufan")
}
}
scm {
url.set("git@github.com:Smarteon/loxone-java.git")
connection.set("scm:git:git@github.com:Smarteon/loxone-java.git")
tag.set(project.version.toString())
}
}
}
}
}
// see https://vanniktech.github.io/gradle-maven-publish-plugin/central/#secrets for how to set up credentials and signing
mavenPublishing {
publishToMavenCentral(automaticRelease = true)
signAllPublications()

if (ossUser != null && ossPass != null) {
publishOnCentral {
repoOwner.set("Smarteon")
projectDescription.set("Java implementation of the Loxone&trade; communication protocol (Web Socket)")
licenseName.set("3-Clause BSD License")
licenseUrl.set("https://opensource.org/licenses/BSD-3-Clause")
configure(
JavaLibrary(
javadocJar = JavadocJar.Javadoc(),
sourcesJar = true,
)
)

repositories {
mavenCentral.user.set(ossUser)
mavenCentral.password.set(ossPass)
}
}
}
coordinates(project.group.toString(), project.name, project.version.toString())

val signingKey: String? = System.getenv("SIGNING_KEY")
val signingPassword: String? = System.getenv("SIGNING_PASS")
if (signingKey != null && signingPassword != null) {
signing {
setRequired({
!project.version.toString().endsWith("-SNAPSHOT")
})
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["library"])
}
} else if (hasProperty("signing.keyId")) {
signing {
setRequired({
!project.version.toString().endsWith("-SNAPSHOT")
})
sign(publishing.publications["library"])
pom {
name = project.name
url = "https://github.com/Smarteon/loxone-java"
description = "Java implementation of the Loxone&trade; communication protocol (Web Socket)"
organization {
name = "Smarteon Systems s.r.o"
url = "https://smarteon.cz"
}
licenses {
license {
name = "3-Clause BSD License"
url = "https://opensource.org/licenses/BSD-3-Clause"
distribution = "repo"
}
}
developers {
developer {
name = "Jiří Mikulášek"
email = "jiri.mikulasek@smarteon.cz"
}
developer {
name = "Vojtěch Zavřel"
email = "vojtech.zavrel@smarteon.cz"
}
developer {
name = "Tomáš Knotek"
email = "tomas.knotek@smarteon.cz"
}
}
contributors {
contributor {
name = "Petr Žufan"
}
}
scm {
url = "git@github.com:Smarteon/loxone-java.git"
connection = "scm:git:git@github.com:Smarteon/loxone-java.git"
tag = project.version.toString()
}
}
}

Expand All @@ -195,8 +171,8 @@ tasks {
}

withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
41 changes: 26 additions & 15 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading