Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build/gradle 8/latest #360

Merged
merged 21 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from 19 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
10 changes: 9 additions & 1 deletion .github/workflows/snyk-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: |
8
11

- uses: actions/checkout@v3
with:
path: mqtt-cli

- name: Check for new issues
uses: hivemq/hivemq-snyk-composite-action@v1
uses: hivemq/hivemq-snyk-composite-action@v2.0.0
with:
snyk-args: --configuration-matching=^runtimeClasspath$ mqtt-cli
snyk-token: ${{ secrets.SNYK_TOKEN }}
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/snyk-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,23 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: |
8
11

- uses: actions/checkout@v3
with:
path: mqtt-cli

- name: Setup Snyk
uses: snyk/actions/setup@master

- name: Run Snyk monitor
uses: snyk/actions/gradle-jdk11@master
shell: bash
run: snyk monitor --configuration-matching=^runtimeClasspath$ --target-reference=${{ github.ref_name }} mqtt-cli
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: monitor
args: --configuration-matching=^runtimeClasspath$ --target-reference=${{ github.ref_name }} mqtt-cli
17 changes: 13 additions & 4 deletions .github/workflows/snyk-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,23 @@ jobs:
environment: snyk-monitor-releases

steps:
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: |
8
11

- uses: actions/checkout@v3
with:
path: mqtt-cli

- name: Setup Snyk
uses: snyk/actions/setup@master

- name: Run Snyk monitor
uses: snyk/actions/gradle-jdk11@master
shell: bash
run: snyk monitor --configuration-matching=^runtimeClasspath$ --target-reference=${{ github.ref_name }} mqtt-cli
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: monitor
args: --configuration-matching=^runtimeClasspath$ --target-reference=${{ github.ref_name }} mqtt-cli
36 changes: 18 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ plugins {
application
id("com.github.johnrengelman.shadow")
id("io.github.sgtsilvio.gradle.defaults")
id("nebula.ospackage")
id("com.netflix.nebula.ospackage")
id("edu.sc.seis.launch4j")
id("org.openapi.generator")
id("com.google.cloud.tools.jib")
Expand Down Expand Up @@ -64,7 +64,7 @@ tasks.jar {
"Specification-Version" to project.version,
"Specification-Vendor" to "HiveMQ GmbH",
"Main-Class" to application.mainClass.get(),
"Built-Date" to SimpleDateFormat("yyyy-MM-dd").format(Date())
"Built-Date" to SimpleDateFormat("yyyy-MM-dd").format(Date()),
)
}

Expand Down Expand Up @@ -164,7 +164,7 @@ val generateHivemqOpenApi by tasks.registering(GenerateTask::class) {
group = "hivemq"
generatorName.set("java")
inputSpec.set(hivemqOpenApi.singleFile.path)
outputDir.set("$buildDir/tmp/$name")
outputDir.set(layout.buildDirectory.dir("tmp/$name").get().asFile.absolutePath)
apiPackage.set("com.hivemq.cli.openapi.hivemq")
modelPackage.set("com.hivemq.cli.openapi.hivemq")
configOptions.put("dateLibrary", "java8")
Expand All @@ -188,7 +188,7 @@ val generateSwarmOpenApi by tasks.registering(GenerateTask::class) {
group = "swarm"
generatorName.set("java")
inputSpec.set(swarmOpenApi.singleFile.path)
outputDir.set("$buildDir/tmp/$name")
outputDir.set(layout.buildDirectory.dir("tmp/$name").get().asFile.absolutePath)
apiPackage.set("com.hivemq.cli.openapi.swarm")
modelPackage.set("com.hivemq.cli.openapi.swarm")
configOptions.put("dateLibrary", "java8")
Expand Down Expand Up @@ -562,18 +562,18 @@ val buildRpmPackage by tasks.registering(Copy::class) {
/* ******************** windows zip ******************** */

launch4j {
headerType = "console"
mainClassName = application.mainClass.get()
icon = "$projectDir/icons/05-mqtt-cli-icon.ico"
jarTask = tasks.shadowJar.get()
copyConfigurable = emptyList<Any>()
copyright = "Copyright 2019-present HiveMQ and the HiveMQ Community"
companyName = "HiveMQ GmbH"
downloadUrl = "https://openjdk.java.net/install/"
jreMinVersion = "1.8"
windowTitle = "MQTT CLI"
version = project.version.toString()
textVersion = project.version.toString()
headerType.set("console")
mainClassName.set(application.mainClass.get())
icon.set("$projectDir/icons/05-mqtt-cli-icon.ico")
setJarTask(tasks.shadowJar.get())
copyConfigurable.set(emptyList<Any>())
copyright.set("Copyright 2019-present HiveMQ and the HiveMQ Community")
companyName.set("HiveMQ GmbH")
downloadUrl.set("https://openjdk.java.net/install/")
jreMinVersion.set("1.8")
windowTitle.set("MQTT CLI")
version.set(project.version.toString())
textVersion.set(project.version.toString())
}

val buildWindowsZip by tasks.registering(Zip::class) {
Expand All @@ -582,7 +582,7 @@ val buildWindowsZip by tasks.registering(Zip::class) {
destinationDirectory.set(layout.buildDirectory.dir("packages/windows"))

from("packages/windows") {
filter { it.replace("@@exeName@@", launch4j.outfile) }
filter { it.replace("@@exeName@@", launch4j.outfile.get()) }
}
from(tasks.createExe.map { it.dest })
from("LICENSE")
Expand All @@ -604,7 +604,7 @@ githubRelease {
buildBrewZip,
buildDebianPackage.map { fileTree(it.destinationDir) },
buildRpmPackage.map { fileTree(it.destinationDir) },
buildWindowsZip
buildWindowsZip,
)
allowUploadToExisting.set(true)
}
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ java-native.version=17
# plugins
#
plugin.defaults.version=0.2.0
plugin.forbiddenapis.version=3.3
plugin.forbiddenapis.version=3.5.1
plugin.git-publish.version=3.0.0
plugin.github-release.version=2.4.1
plugin.graal.version=0.9.19
plugin.jib.version=3.2.1
plugin.launch4j.version=2.5.2
plugin.jib.version=3.3.2
plugin.launch4j.version=3.0.4
plugin.license.version=0.16.1
# >= 5.0.0 break the tasks
plugin.openapi.generator.version=4.3.1
plugin.ospackage.version=9.1.1
plugin.shadow.version=7.1.2
plugin.ospackage.version=11.4.0
plugin.shadow.version=8.1.1
#
# gradle properties
#
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 10 additions & 6 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# 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"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -133,26 +130,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=SC3045
# shellcheck disable=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=SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# 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 $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
4 changes: 0 additions & 4 deletions mqtt-cli-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ repositories {
mavenCentral()
}

dependencies {
api(gradleApi())
}

gradlePlugin {
plugins {
create("native-image") {
Expand Down
15 changes: 7 additions & 8 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
rootProject.name = "mqtt-cli"

pluginManagement {
plugins {
id("com.github.johnrengelman.shadow") version "${extra["plugin.shadow.version"]}"
id("io.github.sgtsilvio.gradle.defaults") version "${extra["plugin.defaults.version"]}"
id("nebula.ospackage") version "${extra["plugin.ospackage.version"]}"
id("com.netflix.nebula.ospackage") version "${extra["plugin.ospackage.version"]}"
id("edu.sc.seis.launch4j") version "${extra["plugin.launch4j.version"]}"
id("org.openapi.generator") version "${extra["plugin.openapi.generator.version"]}"
id("com.google.cloud.tools.jib") version "${extra["plugin.jib.version"]}"
Expand All @@ -14,10 +12,11 @@ pluginManagement {
id("org.ajoberstar.git-publish") version "${extra["plugin.git-publish.version"]}"
id("org.graalvm.buildtools.native") version "${extra["plugin.graal.version"]}"
}
}

includeBuild("mqtt-cli-plugins")

if (file("../hivemq/plugins").exists()) {
includeBuild("../hivemq/plugins")
includeBuild("mqtt-cli-plugins")
if (file("../hivemq/plugins").exists()) {
includeBuild("../hivemq/plugins")
}
}

rootProject.name = "mqtt-cli"
Loading