Skip to content

Commit

Permalink
Modernize the build cycle (#53)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Brandes <[email protected]>
  • Loading branch information
NotMyFault authored Feb 11, 2024
1 parent 5a077a6 commit 8cb304f
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 39 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@ jobs:
- name: "Checkout Repository"
uses: actions/checkout@v4
- name: "Validate Gradle Wrapper"
uses: "gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
- name: "Setup Java"
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- name: "Clean Build"
run: "./gradlew clean build"
- name: "Archive Artifacts"
uses: actions/upload-artifact@v3
with:
name: "HTTP4J-SNAPSHOT"
path: "build/libs/*.jar"
- name: "Determine release status"
if: "${{ runner.os == 'Linux' }}"
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ repositories {
}
dependencies {
compileOnly("com.intellectualsites.http:HTTP4J:1.3")
compileOnly("com.intellectualsites.http:HTTP4J:1.4")
}
```

```xml
<dependency>
<groupId>com.intellectualsites.http</groupId>
<artifactId>HTTP4J</artifactId>
<version>1.3</version>
<version>1.4</version>
</dependency>
```

Expand Down
19 changes: 12 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ repositories {
}

dependencies {
compileOnly(libs.gson)
implementation(libs.annotations)

testImplementation(libs.jupiter)
testImplementation(libs.mockserverNetty)
testImplementation(libs.mockserverClient)
testImplementation(libs.logback)
compileOnly(libs.gson)
testCompileOnly(libs.gson)
testRuntimeOnly(libs.junitPlatform)
}

java {
Expand All @@ -35,10 +37,6 @@ tasks.compileJava.configure {
options.release.set(8)
}

configurations.all {
attributes.attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
}

group = "com.intellectualsites.http"
version = "1.4-SNAPSHOT"

Expand Down Expand Up @@ -73,8 +71,8 @@ tasks {
"implSpec:a:Implementation Requirements:",
"implNote:a:Implementation Note:"
)
opt.links("https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/")
opt.links("https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.8/")
opt.links("https://javadoc.io/doc/org.jetbrains/annotations/" + libs.annotations.get().versionConstraint.toString())
opt.links("https://www.javadoc.io/doc/com.google.code.gson/gson/" + libs.gson.get().versionConstraint.toString())
}
}

Expand Down Expand Up @@ -114,6 +112,13 @@ publishing {
organization.set("IntellectualSites")
organizationUrl.set("https://github.com/IntellectualSites/")
}
developer {
id.set("NotMyFault")
name.set("Alexander Brandes")
organization.set("IntellectualSites")
organizationUrl.set("https://github.com/IntellectualSites")
email.set("contact(at)notmyfault.dev")
}
}

scm {
Expand Down
10 changes: 6 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
[versions]
annotations = "24.0.1"
jupiter = "5.10.0"
annotations = "24.1.0"
jupiter = "5.10.2"
junit-platform = "1.10.2"
mockserver = "5.15.0"
logback = "1.4.11"
logback = "1.4.14"
gson = "2.8.9"

spotless = "6.22.0"
spotless = "6.25.0"
nexus = "1.3.0"

[libraries]
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
jupiter = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "jupiter" }
junitPlatform = { group = "org.junit.platform", name = "junit-platform-launcher", version.ref = "junit-platform" }
mockserverNetty = { group = "org.mock-server", name = "mockserver-netty", version.ref = "mockserver" }
mockserverClient = { group = "org.mock-server", name = "mockserver-client-java", version.ref = "mockserver" }
logback = { group = "ch.qos.logback", name = "logback-classic", version.ref = "logback" }
Expand Down
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,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ 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=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=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ 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
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_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" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down

0 comments on commit 8cb304f

Please sign in to comment.