Skip to content

Commit f709043

Browse files
authored
Merge pull request #18 from samkim/api-v1
Add v1 API
2 parents 013ad20 + 005c3ce commit f709043

7 files changed

Lines changed: 395 additions & 253 deletions

File tree

.github/workflows/build.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,25 @@ jobs:
2727
- uses: "gradle/wrapper-validation-action@v1"
2828
- name: "Gradle Build"
2929
run: "./gradlew build"
30+
test:
31+
runs-on: "ubuntu-latest"
32+
strategy:
33+
matrix:
34+
java: [ 8, 11, 16 ] # Oldest, LTS, Latest
35+
name: "Java ${{ matrix.java }} Test"
36+
steps:
37+
- uses: "actions/checkout@v2"
38+
- uses: "actions/setup-java@v2"
39+
with:
40+
distribution: "adopt"
41+
java-package: "jdk"
42+
java-version: "${{ matrix.java }}"
43+
- uses: "bufbuild/buf-setup-action@v0.2.0"
44+
with:
45+
version: "0.48.2"
46+
- uses: "authzed/action-spicedb@v1"
47+
with:
48+
version: "latest"
49+
- uses: "gradle/wrapper-validation-action@v1"
50+
- name: "Gradle integrationTest"
51+
run: "./gradlew integrationTest --info"

build.gradle

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,16 @@ javadoc { options.addStringOption('Xdoclint:none', '-quiet') }
7979

8080
def grpcVersion = "1.39.0"
8181
def protocVersion = "3.17.3"
82-
def authzedProtoCommit = "12963402f4474d528d5c14a5162db287"
82+
def authzedProtoCommit = "47e8bd10f0614fed8a7a0e26cab74e7b"
8383
def bufDir = "${buildDir}/buf"
8484
def protocPlatformTag = project.findProperty('protoc_platform') ? ":${protoc_platform}" : ""
8585

86+
sourceSets { main {
87+
proto { srcDir bufDir }
88+
java { srcDir "$buildDir/generated" }
89+
java { srcDir "$buildDir/src" }
90+
}}
91+
8692
dependencies {
8793
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
8894
implementation "io.grpc:grpc-stub:${grpcVersion}"
@@ -92,20 +98,20 @@ dependencies {
9298

9399
task validateProtos(type: Exec) {
94100
mkdir bufDir
95-
commandLine("buf", "export", "--exclude-imports", "buf.build/beta/protoc-gen-validate", "-o", bufDir)
101+
commandLine("buf", "export", "--exclude-imports", "buf.build/envoyproxy/protoc-gen-validate", "-o", bufDir)
102+
}
103+
104+
task gatewayProtos(type: Exec) {
105+
mkdir bufDir
106+
commandLine("buf", "export", "--exclude-imports", "buf.build/grpc-ecosystem/grpc-gateway", "-o", bufDir)
96107
}
97108

98109
task authzedProtos(type: Exec) {
99110
dependsOn validateProtos
111+
dependsOn gatewayProtos
100112
commandLine("buf", "export", "--exclude-imports", "buf.build/authzed/api:${authzedProtoCommit}", "-o", bufDir)
101113
}
102114

103-
sourceSets { main {
104-
proto { srcDir bufDir }
105-
java { srcDir "$buildDir/generated" }
106-
java { srcDir "$buildDir/src" }
107-
}}
108-
109115
protobuf {
110116
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}${protocPlatformTag}" }
111117
plugins { grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}${protocPlatformTag}" } }
@@ -120,3 +126,30 @@ tasks.named("jar") { manifest {
120126
attributes("Implementation-Title": project.name,
121127
"Implementation-Version": project.version)
122128
}}
129+
130+
sourceSets {
131+
intTest {
132+
compileClasspath += sourceSets.main.output
133+
runtimeClasspath += sourceSets.main.output
134+
}
135+
}
136+
137+
configurations {
138+
intTestImplementation.extendsFrom implementation
139+
intTestRuntimeOnly.extendsFrom runtimeOnly
140+
}
141+
142+
dependencies {
143+
intTestImplementation "junit:junit:4.13"
144+
}
145+
146+
tasks.register('integrationTest', Test) {
147+
useJUnit()
148+
149+
description = 'Runs integration tests.'
150+
group = 'verification'
151+
152+
testClassesDirs = sourceSets.intTest.output.classesDirs
153+
classpath = sourceSets.intTest.runtimeClasspath
154+
shouldRunAfter test
155+
}

examples/v0/App.java

Lines changed: 0 additions & 117 deletions
This file was deleted.

examples/v0/Check.clj

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)