102 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			Groovy
		
	
	
	
			
		
		
	
	
			102 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			Groovy
		
	
	
	
| buildscript {
 | |
|     repositories {
 | |
|         mavenCentral()
 | |
|     }
 | |
| 
 | |
|     dependencies {
 | |
|         classpath group: 'com.google.protobuf', name: 'protobuf-gradle-plugin', version: '0.9.5'
 | |
|     }
 | |
| }
 | |
| 
 | |
| description = "Core functionality to fetch, process and validate X.509 and JWT SVIDs and Bundles from the Workload API."
 | |
| 
 | |
| apply plugin: 'com.google.protobuf'
 | |
| apply plugin: 'java-test-fixtures'
 | |
| 
 | |
| sourceSets {
 | |
|     main {
 | |
|         java {
 | |
|             srcDirs 'build/generated/source/proto/main/grpc'
 | |
|             srcDirs 'build/generated/source/proto/main/java'
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     integrationTest {
 | |
|         java {
 | |
|             compileClasspath += main.output + test.output
 | |
|             runtimeClasspath += main.output + test.output
 | |
|             srcDir file('src/integrationTest/java')
 | |
|         }
 | |
|         resources.srcDir file('src/integrationTest/resources')
 | |
|     }
 | |
| }
 | |
| 
 | |
| sourcesJar.duplicatesStrategy = DuplicatesStrategy.INCLUDE
 | |
| 
 | |
| configurations {
 | |
|     integrationTestImplementation.extendsFrom testImplementation
 | |
|     integrationTestCompile.extendsFrom testCompile
 | |
|     integrationTestCompileOnly.extendsFrom testCompileOnly
 | |
|     integrationTestRuntime.extendsFrom testRuntime
 | |
|     integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
 | |
| }
 | |
| 
 | |
| task integrationTest(type: Test) {
 | |
|     useJUnitPlatform()
 | |
|     testClassesDirs = sourceSets.integrationTest.output.classesDirs
 | |
|     classpath = sourceSets.integrationTest.runtimeClasspath
 | |
|     outputs.upToDateWhen { false }
 | |
| }
 | |
| 
 | |
| protobuf {
 | |
|     protoc {
 | |
|         artifact = 'com.google.protobuf:protoc:3.25.5'
 | |
|     }
 | |
|     plugins {
 | |
|         grpc {
 | |
|             artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
 | |
|         }
 | |
|     }
 | |
|     generateProtoTasks {
 | |
|         all()*.plugins {
 | |
|             grpc {}
 | |
|         }
 | |
|     }
 | |
| }
 | |
| 
 | |
| dependencies {
 | |
|     if (osdetector.os.is('osx') ) {
 | |
|         project.ext.osArch = System.getProperty("os.arch")
 | |
|         if ("x86_64" == project.ext.osArch) {
 | |
|             compileOnly(project('grpc-netty-macos'))
 | |
|             testImplementation(project('grpc-netty-macos'))
 | |
|         } else if ("aarch64" == project.ext.osArch) {
 | |
|             compileOnly(project('grpc-netty-macos-aarch64'))
 | |
|             testImplementation(project('grpc-netty-macos-aarch64'))
 | |
|         } else {
 | |
|             throw new GradleException("Architecture not supported: " + project.ext.osArch)
 | |
|         }
 | |
|     } else {
 | |
|         compileOnly(project('grpc-netty-linux'))
 | |
|         testImplementation(project('grpc-netty-linux'))
 | |
|     }
 | |
| 
 | |
|     project.ext.osArch = System.getProperty("os.arch")
 | |
| 
 | |
| 
 | |
|     implementation group: 'io.grpc', name: 'grpc-protobuf', version: "${grpcVersion}"
 | |
|     implementation group: 'io.grpc', name: 'grpc-stub', version: "${grpcVersion}"
 | |
|     testImplementation group: 'io.grpc', name: 'grpc-inprocess', version: "${grpcVersion}"
 | |
|     testImplementation group: 'io.grpc', name: 'grpc-testing', version: "${grpcVersion}"
 | |
|     compileOnly group: 'org.apache.tomcat', name: 'annotations-api', version: '6.0.53' // necessary for Java 9+
 | |
| 
 | |
|     // library for processing JWT tokens and JOSE JWK bundles
 | |
|     implementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: "${nimbusVersion}"
 | |
|     testFixturesImplementation group: 'com.nimbusds', name: 'nimbus-jose-jwt', version: "${nimbusVersion}"
 | |
| 
 | |
|     // using bouncy castle for generating X.509 certs for testing purposes
 | |
|     testFixturesImplementation group: 'org.bouncycastle', name: 'bcpkix-jdk15on', version: '1.70'
 | |
|     testFixturesImplementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.18.0'
 | |
| }
 | |
| 
 |