|
| 1 | +import com.yubico.gradle.GitUtils; |
| 2 | +plugins { |
| 3 | + `java-library` |
| 4 | + scala |
| 5 | + `maven-publish` |
| 6 | + signing |
| 7 | + id("com.diffplug.spotless") |
| 8 | + id("info.solidsoft.pitest") |
| 9 | + id("io.github.cosmicsilence.scalafix") |
| 10 | +} |
| 11 | + |
| 12 | +description = "Yubico WebAuthn attestation subsystem" |
| 13 | + |
| 14 | +val publishMe by extra(true) |
| 15 | + |
| 16 | +java { |
| 17 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 18 | + targetCompatibility = JavaVersion.VERSION_1_8 |
| 19 | +} |
| 20 | + |
| 21 | +sourceSets { |
| 22 | + create("integrationTest") { |
| 23 | + compileClasspath += sourceSets.main.get().output |
| 24 | + runtimeClasspath += sourceSets.main.get().output |
| 25 | + } |
| 26 | +} |
| 27 | + |
| 28 | +configurations["integrationTestImplementation"].extendsFrom(configurations.testImplementation.get()) |
| 29 | +configurations["integrationTestRuntimeOnly"].extendsFrom(configurations.testRuntimeOnly.get()) |
| 30 | + |
| 31 | +// Can't use test fixtures because they interfere with pitest: https://github.com/gradle/gradle/issues/12168 |
| 32 | +evaluationDependsOn(":webauthn-server-core") |
| 33 | +val coreTestsOutput = project(":webauthn-server-core").extensions.getByType(SourceSetContainer::class).test.get().output |
| 34 | + |
| 35 | +dependencies { |
| 36 | + api(platform(rootProject)) |
| 37 | + |
| 38 | + api(project(":webauthn-server-core")) |
| 39 | + |
| 40 | + implementation(project(":yubico-util")) |
| 41 | + implementation("com.google.guava:guava") |
| 42 | + implementation("com.fasterxml.jackson.core:jackson-databind") |
| 43 | + implementation("org.bouncycastle:bcprov-jdk15on") |
| 44 | + implementation("org.slf4j:slf4j-api") |
| 45 | + |
| 46 | + testImplementation(platform(project(":test-platform"))) |
| 47 | + testImplementation(coreTestsOutput) |
| 48 | + testImplementation(project(":yubico-util-scala")) |
| 49 | + testImplementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8") |
| 50 | + testImplementation("junit:junit") |
| 51 | + testImplementation("org.bouncycastle:bcpkix-jdk15on") |
| 52 | + testImplementation("org.eclipse.jetty:jetty-server:[9.4.9.v20180320,10)") |
| 53 | + testImplementation("org.mockito:mockito-core") |
| 54 | + testImplementation("org.scala-lang:scala-library") |
| 55 | + testImplementation("org.scalacheck:scalacheck_2.13") |
| 56 | + testImplementation("org.scalatest:scalatest_2.13") |
| 57 | + testImplementation("uk.org.lidalia:slf4j-test") |
| 58 | + |
| 59 | + testImplementation("org.slf4j:slf4j-api") { |
| 60 | + version { |
| 61 | + strictly("[1.7.25,1.8-a)") // Pre-1.8 version required by slf4j-test |
| 62 | + } |
| 63 | + } |
| 64 | +} |
| 65 | + |
| 66 | +val integrationTest = task<Test>("integrationTest") { |
| 67 | + description = "Runs integration tests." |
| 68 | + group = "verification" |
| 69 | + |
| 70 | + testClassesDirs = sourceSets["integrationTest"].output.classesDirs |
| 71 | + classpath = sourceSets["integrationTest"].runtimeClasspath |
| 72 | + shouldRunAfter(tasks.test) |
| 73 | + |
| 74 | + // Required for processing CRL distribution points extension |
| 75 | + systemProperty("com.sun.security.enableCRLDP", "true") |
| 76 | +} |
| 77 | +tasks["check"].dependsOn(integrationTest) |
| 78 | + |
| 79 | +tasks.jar { |
| 80 | + manifest { |
| 81 | + attributes(mapOf( |
| 82 | + "Implementation-Id" to "java-webauthn-server-attestation", |
| 83 | + "Implementation-Title" to project.description, |
| 84 | + "Implementation-Version" to project.version, |
| 85 | + "Implementation-Vendor" to "Yubico", |
| 86 | + "Git-Commit" to GitUtils.getGitCommitOrUnknown(projectDir), |
| 87 | + )) |
| 88 | + } |
| 89 | +} |
| 90 | + |
| 91 | +pitest { |
| 92 | + pitestVersion.set("1.4.11") |
| 93 | + timestampedReports.set(false) |
| 94 | + |
| 95 | + outputFormats.set(listOf("XML", "HTML")) |
| 96 | + |
| 97 | + avoidCallsTo.set(listOf( |
| 98 | + "java.util.logging", |
| 99 | + "org.apache.log4j", |
| 100 | + "org.slf4j", |
| 101 | + "org.apache.commons.logging", |
| 102 | + "com.google.common.io.Closeables", |
| 103 | + )) |
| 104 | +} |
0 commit comments