plugins { // Java compilation, unit tests, and library distribution needs. Read more at: // https://docs.gradle.org/current/userguide/java_library_plugin.html id 'java-library' // Maven publishing needs id 'maven-publish' // Signing needs for Maven publishing id 'signing' // 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" } apply plugin: 'com.github.spotbugs' /* 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 Clean Rooms implementation 'software.amazon.awssdk:cleanrooms:2.20.112' // SQL implementation 'org.xerial:sqlite-jdbc:3.42.0.0' // Parsing - CSV implementation 'com.univocity:univocity-parsers:2.9.1' // 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' // Logging test tools testImplementation 'io.github.hakky54:logcaptor:2.9.0' } test { // Enable JUnit 5 (Gradle 4.6+). useJUnitPlatform() // 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 } // File permissions tests behave oddly in some environments (e.g., root user) // so we have them be their own task that can be called out when needed filter { excludeTestsMatching 'FileUtilTest' } finalizedBy jacocoTestReport } tasks.register('checkFileUtilTest', Test) { description = 'Runs FileUtilTest.' group = 'verification' useJUnitPlatform() filter { includeTestsMatching 'FileUtilTest' } shouldRunAfter test } check.dependsOn checkFileUtilTest task sourcesJar(type: Jar, dependsOn: classes) { archiveClassifier = "sources" from sourceSets.main.allSource } task javadocJar(type: Jar, dependsOn: javadoc) { archiveClassifier = "javadoc" from javadoc.destinationDir } task testJar(type: Jar, dependsOn: [classes, testClasses]) { archiveClassifier = 'tests' from sourceSets.test.output } configurations { testArtifacts testImplementation { exclude group: 'org.apache.logging.log4j', module: 'log4j-slf4j-impl' exclude group: 'org.slf4j', module: 'slf4j-reload4j' exclude group: 'org.slf4j', module: 'slf4j-log4j12' } } artifacts { archives sourcesJar archives javadocJar testArtifacts testJar } // Maven Publishing publishing { publications { maven(MavenPublication) { version "$c3r_version" groupId 'software.amazon.c3r' artifact sourcesJar artifact javadocJar from components.java pom { name = 'Amazon C3R SDK Core' description = 'Cryptographic Computing for Clean Rooms SDK Core' url = 'https://github.com/aws/c3r' inceptionYear = '2022' scm { url = 'https://github.com/aws/c3r/tree/main' connection = 'scm:git:ssh://git@github.com/aws/c3r.git' developerConnection = 'scm:git:ssh://git@github.com/aws/c3r.git' } licenses { license { name = 'The Apache License, Version 2.0' url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' distribution = 'repo' } } developers { developer { id = "amazonwebservices" name = "Amazon Web Services" } } } } } repositories { maven { url = 'https://aws.oss.sonatype.org/service/local/staging/deploy/maven2/' credentials(PasswordCredentials) } } } signing { sign publishing.publications.maven }