Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.
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/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,25 @@ jobs:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v4
- name: Setup JDK
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
gradle-version: current
- name: Check out code
uses: actions/checkout@v4
- name: Build and Test
run: chmod +x gradlew && ./gradlew clean test jacocoTestReport coveralls
run: chmod +x gradlew && ./gradlew clean test jacocoTestReport
- name: Verify Javadoc
run: ./gradlew javadoc
- name: Send coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
- name: Publish Snapshot
run: ./gradlew -i publishToSonatype
21 changes: 14 additions & 7 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,23 @@ jobs:
runs-on: ubuntu-latest
env:
BUILD_EVENT: ${{ github.event_name }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v4
- name: Setup JDK
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
gradle-version: current
- name: Check out code
uses: actions/checkout@v4
- name: Build and Test
run: chmod +x gradlew && ./gradlew clean test jacocoTestReport coveralls
run: chmod +x gradlew && ./gradlew clean test jacocoTestReport
- name: Verify Javadoc
run: ./gradlew javadoc
- name: Send coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
16 changes: 10 additions & 6 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@ jobs:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v4
- name: Setup JDK
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
gradle-version: current
- name: Check out code
uses: actions/checkout@v4
- name: Build and Test
run: chmod +x gradlew && ./gradlew clean test
- name: Verify Javadoc
run: ./gradlew javadoc
- name: Verify, Sign and Publish Release
run: ./gradlew -i signMavenJavaPublication publishToSonatype closeAndReleaseSonatypeStagingRepository
run: ./gradlew -i publishToSonatype closeAndReleaseSonatypeStagingRepository
123 changes: 60 additions & 63 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,43 +1,70 @@
import org.gradle.internal.os.OperatingSystem
import aQute.bnd.gradle.Bundle

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

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

def isMerge = System.getenv("BUILD_EVENT") == "push"
def isRelease = System.getenv("BUILD_EVENT") == "release"
def tc = System.getenv("TARGET_COMPATIBILITY");
def targetCompat = tc == "25" ? JavaVersion.VERSION_25 : JavaVersion.VERSION_21
def jarEnd = tc == "25" ? "-jdk25" : ""
def jarAndArtifactName = "jnats-json" + jarEnd

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

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = targetCompat
}

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

dependencies {
implementation 'org.jspecify:jspecify:1.0.0'
implementation 'commons-codec:commons-codec:1.18.0'
implementation 'commons-codec:commons-codec:1.20.0'

testImplementation 'org.junit.jupiter:junit-jupiter:5.14.1'

testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

tasks.register('bundle', Bundle) {
from sourceSets.main.output
}

java {
withSourcesJar()
withJavadocJar()
}

jar {
bundle {
bnd("Bundle-Name": "io.synadia.jnats.json",
"Bundle-Vendor": "synadia.io",
"Bundle-Description": "JNats Json Utils",
"Bundle-DocURL": "https://github.com/synadia-io/jnats.json",
"Target-Compatibility": "Java " + targetCompat
)
}
}

testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:4.0'
java {
withSourcesJar()
withJavadocJar()
}

test {
Expand All @@ -50,36 +77,11 @@ test {
}

javadoc {
options.addBooleanOption('html5', true)
failOnError = false
options.overview = 'src/main/javadoc/overview.html' // relative to source root
source = sourceSets.main.allJava
title = "NATS.IO JNats JSON"
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('javadocJar', Jar) {
archiveClassifier.set('javadoc')
from javadoc
}

tasks.register('sourcesJar', Jar) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}

jacoco {
Expand All @@ -93,19 +95,13 @@ jacocoTestReport {
}
}

artifacts {
archives javadocJar, sourcesJar
}

if (isMerge || isRelease) {
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
username = System.getenv('OSSRH_USERNAME')
password = System.getenv('OSSRH_PASSWORD')
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
username = System.getenv('OSSRH_USERNAME')
password = System.getenv('OSSRH_PASSWORD')
}
}
}
Expand All @@ -117,12 +113,12 @@ publishing {
artifact sourcesJar
artifact javadocJar
pom {
name = rootProject.name
name = jarAndArtifactName
packaging = 'jar'
groupId = group
artifactId = archivesBaseName
artifactId = jarAndArtifactName
description = 'JSON Parser built specifically for JNATS'
url = 'https://github.com/synadia-io/json.java21'
url = 'https://github.com/synadia-io/jnats.json'
licenses {
license {
name = 'The Apache License, Version 2.0'
Expand All @@ -138,7 +134,7 @@ publishing {
}
}
scm {
url = 'https://github.com/synadia-io/json.java21'
url = 'https://github.com/synadia-io/jnats.json'
}
}
}
Expand All @@ -151,6 +147,7 @@ if (isRelease) {
def signingKey = System.getenv('SIGNING_KEY')
def signingPassword = System.getenv('SIGNING_PASSWORD')
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign configurations.archives
sign publishing.publications.mavenJava
}
}
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.14-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 1 addition & 4 deletions gradlew

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

3 changes: 1 addition & 2 deletions gradlew.bat

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

11 changes: 1 addition & 10 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user manual at https://docs.gradle.org/6.3/userguide/multi_project_builds.html
*/

rootProject.name = 'jnats-json-21'
rootProject.name = 'jnats-json'
3 changes: 2 additions & 1 deletion src/main/java/io/synadia/json/ArrayBuilder.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2025 Synadia Communications, Inc.
// Copyright 2025-2026 Synadia Communications, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/io/synadia/json/DateTimeUtils.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// Copyright 2025 Synadia Communications, Inc.
// Copyright 2020-2025 The NATS Authors
//
// Modifications Copyright 2025-2026 Synadia Communications, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
Expand All @@ -11,6 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.


package io.synadia.json;

import org.jspecify.annotations.NonNull;
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/io/synadia/json/Encoding.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// Copyright 2025 Synadia Communications, Inc.
// Copyright 2020-2025 The NATS Authors
//
// Modifications Copyright 2025-2026 Synadia Communications, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/io/synadia/json/JsonParseException.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Copyright 2023 The NATS Authors
//
// Modifications Copyright 2025-2026 Synadia Communications, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package io.synadia.json;

import java.io.IOException;
Expand Down
Loading