plugin: Support S3 repositories

This commit is contained in:
Tad Fisher
2021-02-02 16:43:35 -08:00
parent 55b3b60535
commit 80b8a7d52e
28 changed files with 1475 additions and 3842 deletions

View File

@@ -0,0 +1,5 @@
# DO NOT MODIFY: Generated by Stutter plugin.
5.0
5.6.4
6.0.1
6.8.1

View File

@@ -4,5 +4,4 @@
5.0
5.6.4
6.0.1
6.7.1
6.8-milestone-3
6.8.1

View File

@@ -11,10 +11,8 @@ plugins {
}
sourceSets {
compatTest {
resources {
srcDir("$rootDir/fixtures")
}
test {
java.srcDir("src/test/kotlin")
}
}
@@ -29,32 +27,26 @@ configurations {
}
dependencies {
compileOnly("org.gradle:gradle-tooling-api:${gradle.gradleVersion}")
implementation("org.apache.maven:maven-repository-metadata:latest.release")
implementation(project(":ivy"))
implementation(project(":model"))
shadow(gradleApi())
compileOnly("org.gradle:gradle-tooling-api:${gradle.gradleVersion}")
implementation("org.apache.ivy:ivy:latest.release")
implementation("org.apache.maven:maven-repository-metadata:latest.release")
compatTestImplementation("com.adobe.testing:s3mock-junit5:latest.release")
compatTestImplementation("com.squareup.okio:okio:latest.release")
compatTestImplementation("dev.minutest:minutest:latest.release")
compatTestImplementation("io.javalin:javalin:latest.release")
compatTestImplementation("io.strikt:strikt-core:latest.release")
compatTestImplementation("org.junit.jupiter:junit-jupiter-api:latest.release")
compatTestImplementation("org.junit.jupiter:junit-jupiter-params:latest.release")
compatTestImplementation(embeddedKotlin("reflect"))
compatTestImplementation(embeddedKotlin("stdlib-jdk8"))
compatTestImplementation(embeddedKotlin("test-junit5"))
compatTestImplementation(embeddedKotlin("reflect"))
compatTestImplementation("org.junit.jupiter:junit-jupiter-api:latest.release")
compatTestRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:latest.release")
compatTestImplementation("org.junit.jupiter:junit-jupiter-params:latest.release")
compatTestRuntimeOnly("org.junit.platform:junit-platform-launcher:latest.release")
compatTestImplementation("dev.minutest:minutest:latest.release")
compatTestImplementation(gradleTestKit())
compatTestImplementation(project(":model"))
compatTestImplementation("io.strikt:strikt-core:latest.release")
compatTestImplementation("com.squareup.okio:okio:latest.release")
compatTestImplementation("io.javalin:javalin:latest.release")
testImplementation("io.findify:s3mock_2.12:latest.release")
testImplementation("io.strikt:strikt-core:latest.release")
testImplementation("org.junit.jupiter:junit-jupiter-api:latest.release")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:latest.release")
testImplementation("org.junit.jupiter:junit-jupiter-params:latest.release")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:latest.release")
compatTestRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:latest.release")
compatTestRuntimeOnly("org.junit.platform:junit-platform-launcher:latest.release")
}
gradlePlugin {
@@ -92,10 +84,11 @@ tasks {
includeEngines("junit-jupiter")
}
afterTest(KotlinClosure2<TestDescriptor, TestResult, Any>({ descriptor, result ->
// work around a bug in Gradle versions before 6.1, see https://github.com/junit-team/junit5/issues/2041
val test = descriptor as org.gradle.api.internal.tasks.testing.TestDescriptorInternal
println("[${test.classDisplayName}] > [${test.displayName}]: ${result.resultType}")
}))
// Default logging config exposes a classpath conflict between
// the Gradle API and SFL4J.
// (Sprint Boot is used in S3Mock)
systemProperty("org.springframework.boot.logging.LoggingSystem", "org.springframework.boot.logging.java.JavaLoggingSystem")
systemProperty("fixtures", "$rootDir/fixtures")
}
}

View File

@@ -1,113 +1,170 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.amazonaws:aws-java-sdk-core:1.11.294=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.amazonaws:aws-java-sdk-kms:1.11.294=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.amazonaws:aws-java-sdk-s3:1.11.294=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.amazonaws:jmespath-java:1.11.294=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.christophsturm:filepeek:0.1.2=compatTestRuntimeClasspath,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-annotations:2.6.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-core:2.6.7=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-databind:2.6.7.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.7=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.github.pathikrit:better-files_2.12:3.9.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.google.guava:guava:21.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
ch.qos.logback:logback-classic:1.2.3=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
ch.qos.logback:logback-core:1.2.3=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.adobe.testing:s3mock-junit5:2.1.28=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.adobe.testing:s3mock-testsupport-common:2.1.28=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.adobe.testing:s3mock:2.1.28=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.amazonaws:aws-java-sdk-core:1.11.488=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.amazonaws:aws-java-sdk-core:1.11.946=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.amazonaws:aws-java-sdk-kms:1.11.488=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.amazonaws:aws-java-sdk-kms:1.11.946=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.amazonaws:aws-java-sdk-s3:1.11.488=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.amazonaws:aws-java-sdk-s3:1.11.946=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.amazonaws:jmespath-java:1.11.488=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.amazonaws:jmespath-java:1.11.946=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.christophsturm:filepeek:0.1.2=compatTestRuntimeClasspath
com.fasterxml.jackson.core:jackson-annotations:2.6.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-annotations:2.9.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.fasterxml.jackson.core:jackson-core:2.6.7=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-core:2.9.9=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.fasterxml.jackson.core:jackson-databind:2.6.7.4=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-databind:2.9.9.3=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.7=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.9=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.9=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.9=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.9.9=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.9=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.fasterxml.woodstox:woodstox-core:5.1.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.fasterxml:classmate:1.3.4=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.squareup.moshi:moshi:1.11.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.squareup.okio:okio-metadata:3.0.0-alpha.1=compatTestImplementationDependenciesMetadata
com.squareup.okio:okio:1.17.5=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.squareup.okio:okio:3.0.0-alpha.1=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
com.typesafe.akka:akka-actor_2.12:2.5.31=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.typesafe.akka:akka-http-core_2.12:10.1.12=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.typesafe.akka:akka-http_2.12:10.1.12=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.typesafe.akka:akka-parsing_2.12:10.1.12=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.typesafe.akka:akka-protobuf_2.12:2.5.31=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.typesafe.akka:akka-stream_2.12:2.5.31=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.typesafe.scala-logging:scala-logging_2.12:3.9.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.typesafe:config:1.3.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.typesafe:ssl-config-core_2.12:0.3.8=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
commons-codec:commons-codec:1.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
commons-logging:commons-logging:1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.typesafe.netty:netty-reactive-streams-http:2.0.0=compatTestRuntimeClasspath
com.typesafe.netty:netty-reactive-streams:2.0.0=compatTestRuntimeClasspath
commons-codec:commons-codec:1.11=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
commons-io:commons-io:2.6=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
commons-logging:commons-logging:1.2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
dev.minutest:minutest:2.0.0-alpha=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
io.findify:s3mock_2.12:0.2.6=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
io.github.classgraph:classgraph:4.8.28=compatTestRuntimeClasspath
io.javalin:javalin:3.13.3=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
io.strikt:strikt-core:0.28.2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
javax.activation:javax.activation-api:1.2.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
io.netty:netty-buffer:4.1.33.Final=compatTestRuntimeClasspath
io.netty:netty-codec-http2:4.1.33.Final=compatTestRuntimeClasspath
io.netty:netty-codec-http:4.1.33.Final=compatTestRuntimeClasspath
io.netty:netty-codec:4.1.33.Final=compatTestRuntimeClasspath
io.netty:netty-common:4.1.33.Final=compatTestRuntimeClasspath
io.netty:netty-handler:4.1.33.Final=compatTestRuntimeClasspath
io.netty:netty-resolver:4.1.33.Final=compatTestRuntimeClasspath
io.netty:netty-transport-native-epoll:4.1.33.Final=compatTestRuntimeClasspath
io.netty:netty-transport-native-unix-common:4.1.33.Final=compatTestRuntimeClasspath
io.netty:netty-transport:4.1.33.Final=compatTestRuntimeClasspath
io.strikt:strikt-core:0.28.2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
javax.annotation:javax.annotation-api:1.3.2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
javax.servlet:javax.servlet-api:3.1.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
javax.xml.bind:jaxb-api:2.3.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
joda-time:joda-time:2.8.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
javax.validation:validation-api:2.0.1.Final=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
joda-time:joda-time:2.8.1=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
net.swiftzer.semver:semver:1.1.1=compatTestRuntimeClasspath,default,runtimeClasspath,testRuntimeClasspath
org.apache.httpcomponents:httpclient:4.5.5=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.apache.httpcomponents:httpcore:4.4.9=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.apache.commons:commons-lang3:3.8.1=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.apache.httpcomponents:httpclient:4.5.13=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.apache.httpcomponents:httpclient:4.5.5=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata
org.apache.httpcomponents:httpclient:4.5.9=compatTestRuntimeClasspath
org.apache.httpcomponents:httpcore:4.4.11=compatTestRuntimeClasspath
org.apache.httpcomponents:httpcore:4.4.13=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.apache.httpcomponents:httpcore:4.4.9=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata
org.apache.ivy:ivy:2.5.0=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.apache.logging.log4j:log4j-api:2.11.2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.apache.logging.log4j:log4j-to-slf4j:2.11.2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.apache.maven:maven-repository-metadata:3.6.3=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.apiguardian:apiguardian-api:1.1.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
org.apiguardian:apiguardian-api:1.1.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.codehaus.plexus:plexus-utils:3.2.1=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.codehaus.woodstox:stax2-api:4.1=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty.websocket:websocket-api:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty.websocket:websocket-client:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty.websocket:websocket-common:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty.websocket:websocket-server:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty.websocket:websocket-servlet:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-client:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-continuation:9.4.19.v20190610=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-http:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-io:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-security:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-server:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-servlet:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-servlets:9.4.19.v20190610=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-util-ajax:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-util:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-webapp:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-xml:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.gradle:gradle-tooling-api:6.8.1=compileClasspath,compileOnly,compileOnlyDependenciesMetadata
org.iq80.leveldb:leveldb-api:0.12=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.iq80.leveldb:leveldb:0.12=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.hibernate.validator:hibernate-validator:6.0.17.Final=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.jboss.logging:jboss-logging:3.3.2.Final=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.jetbrains.intellij.deps:trove4j:1.0.20181211=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.20=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.4.20=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.4.20=kotlinCompilerPluginClasspath
org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.4.20=kotlinCompilerPluginClasspath
org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:1.4.20=kotlinKlibCommonizerClasspath
org.jetbrains.kotlin:kotlin-reflect:1.4.20=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata
org.jetbrains.kotlin:kotlin-reflect:1.4.21-2=compatTestRuntimeClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-reflect:1.4.20=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-reflect:1.4.21-2=compatTestRuntimeClasspath
org.jetbrains.kotlin:kotlin-sam-with-receiver:1.4.20=kotlinCompilerPluginClasspath
org.jetbrains.kotlin:kotlin-script-runtime:1.4.20=kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath
org.jetbrains.kotlin:kotlin-scripting-common:1.4.20=kotlinCompilerPluginClasspath
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.4.20=kotlinCompilerPluginClasspath
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.4.20=kotlinCompilerPluginClasspath
org.jetbrains.kotlin:kotlin-scripting-jvm:1.4.20=kotlinCompilerPluginClasspath
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20=compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.21-2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.20=compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.21-2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.20=compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21-2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib:1.4.20=compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath
org.jetbrains.kotlin:kotlin-stdlib:1.4.21-2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20=compileClasspath,compileOnly,compileOnlyDependenciesMetadata,default,embeddedKotlin,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.21-2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.20=compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.21-2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.20=compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21-2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib:1.4.20=compileClasspath,compileOnly,compileOnlyDependenciesMetadata,default,embeddedKotlin,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib:1.4.21-2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.jetbrains.kotlin:kotlin-test-annotations-common:1.4.20=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.jetbrains.kotlin:kotlin-test-common:1.4.20=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.jetbrains.kotlin:kotlin-test-junit5:1.4.20=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.jetbrains.kotlin:kotlin-test:1.4.20=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.2=compatTestRuntimeClasspath,testRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.2=compatTestRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7=kotlinCompilerPluginClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2=compatTestRuntimeClasspath,testRuntimeClasspath
org.jetbrains:annotations:13.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.junit.jupiter:junit-jupiter-api:5.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
org.junit.jupiter:junit-jupiter-engine:5.7.0=compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
org.junit.jupiter:junit-jupiter-params:5.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.junit.platform:junit-platform-commons:1.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
org.junit.platform:junit-platform-engine:1.7.0=compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
org.junit.platform:junit-platform-launcher:1.7.0=compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
org.junit:junit-bom:5.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
org.opentest4j:opentest4j:1.2.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath,testRuntimeOnlyDependenciesMetadata
org.reactivestreams:reactive-streams:1.0.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.scala-lang.modules:scala-collection-compat_2.12:2.1.6=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.scala-lang.modules:scala-java8-compat_2.12:0.8.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.scala-lang.modules:scala-parser-combinators_2.12:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.scala-lang.modules:scala-xml_2.12:1.3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.scala-lang:scala-library:2.12.11=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.scala-lang:scala-reflect:2.12.7=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.slf4j:slf4j-api:1.7.25=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2=compatTestRuntimeClasspath
org.jetbrains:annotations:13.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,default,embeddedKotlin,implementationDependenciesMetadata,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.junit.jupiter:junit-jupiter-api:5.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.junit.jupiter:junit-jupiter-engine:5.7.0=compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.junit.jupiter:junit-jupiter-params:5.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.junit.platform:junit-platform-commons:1.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.junit.platform:junit-platform-engine:1.7.0=compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.junit.platform:junit-platform-launcher:1.7.0=compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.junit:junit-bom:5.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.mortbay.jasper:apache-el:8.5.40=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.opentest4j:opentest4j:1.2.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.reactivestreams:reactive-streams:1.0.2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.slf4j:jul-to-slf4j:1.7.28=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.slf4j:slf4j-api:1.7.28=compileClasspath,compileOnly,compileOnlyDependenciesMetadata
org.slf4j:slf4j-api:1.7.30=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.ion:ion-java:1.0.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
empty=annotationProcessor,apiDependenciesMetadata,archives,compatTestAnnotationProcessor,compatTestApiDependenciesMetadata,compatTestCompile,compatTestCompileOnly,compatTestCompileOnlyDependenciesMetadata,compatTestKotlinScriptDef,compatTestKotlinScriptDefExtensions,compatTestRuntime,compile,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,shadow,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime
org.springframework.boot:spring-boot-autoconfigure:2.1.9.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.springframework.boot:spring-boot-starter-jetty:2.1.9.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.springframework.boot:spring-boot-starter-json:2.1.9.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.springframework.boot:spring-boot-starter-logging:2.1.9.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.springframework.boot:spring-boot-starter-web:2.1.9.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.springframework.boot:spring-boot-starter:2.1.9.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.springframework.boot:spring-boot:2.1.9.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.springframework:spring-aop:5.1.10.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.springframework:spring-beans:5.1.10.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.springframework:spring-context:5.1.10.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.springframework:spring-core:5.1.10.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.springframework:spring-expression:5.1.10.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.springframework:spring-jcl:5.1.10.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.springframework:spring-web:5.1.10.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.springframework:spring-webmvc:5.1.10.RELEASE=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.yaml:snakeyaml:1.23=compatTestRuntimeClasspath
software.amazon.awssdk:annotations:2.7.19=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.awssdk:apache-client:2.7.19=compatTestRuntimeClasspath
software.amazon.awssdk:auth:2.7.19=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.awssdk:aws-core:2.7.19=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.awssdk:aws-query-protocol:2.7.19=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.awssdk:aws-xml-protocol:2.7.19=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.awssdk:http-client-spi:2.7.19=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.awssdk:netty-nio-client:2.7.19=compatTestRuntimeClasspath
software.amazon.awssdk:profiles:2.7.19=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.awssdk:protocol-core:2.7.19=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.awssdk:regions:2.7.19=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.awssdk:s3:2.7.19=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.awssdk:sdk-core:2.7.19=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.awssdk:url-connection-client:2.7.19=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.awssdk:utils:2.7.19=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.eventstream:eventstream:1.0.1=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
software.amazon.ion:ion-java:1.0.2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
empty=annotationProcessor,apiDependenciesMetadata,archives,compatTestAnnotationProcessor,compatTestApiDependenciesMetadata,compatTestCompile,compatTestCompileOnly,compatTestCompileOnlyDependenciesMetadata,compatTestKotlinScriptDef,compatTestKotlinScriptDefExtensions,compatTestRuntime,compile,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,shadow,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime,testRuntimeOnlyDependenciesMetadata

View File

@@ -0,0 +1,52 @@
package org.nixos.gradle2nix
import dev.minutest.Tests
import dev.minutest.junit.JUnit5Minutests
import dev.minutest.rootContext
import dev.minutest.test
import strikt.api.expectThat
import strikt.assertions.containsExactly
import strikt.assertions.flatMap
import strikt.assertions.map
class S3Test : JUnit5Minutests {
@Tests
fun tests() = rootContext("s3 tests") {
withBucket("repositories") {
withFixture("s3/maven") {
test("dependency from s3 maven repo") {
expectThat(build()) {
get("root project dependencies") { rootProject.projectDependencies }.and {
ids.containsExactly(
"org.apache:test:1.0.0@jar",
"org.apache:test:1.0.0@pom"
)
flatMap { it.urls }.containsExactly(
"s3://repositories/m2/org/apache/test/1.0.0/test-1.0.0.jar",
"s3://repositories/m2/org/apache/test/1.0.0/test-1.0.0.pom"
)
}
}
}
}
withFixture("s3/maven-snapshot") {
test("snapshot dependency from s3 maven repo") {
expectThat(build()) {
get("root project dependencies") { rootProject.projectDependencies }.and {
ids.containsExactly(
"org.apache:test-SNAPSHOT1:2.0.0-SNAPSHOT@jar",
"org.apache:test-SNAPSHOT1:2.0.0-SNAPSHOT@pom"
)
flatMap { it.urls }.containsExactly(
"s3://repositories/m2/org/apache/test-SNAPSHOT1/2.0.0-SNAPSHOT/test-SNAPSHOT1-2.0.0-20070310.181613-3.jar",
"s3://repositories/m2/org/apache/test-SNAPSHOT1/2.0.0-SNAPSHOT/test-SNAPSHOT1-2.0.0-20070310.181613-3.pom"
)
}
}
}
}
}
}
}

View File

@@ -1,5 +1,8 @@
package org.nixos.gradle2nix
import com.adobe.testing.s3mock.S3MockApplication
import com.adobe.testing.s3mock.junit5.S3MockExtension
import com.adobe.testing.s3mock.testsupport.common.S3MockStarter
import com.squareup.moshi.Moshi
import dev.minutest.ContextBuilder
import dev.minutest.MinutestFixture
@@ -13,6 +16,7 @@ import dev.minutest.given
import dev.minutest.givenClosable
import dev.minutest.given_
import io.javalin.Javalin
import io.javalin.http.staticfiles.Location
import okio.buffer
import okio.source
import org.gradle.internal.classpath.DefaultClassPath
@@ -25,10 +29,12 @@ import strikt.assertions.map
import java.io.Closeable
import java.io.File
import java.io.StringWriter
import java.nio.file.Paths
import java.util.concurrent.atomic.AtomicBoolean
private val moshi = Moshi.Builder().build()
val fixtureRoot = File(System.getProperty("fixtures"))
val gradleVersion = System.getProperty("compat.gradle.version")
?.let(GradleVersion::version)
?: GradleVersion.current()
@@ -69,7 +75,8 @@ fun File.buildKotlin(
private fun File.build(
configurations: List<String>,
subprojects: List<String>
subprojects: List<String>,
extraArguments: List<String> = emptyList()
): DefaultBuild {
val log = StringWriter()
@@ -83,7 +90,8 @@ private fun File.build(
"--init-script=${initscript()}",
"--stacktrace",
"-Porg.nixos.gradle2nix.configurations=${configurations.joinToString(",")}",
"-Porg.nixos.gradle2nix.subprojects=${subprojects.joinToString(",")}"
"-Porg.nixos.gradle2nix.subprojects=${subprojects.joinToString(",")}",
*(extraArguments.toTypedArray())
)
.runCatching { build() }
@@ -107,15 +115,64 @@ val <T : Iterable<Artifact>> Assertion.Builder<T>.ids: Assertion.Builder<Iterabl
private fun File.parents() = generateSequence(parentFile) { it.parentFile }
abstract class ArgumentsSupplier(private val parent: ArgumentsSupplier? = null) {
open val arguments: List<String> = emptyList()
val extraArguments: List<String> get() = (parent?.extraArguments ?: emptyList()) + arguments
}
@MinutestFixture
class RepositoryFixture(private val server: Javalin) : Closeable {
class RepositoryFixture(
private val server: Javalin,
parent: ArgumentsSupplier? = null
) : ArgumentsSupplier(parent), Closeable {
override fun close() {
server.stop()
}
}
@MinutestFixture
class TestFixture(val name: String, val source: File) : Closeable {
class S3Fixture(
private val name: String,
parent: ArgumentsSupplier? = null
) : ArgumentsSupplier(parent), Closeable {
private val s3mock = S3Mock(
initialBuckets = listOf(name),
secureConnection = false
)
override val arguments: List<String> get() = listOf(
"-Dorg.gradle.s3.endpoint=${s3mock.serviceEndpoint}",
"-Dorg.nixos.gradle2nix.s3test=true"
)
init {
s3mock.startServer()
val s3root = fixtureRoot.resolve(name)
val s3client = s3mock.createS3Client()
require(s3root.exists() && s3root.isDirectory) {
"$name: S3 fixture not found: $s3root"
}
s3root.walkTopDown()
.filter { it.isFile }
.forEach { file ->
val key = file.toRelativeString(s3root)
s3client.putObject(name, key, file)
}
}
override fun close() {
s3mock.stopServer()
}
}
@MinutestFixture
class TestFixture(
val name: String,
val source: File,
parent: ArgumentsSupplier? = null
) : ArgumentsSupplier(parent), Closeable {
val dest: File
init {
@@ -131,7 +188,10 @@ class TestFixture(val name: String, val source: File) : Closeable {
}
@MinutestFixture
class ProjectFixture(private val parent: TestFixture, private val source: File) : Closeable {
data class ProjectFixture(
private val parent: TestFixture,
private val source: File
) : Closeable {
private val dest: File
init {
@@ -142,30 +202,48 @@ class ProjectFixture(private val parent: TestFixture, private val source: File)
dest = parent.dest.resolve(rel)
}
fun copy() {
fun copySource() {
source.copyRecursively(dest, true)
}
fun build(
configurations: List<String> = emptyList(),
subprojects: List<String> = emptyList()
) = dest.build(configurations, subprojects)
) = dest.build(configurations, subprojects, parent.extraArguments)
override fun close() {
dest.deleteRecursively()
}
}
fun ContextBuilder<*>.withBucket(
name: String,
block: TestContextBuilder<*, S3Fixture>.() -> Unit
) = derivedContext<S3Fixture>("with s3 bucket: $name") {
given_ { parent ->
S3Fixture(name, parent as? ArgumentsSupplier)
}
afterEach { it.close() }
block()
}
fun ContextBuilder<*>.withRepository(
name: String,
block: TestContextBuilder<*, RepositoryFixture>.() -> Unit
) = derivedContext<RepositoryFixture>("with repository: $name") {
givenClosable {
RepositoryFixture(Javalin.create { config ->
config.addStaticFiles("/repositories/$name")
}.start(9999))
given_ { parent ->
RepositoryFixture(
server = Javalin.create { config ->
config.addStaticFiles("${fixtureRoot}/repositories/$name", Location.EXTERNAL)
}.start(9999),
parent = parent as? ArgumentsSupplier
)
}
afterEach { it.close() }
block()
}
@@ -173,24 +251,50 @@ fun ContextBuilder<*>.withFixture(
name: String,
block: TestContextBuilder<*, ProjectFixture>.() -> Unit
) = derivedContext<TestFixture>(name) {
val url = checkNotNull(Thread.currentThread().contextClassLoader.getResource(name)?.toURI()) {
"$name: No test fixture found"
val projectRoot = fixtureRoot.resolve(name).also {
check(it.exists()) { "$name: project fixture not found: $it" }
}
val fixtureRoot = Paths.get(url).toFile().absoluteFile
given { TestFixture(name, fixtureRoot) }
given_ { parent ->
TestFixture(name, projectRoot, parent as? ArgumentsSupplier)
}
val testRoots = fixtureRoot.listFiles()!!
val testRoots = projectRoot.listFiles()!!
.filter { it.isDirectory }
.map { it.absoluteFile }
.toList()
testRoots.forEach { testRoot ->
derivedContext<ProjectFixture>(testRoot.name) {
given_ { ProjectFixture(it, testRoot) }
beforeEach { copy() }
given_ { parent -> ProjectFixture(parent, testRoot) }
beforeEach { copySource() }
afterEach { close() }
block()
}
}
}
class S3Mock(
initialBuckets: List<String> = emptyList(),
secureConnection: Boolean = true
) : S3MockStarter(
mapOf(
S3MockApplication.PROP_INITIAL_BUCKETS to initialBuckets.joinToString(","),
S3MockApplication.PROP_SECURE_CONNECTION to secureConnection
)
) {
private val running = AtomicBoolean()
fun startServer() {
if (running.compareAndSet(false, true)) {
start()
}
}
fun stopServer() {
if (running.compareAndSet(true, false)) {
stop()
}
}
}

View File

@@ -1,6 +1,7 @@
package org.nixos.gradle2nix
import dev.minutest.Tests
import dev.minutest.given
import dev.minutest.junit.JUnit5Minutests
import dev.minutest.rootContext
import dev.minutest.test
@@ -11,7 +12,7 @@ import java.io.File
class WrapperTest : JUnit5Minutests {
@Tests
fun tests() = rootContext<File>("wrapper tests") {
fixture { createTempDir("gradle2nix") }
given { createTempDir("gradle2nix") }
test("resolves gradle wrapper version") {
expectThat(buildKotlin("""

View File

@@ -62,7 +62,7 @@ internal class ConfigurationResolver(
private val resolvers: List<RepositoryResolver>,
private val dependencies: DependencyHandler
) {
private val failed = mutableListOf<ArtifactIdentifier>()
private val failed = mutableSetOf<ArtifactIdentifier>()
private val ivy = Ivy.newInstance(ivySettings)
val unresolved: List<ArtifactIdentifier> = failed.toList()

View File

@@ -1,5 +1,7 @@
package org.nixos.gradle2nix
import com.amazonaws.auth.BasicAWSCredentials
import com.amazonaws.auth.BasicSessionCredentials
import org.apache.ivy.core.LogOptions
import org.apache.ivy.core.cache.ArtifactOrigin
import org.apache.ivy.core.cache.CacheResourceOptions
@@ -11,6 +13,7 @@ import org.apache.ivy.core.resolve.DownloadOptions
import org.apache.ivy.core.settings.IvySettings
import org.apache.ivy.core.settings.TimeoutConstraint
import org.apache.ivy.plugins.repository.Repository
import org.apache.ivy.plugins.repository.Resource
import org.apache.ivy.plugins.repository.url.URLRepository
import org.apache.ivy.plugins.repository.url.URLResource
import org.apache.ivy.plugins.resolver.AbstractResolver
@@ -33,6 +36,7 @@ import org.gradle.api.logging.Logger
import org.gradle.api.logging.Logging
import org.gradle.authentication.aws.AwsImAuthentication
import org.gradle.internal.authentication.AllSchemesAuthentication
import org.gradle.kotlin.dsl.getCredentials
import java.io.IOException
import java.net.URI
import org.apache.ivy.core.module.descriptor.Artifact as IvyArtifact
@@ -82,8 +86,18 @@ internal class MavenResolver(
override fun resolve(artifactId: DefaultArtifactIdentifier, sha256: String?): DefaultArtifact? {
val ivyArtifact: IvyArtifact = artifactId.toArtifact()
val origin = ivyResolver.locate(ivyArtifact)?.takeIf(ArtifactOrigin::isExists) ?: return null
val hash = sha256 ?: ivyResolver.download(origin, downloadOptions).localFile?.sha256() ?: return null
val origin = ivyResolver.locate(ivyArtifact)
if (origin == null || !origin.isExists) return null
val hash = if (sha256 != null) sha256 else {
val report = ivyResolver.download(origin, downloadOptions)
report.localFile?.sha256().also {
if (it == null) log.error(report.toString())
}
}
if (hash == null) {
log.error("Failed to download '$artifactId' from repository '${ivyResolver.repository.name}'")
return null
}
val snapshotVersion: SnapshotVersion? = artifactId.version.snapshotVersion()?.let {
findSnapshotVersion(artifactId, it)
}
@@ -103,9 +117,9 @@ internal class MavenResolver(
snapshotVersion: SnapshotVersion
): SnapshotVersion {
if (snapshotVersion.timestamp != null) return snapshotVersion
val metadataLocation = "${ivyResolver.root}${artifactId.repoPath()}/maven-metadata.xml".toUrl()
val metadataLocation = "${ivyResolver.root}${artifactId.repoPath()}/maven-metadata.xml"
val metadataFile = ivyResolver.repositoryCacheManager.downloadRepositoryResource(
URLResource(metadataLocation, ivyResolver.timeoutConstraint),
ivyResolver.repository.getResource(metadataLocation),
"maven-metadata",
"maven-metadata",
"xml",
@@ -160,7 +174,16 @@ internal class IvyResolver(
override fun resolve(artifactId: DefaultArtifactIdentifier, sha256: String?): DefaultArtifact? {
val ivyArtifact: IvyArtifact = artifactId.toArtifact()
val origin = ivyResolver.locate(ivyArtifact)?.takeIf(ArtifactOrigin::isExists) ?: return null
val hash = sha256 ?: ivyResolver.download(origin, downloadOptions).localFile?.sha256() ?: return null
val hash = if (sha256 != null) sha256 else {
val report = ivyResolver.download(origin, downloadOptions)
report.localFile?.sha256().also {
if (it == null) log.error(report.toString())
}
}
if (hash == null) {
log.error("Failed to download '$artifactId' from repository '${ivyResolver.repository.name}'")
return null
}
return DefaultArtifact(
id = DefaultArtifactIdentifier(artifactId),
name = artifactId.filename(null),
@@ -180,7 +203,9 @@ private fun cacheManager(
return DefaultRepositoryCacheManager(
"${scope.name.toLowerCase()}-${repository.name}-cache",
ivySettings,
project.buildDir.resolve("tmp/gradle2nix/${scope.name.toLowerCase()}/${repository.name}")
project.buildDir.resolve("tmp/gradle2nix/${repository.name}").also {
it.mkdirs()
}
).also {
ivySettings.addRepositoryCacheManager(it)
}
@@ -236,31 +261,42 @@ private fun ArtifactIdentifier.filename(
append(".", extension)
}
private val downloadOptions = DownloadOptions().apply { log = LogOptions.LOG_QUIET }
private val downloadOptions = DownloadOptions().apply {
log = LogOptions.LOG_DEFAULT
}
private fun <T> AbstractResolver.resolverRepository(
repository: T
) : Repository
where T : UrlArtifactRepository,
where T : ArtifactRepository,
T : AuthenticationSupported =
when (val scheme = repository.url.scheme) {
"s3" -> s3Repository(repository.authentication, LazyTimeoutConstraint(this))
"s3" -> s3Repository(
repository.getCredentials(AwsCredentials::class),
LazyTimeoutConstraint(this)
)
"http", "https" -> URLRepository(LazyTimeoutConstraint(this))
else -> throw IllegalStateException("Unknown repository URL scheme: $scheme")
}
private fun s3Repository(
authContainer: AuthenticationContainer,
credentials: AwsCredentials?,
timeoutConstraint: TimeoutConstraint
): Repository {
val auth = authContainer.firstOrNull { auth ->
auth is AllSchemesAuthentication || auth is AwsImAuthentication
val awsCredentials = credentials?.let {
if (it.sessionToken == null) {
BasicAWSCredentials(it.accessKey, it.secretKey)
} else {
BasicSessionCredentials(it.accessKey, it.secretKey, it.sessionToken)
}
}
checkNotNull(auth) { "S3 resource should either specify AwsImAuthentication or provide some AwsCredentials." }
return S3Repository(
credentials = (auth as? AllSchemesAuthentication)?.credentials as? AwsCredentials,
endpoint = System.getProperty("org.gradle.s3.endpoint")?.let { URI(it) }
)
credentials = awsCredentials,
endpoint = System.getProperty("org.gradle.s3.endpoint")?.let { URI(it) },
timeoutConstraint = timeoutConstraint
).apply {
name = "AWS S3"
}
}
private class LazyTimeoutConstraint(
@@ -272,3 +308,10 @@ private class LazyTimeoutConstraint(
override fun getReadTimeout(): Int =
resolver.timeoutConstraint?.readTimeout ?: -1
}
// Compatibility shim as UrlArtifactRepository was added in Gradle 6.0
private val ArtifactRepository.url: URI get() = when (this) {
is MavenArtifactRepository -> url
is IvyArtifactRepository -> url
else -> throw IllegalStateException("Unhandled repository type: ${this::class.simpleName}")
}

View File

@@ -1,6 +1,7 @@
package org.nixos.gradle2nix
import java.io.File
import java.net.URI
import java.net.URL
import java.security.MessageDigest
@@ -19,3 +20,5 @@ private fun ByteArray.sha256() = buildString {
}
internal fun String.toUrl(): URL = URL(this)
internal fun String.toUri(): URI = URI(this)