Skip to content
Open
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
41 changes: 0 additions & 41 deletions .ci.settings.xml

This file was deleted.

49 changes: 14 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- development

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
Expand All @@ -22,58 +22,37 @@ jobs:
image: redis
ports:
- 6379:6379
strategy:
fail-fast: false
matrix:
jdk:
- '8'
- '11'
- '19'
env:
SONARQUBE_HOST_URL: ${{ vars.SONARQUBE_HOST }}
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
MAVEN_OPTS: "-XX:InitialHeapSize=2G -XX:MaxHeapSize=2G -XX:+PrintCommandLineFlags -XX:ThreadStackSize=65536 -XX:-TieredCompilation -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
muteProps: "true"
CODEARTIFACT_AUTH_TOKEN: ${{ secrets.CODEARTIFACT_AUTH_TOKEN }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
java-version: '17'

- name: Setup Maven
run: cp .ci.settings.xml ${HOME}/.m2/settings.xml
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Test
if: matrix.jdk == '8' && github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development'
run: mvn --batch-mode clean install

- name: Linter
if: matrix.jdk == '8' && github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development'
run: mvn checkstyle::check

# - name: Deploy
# if: matrix.jdk == '8' && github.event_name == 'push' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development'
# run: mvn --batch-mode deploy -P test
- name: Build
run: ./gradlew build

- name: SonarQube Scan (Push)
if: matrix.jdk == '11' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')
run: |
mvn --batch-mode clean verify sonar:sonar \
-Dsonar.branch.name=${{ github.ref_name }}
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')
run: ./gradlew sonar -Dsonar.branch.name=${{ github.ref_name }}

- name: SonarQube Scan (Pull Request)
if: matrix.jdk == '11' && github.event_name == 'pull_request'
if: github.event_name == 'pull_request'
run: |
mvn --batch-mode clean verify sonar:sonar \
./gradlew sonar \
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} \
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ target
.settings
.DS_Store
dependency-reduced-pom.xml

# Gradle
.gradle/
build/
!gradle/wrapper/gradle-wrapper.jar
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Root project — no source code
// Convention plugins in buildSrc handle shared configuration
23 changes: 23 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
plugins {
`kotlin-dsl`
}

repositories {
mavenLocal()
maven {
url = uri("https://harness0.harness.io/pkg/l7B_kbSEQD2wjrM7PShm5w/fme-mvn/maven")
}
maven {
url = uri("https://fme-079419646996.d.codeartifact.us-east-1.amazonaws.com/maven/maven-fme/")
credentials {
username = "aws"
password = System.getenv("CODEARTIFACT_AUTH_TOKEN") ?: ""
}
}
gradlePluginPortal()
mavenCentral()
}

dependencies {
implementation("io.harness.fme:fme-gradle-plugin:0.5.0")
}
52 changes: 52 additions & 0 deletions buildSrc/src/main/kotlin/java-client.java-library.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
plugins {
`java-library`
id("fme.publishing")
id("fme.jacoco")
id("fme.spotless")
id("fme.sonarqube")
}

fmeSpotless {
checkstyleConfigFile.set(rootProject.file(".github/linter/google-java-style.xml"))
enforceSpotlessCheck.set(false)
}

java {
withJavadocJar()
withSourcesJar()
}

tasks.withType<Jar> {
manifest {
attributes(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version
)
}
}

tasks.withType<Test> {
useJUnitPlatform()
}

tasks.withType<Javadoc> {
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet")
}

// Ensure consistent JVM environment attribute resolution for all modules.
// Required by libraries like Guava (-jre variant) that use Gradle's
// variant-aware dependency resolution.
sourceSets.all {
configurations.getByName(runtimeClasspathConfigurationName) {
attributes.attribute(
org.gradle.api.attributes.java.TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE,
objects.named<org.gradle.api.attributes.java.TargetJvmEnvironment>(org.gradle.api.attributes.java.TargetJvmEnvironment.STANDARD_JVM)
)
}
configurations.getByName(compileClasspathConfigurationName) {
attributes.attribute(
org.gradle.api.attributes.java.TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE,
objects.named<org.gradle.api.attributes.java.TargetJvmEnvironment>(org.gradle.api.attributes.java.TargetJvmEnvironment.STANDARD_JVM)
)
}
}
9 changes: 9 additions & 0 deletions buildSrc/src/main/kotlin/java-client.java17.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
id("java-client.java-library")
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
71 changes: 71 additions & 0 deletions client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
plugins {
id("java-client.java17")
alias(libs.plugins.shadow)
}

group = "io.split.client"
version = "4.18.3"
description = "Java SDK for Split"

dependencies {
api(project(":pluggable-storage"))
implementation(libs.guava)
implementation(libs.slf4j.api)
implementation(libs.httpclient5)
implementation(libs.gson)
implementation(libs.snakeyaml)

testImplementation(libs.junit4)
testRuntimeOnly(libs.junit.vintage.engine)
testImplementation("org.hamcrest:hamcrest-all:1.3")
testImplementation("org.mockito:mockito-core:1.10.19") // pinned to 1.x for legacy tests using MockitoJUnitRunner
testImplementation(libs.slf4j.log4j12)
testImplementation(libs.commons.lang3)
testImplementation(libs.awaitility)
testImplementation(libs.okhttp.mockwebserver)

// Jersey test dependencies
testImplementation("org.glassfish.jersey.media:jersey-media-sse:2.31")
testImplementation("org.glassfish.jersey.inject:jersey-hk2:2.31")
testImplementation("org.glassfish.jersey.containers:jersey-container-grizzly2-http:2.26")

// Powermock (legacy, needed for existing tests)
testImplementation("org.powermock:powermock-module-junit4:1.7.4")
testImplementation("org.powermock:powermock-api-mockito:1.7.4")
}

// Resource filtering for splitversion.properties
tasks.processResources {
filesMatching("splitversion.properties") {
expand("project" to mapOf("version" to project.version))
}
}

// Shaded fat JAR — include transitive deps, relocate to avoid conflicts
tasks.shadowJar {
mergeServiceFiles()

// Include only specific artifacts in the shadow jar
dependencies {
include(dependency(project(":pluggable-storage")))
include(dependency("com.google.guava:guava"))
include(dependency("com.google.code.gson:gson"))
include(dependency("org.yaml:snakeyaml"))
include(dependency("org.apache.httpcomponents.client5:httpclient5"))
include(dependency("org.apache.httpcomponents.core5:httpcore5"))
include(dependency("org.apache.httpcomponents.core5:httpcore5-h2"))
include(dependency("org.checkerframework:checker-qual"))
include(dependency("commons-codec:commons-codec"))
include(dependency("com.google.errorprone:error_prone_annotations"))
include(dependency("com.google.guava:failureaccess"))
include(dependency("com.google.guava:listenablefuture"))
include(dependency("com.google.j2objc:j2objc-annotations"))
}

relocate("org.apache", "split.org.apache")
relocate("org.checkerframework", "split.org.checkerframework")
relocate("org.yaml.snakeyaml", "split.org.yaml.snakeyaml")
relocate("com.google", "split.com.google")

exclude("META-INF/**", "LICENSE", "NOTICE", "/*.txt", "build.properties")
}
Loading
Loading