plugins { // Support using this application on the CLI id 'application' // Build jumbo jar for distribution id "com.github.johnrengelman.shadow" version "8.1.1" // SpotBugs for quality checks and reports of source files. Read more at: // https://spotbugs.readthedocs.io/en/stable/gradle.html id "com.github.spotbugs" version "5.0.14" // Vanilla code generation. Read more at: // https://projectlombok.org/ id "io.freefair.lombok" version "$freefair_version" // Aggregate Javadoc generation. Read more at: // https://docs.freefair.io/gradle-plugins/6.6.1/reference/#_io_freefair_javadocs id 'io.freefair.javadocs' version "$freefair_version" } // SpotBugs for quality checks and reports of source files. Read more at: // https://spotbugs.readthedocs.io/en/stable/gradle.html apply plugin: 'com.github.spotbugs' apply plugin: 'com.github.johnrengelman.shadow' /* Configures the SpotBugs "com.github.spotbugs" plugin. Remove this and the plugin to skip these checks and report generation. */ spotbugs { ignoreFailures.set(false) spotbugsTest.enabled = false excludeFilter.set(file("../config/spotbugs/excludeFilter.xml")) } dependencies { // AWS-C3R implementation project(":c3r-sdk-core") testImplementation project(":c3r-sdk-parquet") // AWS Clean Rooms implementation 'software.amazon.awssdk:cleanrooms:2.20.112' // CLI implementation 'info.picocli:picocli:4.7.4' // Parsing - JSON implementation 'com.google.code.gson:gson:2.10.1' // https://mvnrepository.com/artifact/com.github.spotbugs/spotbugs-annotations implementation 'com.github.spotbugs:spotbugs-annotations:4.7.3' // Spark compileOnly "org.apache.spark:spark-streaming_2.13:$spark_version" compileOnly "org.apache.spark:spark-sql_2.13:$spark_version" // Testing testImplementation "org.apache.spark:spark-core_2.13:$spark_version" // Parsing - CSV testImplementation 'com.univocity:univocity-parsers:2.9.1' } configurations { testImplementation.extendsFrom compileOnly } application { mainClass = "com.amazonaws.c3r.spark.cli.Main" } test { // Enable JUnit 5 (Gradle 4.6+). useJUnitPlatform() ignoreFailures false // Fake key for testing environment "C3R_SHARED_SECRET", "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=" filter { excludeTestsMatching '*EnvVarKeyInvalidTest' } // Always run tests, even when nothing changed. dependsOn 'cleanTest' // Show test results. testLogging { events "failed" showExceptions true exceptionFormat "full" showCauses true showStackTraces true showStandardStreams = false } finalizedBy jacocoTestReport } tasks.register('badEnvironmentVariableTest', Test) { description = 'Runs unit tests which need an invalid shared secret in the env var C3R_SHARED_SECRET.' group = 'verification' useJUnitPlatform() environment "C3R_SHARED_SECRET", "BadKey" filter { includeTestsMatching '*EnvVarKeyInvalidTest' } shouldRunAfter test } tasks.withType(Test) { // Required for Spark. While Spark supports Java 17, it still makes a call to this class // and will cause a runtime failure. jvmArgs '--add-exports=java.base/sun.nio.ch=ALL-UNNAMED' } check.dependsOn badEnvironmentVariableTest shadowJar { zip64 = true mergeServiceFiles() }