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
2 changes: 1 addition & 1 deletion .github/workflows/pcg-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build:
uses: ./.github/workflows/workflow-main.yml
uses: synadia-io/workflows/.github/workflows/java-standard-main.yml@main
with:
project-dir: pcgroups
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/pcg-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
build:
uses: ./.github/workflows/workflow-pr.yml
uses: synadia-io/workflows/.github/workflows/java-standard-pr.yml@main
with:
project-dir: pcgroups
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/pcg-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
build:
uses: ./.github/workflows/workflow-release.yml
uses: synadia-io/workflows/.github/workflows/java-standard-release.yml@main
with:
project-dir: pcgroups
secrets: inherit
46 changes: 46 additions & 0 deletions .github/workflows/pcgcli-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Partitioned Consumer Groups Main Snapshot

on:
push:
branches:
- main
paths:
- 'pcgroups-cli/**'

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./pcgroups-cli
steps:
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
- name: Check out code
uses: actions/checkout@v4
- name: Build with Gradle
run: |
chmod +x gradlew && ./gradlew clean test uberJar
- name: Build with Maven
run: mvn clean package
- name: Validate Gradle Uber was created
run: |
FILE_PATH="build/libs/cg.jar"
if [ -f "$FILE_PATH" ]; then
echo "Validation successful: $FILE_PATH was created."
else
echo "Validation failed: $FILE_PATH was not found."
exit 1 # Fails the workflow step
fi
- name: Validate Maven Uber was created
run: |
FILE_PATH="target/cg.jar"
if [ -f "$FILE_PATH" ]; then
echo "Validation successful: $FILE_PATH was created."
else
echo "Validation failed: $FILE_PATH was not found."
exit 1 # Fails the workflow step
fi
45 changes: 45 additions & 0 deletions .github/workflows/pcgcli-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Partitioned Consumer Groups Pull Request

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'pcgroups-cli/**'

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./pcgroups-cli
steps:
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
- name: Check out code
uses: actions/checkout@v4
- name: Build with Gradle
run: |
chmod +x gradlew && ./gradlew clean test uberJar
- name: Build with Maven
run: mvn clean package
- name: Validate Gradle Uber was created
run: |
FILE_PATH="build/libs/cg.jar"
if [ -f "$FILE_PATH" ]; then
echo "Validation successful: $FILE_PATH was created."
else
echo "Validation failed: $FILE_PATH was not found."
exit 1 # Fails the workflow step
fi
- name: Validate Maven Uber was created
run: |
FILE_PATH="target/cg.jar"
if [ -f "$FILE_PATH" ]; then
echo "Validation successful: $FILE_PATH was created."
else
echo "Validation failed: $FILE_PATH was not found."
exit 1 # Fails the workflow step
fi
71 changes: 71 additions & 0 deletions pcgroups-cli/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
plugins {
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")
}

group = 'io.synadia'
version = "0.1.0"
def originalUber = 'pcg-cli-' + version + '-uber.jar'
System.out.println(originalUber)

java {
sourceCompatibility = JavaVersion.VERSION_1_8
}

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

dependencies {
implementation 'io.nats:jnats:2.25.1'
implementation 'org.jspecify:jspecify:1.0.0'
implementation 'io.synadia:pcgroups:0.1.0-SNAPSHOT'
implementation 'info.picocli:picocli:4.7.5'

testImplementation 'io.nats:jnats-server-runner:3.1.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.14.1'
testImplementation 'org.junit.platform:junit-platform-launcher:1.14.3'
}

tasks.register('copyToLib', Copy) {
into "build/libs"
from configurations.runtimeClasspath
}

tasks.register('packageUberJar', Jar) {
archiveClassifier = 'uber'

from sourceSets.main.output

dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}

duplicatesStrategy = DuplicatesStrategy.EXCLUDE
dependsOn copyToLib
}

tasks.register('uberJar', Copy) {
dependsOn packageUberJar

// we want the file to be called cg.jar
from ('build/libs')
include originalUber
destinationDir file('build/libs/')
rename originalUber, "cg.jar"

// this task actually does a copy, so this part removes the original
doLast {
delete('build/libs/' + originalUber)
}
}
12 changes: 12 additions & 0 deletions pcgroups-cli/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 added pcgroups-cli/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions pcgroups-cli/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading