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
21 changes: 14 additions & 7 deletions .github/workflows/bp-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,22 @@ jobs:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
steps:
- name: Set up JDK 8
uses: actions/setup-java@v3
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: '8'
distribution: 'adopt'
java-version: '21'
distribution: 'temurin'
- name: Install Nats Server
run: |
curl -sf https://binaries.nats.dev/nats-io/nats-server/v2@main | PREFIX=. sh
sudo mv nats-server /usr/local/bin
pkill -9 nats-server 2>/dev/null || true
mkdir -p ~/.local/bin
cd $GITHUB_WORKSPACE
git clone https://github.com/nats-io/nats-server.git
cd nats-server
go build -o ~/.local/bin/nats-server
nats-server -v
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Compile and Test
run: |
pushd batch-publish
Expand All @@ -45,3 +49,6 @@ jobs:
pushd batch-publish
./gradlew -i publishToSonatype
popd
- name: Clean up
if: always()
run: pkill -9 nats-server 2>/dev/null || true
23 changes: 15 additions & 8 deletions .github/workflows/bp-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,23 @@ jobs:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
steps:
- name: Set up JDK 8
uses: actions/setup-java@v3
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: '8'
distribution: 'adopt'
java-version: '21'
distribution: 'temurin'
- name: Install Nats Server
run: |
curl -sf https://binaries.nats.dev/nats-io/nats-server/v2@main | PREFIX=. sh
sudo mv nats-server /usr/local/bin
pkill -9 nats-server 2>/dev/null || true
mkdir -p ~/.local/bin
cd $GITHUB_WORKSPACE
git clone https://github.com/nats-io/nats-server.git
cd nats-server
go build -o ~/.local/bin/nats-server
nats-server -v
- name: Check out code
uses: actions/checkout@v3
- name: Compile and Test
uses: actions/checkout@v4
- name: Build and Test
run: |
pushd batch-publish
chmod +x gradlew && ./gradlew clean test
Expand All @@ -39,3 +43,6 @@ jobs:
pushd batch-publish
./gradlew javadoc
popd
- name: Clean up
if: always()
run: pkill -9 nats-server 2>/dev/null || true
23 changes: 15 additions & 8 deletions .github/workflows/bp-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,22 @@ jobs:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
steps:
- name: Set up JDK 8
uses: actions/setup-java@v3
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: '8'
distribution: 'adopt'
java-version: '21'
distribution: 'temurin'
- name: Install Nats Server
run: |
curl -sf https://binaries.nats.dev/nats-io/nats-server/v2@main | PREFIX=. sh
sudo mv nats-server /usr/local/bin
pkill -9 nats-server 2>/dev/null || true
mkdir -p ~/.local/bin
cd $GITHUB_WORKSPACE
git clone https://github.com/nats-io/nats-server.git
cd nats-server
go build -o ~/.local/bin/nats-server
nats-server -v
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Compile and Test
run: |
pushd batch-publish
Expand All @@ -35,5 +39,8 @@ jobs:
- name: Verify, Sign and Publish Release
run: |
pushd batch-publish
./gradlew -i signArchives signMavenJavaPublication publishToSonatype closeAndReleaseSonatypeStagingRepository
./gradlew -i publishToSonatype closeAndReleaseSonatypeStagingRepository
popd
- name: Clean up
if: always()
run: pkill -9 nats-server 2>/dev/null || true
96 changes: 40 additions & 56 deletions batch-publish/build.gradle
Original file line number Diff line number Diff line change
@@ -1,54 +1,53 @@
import aQute.bnd.gradle.Bundle
import org.gradle.internal.os.OperatingSystem

plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.12.0'
id 'biz.aQute.bnd.builder' version '5.1.2'
id "org.gradle.test-retry" version "1.1.9"
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
id 'signing'
id("java")
id("java-library")
id("maven-publish")
id("jacoco")
id("biz.aQute.bnd.builder") version "7.1.0"
id("org.gradle.test-retry") version "1.6.4"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id("signing")
}

def jarVersion = "0.2.3"
group = 'io.synadia'

def isMerge = System.getenv("BUILD_EVENT") == "push"
def isRelease = System.getenv("BUILD_EVENT") == "release"

// version is the variable the build actually uses.
version = isRelease ? jarVersion : jarVersion + "-SNAPSHOT"
def tc = System.getenv("TARGET_COMPATIBILITY");
def targetCompat = tc == "21" ? JavaVersion.VERSION_21 : (tc == "17" ? JavaVersion.VERSION_17 : JavaVersion.VERSION_1_8)
def jarEnd = tc == "21" ? "-jdk21" : (tc == "17" ? "-jdk17" : "")
def jarAndArtifactName = "batch-publish" + jarEnd

version = isRelease ? jarVersion : jarVersion + "-SNAPSHOT" // version is the variable the build actually uses.

System.out.println("Java: " + System.getProperty("java.version"))
System.out.println("Target Compatibility: " + targetCompat)
System.out.println(group + ":" + jarAndArtifactName + ":" + version)

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = targetCompat
}

repositories {
mavenCentral()
maven {
url "https://repo1.maven.org/maven2/"
}
maven {
url "https://central.sonatype.com/repository/maven-snapshots/"
}
maven { url="https://repo1.maven.org/maven2/" }
maven { url="https://central.sonatype.com/repository/maven-snapshots/" }
}

dependencies {
implementation 'io.nats:jnats:2.24.0'
implementation 'org.jspecify:jspecify:1.0.0'

testImplementation 'io.nats:jnats-server-runner:1.2.8'
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
testImplementation 'com.github.stefanbirkner:system-lambda:1.2.1'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.12.3'
}
testImplementation 'nl.jqno.equalsverifier:equalsverifier:4.2.3'

configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
testImplementation 'org.junit.jupiter:junit-jupiter:5.14.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

sourceSets {
Expand All @@ -70,14 +69,14 @@ tasks.register('bundle', Bundle) {
}

jar {
manifest {
attributes('Automatic-Module-Name': 'io.synadia.batch.publish')
bundle {
bnd("Bundle-Name": "io.synadia.batch.publish",
"Bundle-Vendor": "synadia.io",
"Bundle-Description": "JetStream Distributed Counters",
"Bundle-DocURL": "https://github.com/synadia-io/orbit.java/tree/main/counters",
"Target-Compatibility": "Java " + targetCompat
)
}
bnd (['Implementation-Title': 'Batch Publish',
'Implementation-Version': jarVersion,
'Implementation-Vendor': 'synadia.io']
)
exclude("io/synadia/examples/**")
}

test {
Expand All @@ -90,21 +89,6 @@ javadoc {
source = sourceSets.main.allJava
title = "Synadia Communications Inc. Batch Publish"
classpath = sourceSets.main.runtimeClasspath
doLast {
if (!OperatingSystem.current().isWindows()) {
exec {
println "Updating favicon on all html files"
workingDir 'build/docs/javadoc'
// Only on linux, mac at this point
commandLine 'find', '.', '-name', '*.html', '-exec', 'sed', '-i', '-e', 's#<head>#<head><link rel="icon" type="image/ico" href="favicon.ico">#', '{}', ';'
}
copy {
println "Copying images to javadoc folder"
from 'src/main/javadoc/images'
into 'build/docs/javadoc'
}
}
}
}

tasks.register('examplesJar', Jar) {
Expand All @@ -129,14 +113,18 @@ tasks.register('sourcesJar', Jar) {
from sourceSets.main.allSource
}

artifacts {
archives javadocJar, sourcesJar, examplesJar
}

jacoco {
toolVersion = "0.8.6"
toolVersion = "0.8.12"
}

jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
xml.required = true // coveralls plugin depends on xml format report
html.required = true
}
afterEvaluate { // only report on main library not examples
classDirectories.setFrom(files(classDirectories.files.collect {
Expand All @@ -146,10 +134,6 @@ jacocoTestReport {
}
}

artifacts {
archives javadocJar, sourcesJar, examplesJar
}

nexusPublishing {
repositories {
sonatype {
Expand All @@ -169,10 +153,10 @@ publishing {
artifact examplesJar
artifact javadocJar
pom {
name = 'batch-publish'
name = jarAndArtifactName
packaging = 'jar'
groupId = group
artifactId = archivesBaseName
artifactId = jarAndArtifactName
description = 'Synadia Communications Inc. Batch Publish'
url = 'https://github.com/synadia-io/orbit.java'
licenses {
Expand Down
12 changes: 12 additions & 0 deletions batch-publish/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format

[versions]
commons-math3 = "3.6.1"
guava = "33.4.5-jre"
junit-jupiter = "5.12.1"

[libraries]
commons-math3 = { module = "org.apache.commons:commons-math3", version.ref = "commons-math3" }
guava = { module = "com.google.guava:guava", version.ref = "guava" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
Binary file modified batch-publish/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion batch-publish/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-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading