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("[email protected]")
}
developer {
name.set("Vojtěch Zavřel")
email.set("[email protected]")
}
developer {
name.set("Tomáš Knotek")
email.set("[email protected]")
}
}
contributors {
contributor {
name.set("Petr Žufan")
}
}
scm {
url.set("[email protected]:Smarteon/loxone-java.git")
connection.set("scm:git:[email protected]: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 = "[email protected]"
}
developer {
name = "Vojtěch Zavřel"
email = "[email protected]"
}
developer {
name = "Tomáš Knotek"
email = "[email protected]"
}
}
contributors {
contributor {
name = "Petr Žufan"
}
}
scm {
url = "[email protected]:Smarteon/loxone-java.git"
connection = "scm:git:[email protected]: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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,13 +82,11 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -114,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
CLASSPATH="\\\"\\\""


# Determine the Java command to use to start the JVM.
Expand All @@ -133,22 +133,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,16 +200,20 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"

# Stop when "xargs" is not available.
Expand Down
Loading
Loading