@@ -79,10 +79,16 @@ javadoc { options.addStringOption('Xdoclint:none', '-quiet') }
7979
8080def grpcVersion = " 1.39.0"
8181def protocVersion = " 3.17.3"
82- def authzedProtoCommit = " 12963402f4474d528d5c14a5162db287 "
82+ def authzedProtoCommit = " 47e8bd10f0614fed8a7a0e26cab74e7b "
8383def bufDir = " ${ buildDir} /buf"
8484def 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+
8692dependencies {
8793 implementation " io.grpc:grpc-protobuf:${ grpcVersion} "
8894 implementation " io.grpc:grpc-stub:${ grpcVersion} "
@@ -92,20 +98,20 @@ dependencies {
9298
9399task 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
98109task 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-
109115protobuf {
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+ }
0 commit comments