-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
66 changed files
with
8,140 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Build and Test (Java) | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
merge_group: | ||
paths: | ||
- 'pkg/java/**' | ||
- 'OpenFGAParser.g4' | ||
- 'OpenFGALexer.g4' | ||
- 'tests' | ||
pull_request: | ||
paths: | ||
- 'pkg/java/**' | ||
- 'OpenFGAParser.g4' | ||
- 'OpenFGALexer.g4' | ||
- 'tests' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build and Test Java | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
java: [ '11', '17', '20' ] | ||
|
||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | ||
- name: Set up JDK | ||
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'temurin' | ||
cache: gradle | ||
cache-dependency-path: | | ||
./pkg/java/*.gradle* | ||
./pkg/java/**/gradle-wrapper.properties | ||
- name: Test and Build with Gradle | ||
run: make all-tests-java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,8 @@ node_modules/ | |
# Generated code | ||
/OpenFGALexer.tokens | ||
/gen/OpenFGALexer.* | ||
|
||
# build files | ||
.gradle | ||
build | ||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
BINARY_NAME=openfga-language | ||
DOCKER_BINARY=docker | ||
|
||
all: build | ||
|
||
build: | ||
./gradlew build | ||
|
||
clean: | ||
./gradlew clean | ||
|
||
test: | ||
./gradlew check | ||
|
||
lint: | ||
echo "java lint Not implemented" | ||
|
||
audit: | ||
echo "java audit Not implemented" | ||
|
||
format: | ||
echo "java format Not implemented" | ||
|
||
all-tests: build audit lint test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
plugins { | ||
id 'java' | ||
|
||
// Quality | ||
id 'jacoco' | ||
id 'jvm-test-suite' | ||
id 'com.diffplug.spotless' version '6.23.3' | ||
|
||
// IDE | ||
id 'idea' | ||
id 'eclipse' | ||
|
||
// Publishing | ||
id 'maven-publish' | ||
id 'signing' | ||
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' | ||
} | ||
|
||
//apply from: 'publish.gradle' | ||
|
||
group = 'dev.openfga' | ||
version = '0.0.1' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
|
||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
sourceSets { | ||
main { | ||
java { | ||
srcDirs = [ | ||
'src/main/java', | ||
'src/main/gen', | ||
] | ||
} | ||
} | ||
test { | ||
java { | ||
srcDirs = ['src/test/java'] | ||
} | ||
} | ||
} | ||
|
||
javadoc { | ||
exclude("dev/openfga/language/antlr/**") | ||
|
||
// Ignore warnings. | ||
options.addStringOption('Xdoclint:none', '-quiet') | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
// JaCoCo coverage report is always generated after tests run. | ||
finalizedBy jacocoTestReport | ||
} | ||
|
||
jacocoTestReport { | ||
// tests are required to run before generating a JaCoCo coverage report. | ||
dependsOn test | ||
} | ||
|
||
ext { | ||
junit_version = "5.10.1" | ||
} | ||
|
||
dependencies { | ||
implementation 'org.antlr:antlr4:4.13.1' | ||
implementation 'dev.openfga:openfga-sdk:0.3.1' | ||
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.1' | ||
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.0' | ||
testImplementation 'org.assertj:assertj-core:3.24.2' | ||
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.15.3' | ||
} |
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.4-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.