mirror of
https://github.com/tadfisher/gradle2nix.git
synced 2026-01-11 23:40:37 -05:00
Merge pull request #35 from tadfisher/s3
Support repositories hosted in AWS S3
This commit is contained in:
@@ -4,12 +4,10 @@ plugins {
|
|||||||
kotlin("jvm")
|
kotlin("jvm")
|
||||||
kotlin("kapt")
|
kotlin("kapt")
|
||||||
application
|
application
|
||||||
idea
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(project(":model"))
|
implementation(project(":model"))
|
||||||
implementation(kotlin("stdlib-jdk8"))
|
|
||||||
implementation(kotlin("reflect"))
|
implementation(kotlin("reflect"))
|
||||||
implementation("org.gradle:gradle-tooling-api:${gradle.gradleVersion}")
|
implementation("org.gradle:gradle-tooling-api:${gradle.gradleVersion}")
|
||||||
implementation("com.github.ajalt:clikt:latest.release")
|
implementation("com.github.ajalt:clikt:latest.release")
|
||||||
@@ -31,7 +29,7 @@ application {
|
|||||||
applicationName = "gradle2nix"
|
applicationName = "gradle2nix"
|
||||||
applicationDefaultJvmArgs += "-Dorg.nixos.gradle2nix.share=@APP_HOME@/share"
|
applicationDefaultJvmArgs += "-Dorg.nixos.gradle2nix.share=@APP_HOME@/share"
|
||||||
applicationDistribution
|
applicationDistribution
|
||||||
.from(tasks.getByPath(":plugin:shadowJar"))
|
.from(tasks.getByPath(":plugin:shadowJar"), "$rootDir/gradle-env.nix")
|
||||||
.into("share")
|
.into("share")
|
||||||
.rename("plugin.*\\.jar", "plugin.jar")
|
.rename("plugin.*\\.jar", "plugin.jar")
|
||||||
}
|
}
|
||||||
@@ -75,12 +73,7 @@ tasks {
|
|||||||
withType<KotlinCompile> {
|
withType<KotlinCompile> {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = "1.8"
|
jvmTarget = "1.8"
|
||||||
}
|
freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn")
|
||||||
}
|
|
||||||
|
|
||||||
idea {
|
|
||||||
module {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,17 +6,22 @@ com.github.ajalt:clikt:2.8.0=compileClasspath,runtimeClasspath,testCompileClassp
|
|||||||
com.squareup.moshi:moshi-adapters:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
com.squareup.moshi:moshi-adapters:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
com.squareup.moshi:moshi-kotlin:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
com.squareup.moshi:moshi-kotlin:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
com.squareup.okio:okio:2.9.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
com.squareup.okio:okio:3.0.0-alpha.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
io.github.classgraph:classgraph:4.8.37=testRuntimeClasspath
|
io.github.classgraph:classgraph:4.8.37=testRuntimeClasspath
|
||||||
io.strikt:strikt-core:0.28.1=testCompileClasspath,testRuntimeClasspath
|
io.strikt:strikt-core:0.28.2=testCompileClasspath,testRuntimeClasspath
|
||||||
net.swiftzer.semver:semver:1.1.1=runtimeClasspath,testRuntimeClasspath
|
net.swiftzer.semver:semver:1.1.1=runtimeClasspath,testRuntimeClasspath
|
||||||
org.apiguardian:apiguardian-api:1.1.0=testRuntimeClasspath
|
org.apiguardian:apiguardian-api:1.1.0=testRuntimeClasspath
|
||||||
org.gradle:gradle-tooling-api:6.8-rc-1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
org.gradle:gradle-tooling-api:6.8.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
org.jetbrains.kotlin:kotlin-reflect:1.4.20=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
org.jetbrains.kotlin:kotlin-reflect:1.4.20=compileClasspath,runtimeClasspath,testCompileClasspath
|
||||||
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
org.jetbrains.kotlin:kotlin-reflect:1.4.21-2=testRuntimeClasspath
|
||||||
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.20=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20=compileClasspath,runtimeClasspath
|
||||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.20=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.21-2=testCompileClasspath,testRuntimeClasspath
|
||||||
org.jetbrains.kotlin:kotlin-stdlib:1.4.20=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.20=compileClasspath,runtimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.21-2=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.20=compileClasspath,runtimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21-2=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib:1.4.20=compileClasspath,runtimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib:1.4.21-2=testCompileClasspath,testRuntimeClasspath
|
||||||
org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.3=testRuntimeClasspath
|
org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.3=testRuntimeClasspath
|
||||||
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.2=testRuntimeClasspath
|
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.2=testRuntimeClasspath
|
||||||
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2=testRuntimeClasspath
|
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2=testRuntimeClasspath
|
||||||
@@ -27,7 +32,7 @@ org.junit:junit-bom:5.6.0=testRuntimeClasspath
|
|||||||
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testRuntimeClasspath
|
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testRuntimeClasspath
|
||||||
org.slf4j:slf4j-api:2.0.0-alpha1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
org.slf4j:slf4j-api:2.0.0-alpha1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
org.slf4j:slf4j-simple:2.0.0-alpha1=runtimeClasspath,testRuntimeClasspath
|
org.slf4j:slf4j-simple:2.0.0-alpha1=runtimeClasspath,testRuntimeClasspath
|
||||||
org.spekframework.spek2:spek-dsl-jvm:2.0.14=testCompileClasspath,testRuntimeClasspath
|
org.spekframework.spek2:spek-dsl-jvm:2.0.15=testCompileClasspath,testRuntimeClasspath
|
||||||
org.spekframework.spek2:spek-runner-junit5:2.0.14=testRuntimeClasspath
|
org.spekframework.spek2:spek-runner-junit5:2.0.15=testRuntimeClasspath
|
||||||
org.spekframework.spek2:spek-runtime-jvm:2.0.14=testRuntimeClasspath
|
org.spekframework.spek2:spek-runtime-jvm:2.0.15=testRuntimeClasspath
|
||||||
empty=
|
empty=
|
||||||
|
|||||||
331
app/src/dist/share/gradle-env.nix
vendored
331
app/src/dist/share/gradle-env.nix
vendored
@@ -1,331 +0,0 @@
|
|||||||
# This file is generated by gradle2nix.
|
|
||||||
#
|
|
||||||
# Example usage (e.g. in default.nix):
|
|
||||||
#
|
|
||||||
# with (import <nixpkgs> {});
|
|
||||||
# let
|
|
||||||
# buildGradle = callPackage ./gradle-env.nix {};
|
|
||||||
# in
|
|
||||||
# buildGradle {
|
|
||||||
# envSpec = ./gradle-env.json;
|
|
||||||
#
|
|
||||||
# src = ./.;
|
|
||||||
#
|
|
||||||
# gradleFlags = [ "installDist" ];
|
|
||||||
#
|
|
||||||
# installPhase = ''
|
|
||||||
# mkdir -p $out
|
|
||||||
# cp -r app/build/install/myproject $out
|
|
||||||
# '';
|
|
||||||
# }
|
|
||||||
|
|
||||||
{ stdenv, buildEnv, fetchurl, gradleGen, writeText, writeTextDir }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Path to the environment spec generated by gradle2nix (e.g. gradle-env.json).
|
|
||||||
envSpec
|
|
||||||
, pname ? null
|
|
||||||
, version ? null
|
|
||||||
, enableParallelBuilding ? true
|
|
||||||
# Arguments to Gradle used to build the project in buildPhase.
|
|
||||||
, gradleFlags ? [ "build" ]
|
|
||||||
# Gradle package to use instead of the one generated by gradle2nix.
|
|
||||||
, gradlePackage ? null
|
|
||||||
# Enable debugging for the Gradle build; this will cause Gradle to run a debug server
|
|
||||||
# and wait for a JVM debugging client to attach.
|
|
||||||
, enableDebug ? false
|
|
||||||
# Additional code to run in the Gradle init script (init.gradle).
|
|
||||||
, extraInit ? ""
|
|
||||||
# Override the default JDK used to run Gradle itself.
|
|
||||||
, buildJdk ? null
|
|
||||||
, ... } @ args:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (builtins)
|
|
||||||
attrValues concatStringsSep filter fromJSON match replaceStrings sort;
|
|
||||||
|
|
||||||
inherit (stdenv.lib)
|
|
||||||
assertMsg concatMapStringsSep groupBy' hasSuffix last mapAttrs
|
|
||||||
mapAttrsToList optionalString readFile removeSuffix unique versionAtLeast
|
|
||||||
versionOlder;
|
|
||||||
|
|
||||||
mkDep = depSpec: stdenv.mkDerivation {
|
|
||||||
inherit (depSpec) name;
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
inherit (depSpec) urls sha256;
|
|
||||||
};
|
|
||||||
|
|
||||||
phases = "installPhase";
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/${depSpec.path}
|
|
||||||
ln -s $src $out/${depSpec.path}/${depSpec.name}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
mkModuleMetadata = deps:
|
|
||||||
let
|
|
||||||
ids = filter
|
|
||||||
(id: id.type == "pom")
|
|
||||||
(map (dep: dep.id) deps);
|
|
||||||
|
|
||||||
modules = groupBy'
|
|
||||||
(meta: id:
|
|
||||||
let
|
|
||||||
isNewer = versionOlder meta.latest id.version;
|
|
||||||
isNewerRelease =
|
|
||||||
!(hasSuffix "-SNAPSHOT" id.version) &&
|
|
||||||
versionOlder meta.release id.version;
|
|
||||||
in {
|
|
||||||
groupId = id.group;
|
|
||||||
artifactId = id.name;
|
|
||||||
latest = if isNewer then id.version else meta.latest;
|
|
||||||
release = if isNewerRelease then id.version else meta.release;
|
|
||||||
versions = meta.versions ++ [id.version];
|
|
||||||
}
|
|
||||||
)
|
|
||||||
{
|
|
||||||
latest = "";
|
|
||||||
release = "";
|
|
||||||
versions = [];
|
|
||||||
}
|
|
||||||
(id: "${replaceStrings ["."] ["/"] id.group}/${id.name}/maven-metadata.xml")
|
|
||||||
ids;
|
|
||||||
|
|
||||||
in
|
|
||||||
attrValues (mapAttrs (path: meta:
|
|
||||||
let
|
|
||||||
versions' = sort versionOlder (unique meta.versions);
|
|
||||||
in
|
|
||||||
with meta; writeTextDir path ''
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<metadata modelVersion="1.1">
|
|
||||||
<groupId>${groupId}</groupId>
|
|
||||||
<artifactId>${artifactId}</artifactId>
|
|
||||||
<versioning>
|
|
||||||
${optionalString (latest != "") "<latest>${latest}</latest>"}
|
|
||||||
${optionalString (release != "") "<release>${release}</release>"}
|
|
||||||
<versions>
|
|
||||||
${concatMapStringsSep "\n " (v: "<version>${v}</version>") versions'}
|
|
||||||
</versions>
|
|
||||||
</versioning>
|
|
||||||
</metadata>
|
|
||||||
''
|
|
||||||
) modules);
|
|
||||||
|
|
||||||
mkSnapshotMetadata = deps:
|
|
||||||
let
|
|
||||||
snapshotDeps = filter (dep: dep ? build && dep ? timestamp) deps;
|
|
||||||
|
|
||||||
modules = groupBy'
|
|
||||||
(meta: dep:
|
|
||||||
let
|
|
||||||
id = dep.id;
|
|
||||||
isNewer = dep.build > meta.buildNumber;
|
|
||||||
# Timestamp values can be bogus, e.g. jitpack.io
|
|
||||||
updated = if (match "[0-9]{8}\.[0-9]{6}" dep.timestamp) != null
|
|
||||||
then replaceStrings ["."] [""] dep.timestamp
|
|
||||||
else "";
|
|
||||||
in {
|
|
||||||
groupId = id.group;
|
|
||||||
artifactId = id.name;
|
|
||||||
version = id.version;
|
|
||||||
timestamp = if isNewer then dep.timestamp else meta.timestamp;
|
|
||||||
buildNumber = if isNewer then dep.build else meta.buildNumber;
|
|
||||||
lastUpdated = if isNewer then updated else meta.lastUpdated;
|
|
||||||
versions = meta.versions or [] ++ [{
|
|
||||||
classifier = id.classifier or "";
|
|
||||||
extension = id.extension;
|
|
||||||
value = "${removeSuffix "-SNAPSHOT" id.version}-${dep.timestamp}-${toString dep.build}";
|
|
||||||
updated = updated;
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
)
|
|
||||||
{
|
|
||||||
timestamp = "";
|
|
||||||
buildNumber = -1;
|
|
||||||
lastUpdated = "";
|
|
||||||
}
|
|
||||||
(dep: "${replaceStrings ["."] ["/"] dep.id.group}/${dep.id.name}/${dep.id.version}/maven-metadata.xml")
|
|
||||||
snapshotDeps;
|
|
||||||
|
|
||||||
mkSnapshotVersion = version: ''
|
|
||||||
<snapshotVersion>
|
|
||||||
${optionalString (version.classifier != "") "<classifier>${version.classifier}</classifier>"}
|
|
||||||
<extension>${version.extension}</extension>
|
|
||||||
<value>${version.value}</value>
|
|
||||||
${optionalString (version.updated != "") "<updated>${version.updated}</updated>"}
|
|
||||||
</snapshotVersion>
|
|
||||||
'';
|
|
||||||
|
|
||||||
in
|
|
||||||
attrValues (mapAttrs (path: meta:
|
|
||||||
with meta; writeTextDir path ''
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<metadata modelVersion="1.1">
|
|
||||||
<groupId>${groupId}</groupId>
|
|
||||||
<artifactId>${artifactId}</artifactId>
|
|
||||||
<version>${version}</version>
|
|
||||||
<versioning>
|
|
||||||
<snapshot>
|
|
||||||
${optionalString (timestamp != "") "<timestamp>${timestamp}</timestamp>"}
|
|
||||||
${optionalString (buildNumber != -1) "<buildNumber>${toString buildNumber}</buildNumber>"}
|
|
||||||
</snapshot>
|
|
||||||
${optionalString (lastUpdated != "") "<lastUpdated>${lastUpdated}</lastUpdated>"}
|
|
||||||
<snapshotVersions>
|
|
||||||
${concatMapStringsSep "\n " mkSnapshotVersion versions}
|
|
||||||
</snapshotVersions>
|
|
||||||
</versioning>
|
|
||||||
</metadata>
|
|
||||||
''
|
|
||||||
) modules);
|
|
||||||
|
|
||||||
mkRepo = project: type: deps: buildEnv {
|
|
||||||
name = "${project}-gradle-${type}-env";
|
|
||||||
paths = map mkDep deps ++ mkModuleMetadata deps ++ mkSnapshotMetadata deps;
|
|
||||||
};
|
|
||||||
|
|
||||||
mkInitScript = projectSpec: gradle:
|
|
||||||
let
|
|
||||||
repos = mapAttrs (mkRepo projectSpec.name) projectSpec.dependencies;
|
|
||||||
hasDependencies = mapAttrs (type: deps: deps != []) projectSpec.dependencies;
|
|
||||||
in
|
|
||||||
assert (assertMsg (hasDependencies.settings -> versionAtLeast gradle.version "6.0") ''
|
|
||||||
Project `${projectSpec.name}' has settings script dependencies, such as settings
|
|
||||||
plugins, which are not supported by gradle2nix for Gradle versions prior to 6.0.
|
|
||||||
|
|
||||||
Potential remedies:
|
|
||||||
- Pass `--gradle-version=<version>' to the gradle2nix command.
|
|
||||||
- Patch the `settings.gradle[.kts]' file to remove script dependencies.
|
|
||||||
'');
|
|
||||||
|
|
||||||
writeText "init.gradle" ''
|
|
||||||
static def offlineRepo(RepositoryHandler repositories, String env, String path) {
|
|
||||||
repositories.clear()
|
|
||||||
repositories.maven {
|
|
||||||
name "Nix''${env.capitalize()}MavenOffline"
|
|
||||||
url path
|
|
||||||
metadataSources {
|
|
||||||
it.gradleMetadata()
|
|
||||||
it.mavenPom()
|
|
||||||
it.artifact()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
repositories.ivy {
|
|
||||||
name "Nix''${env.capitalize()}IvyOffline"
|
|
||||||
url path
|
|
||||||
layout "maven"
|
|
||||||
metadataSources {
|
|
||||||
it.gradleMetadata()
|
|
||||||
it.ivyDescriptor()
|
|
||||||
it.artifact()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
${optionalString (hasDependencies.settings && (versionAtLeast gradle.version "6.0")) ''
|
|
||||||
gradle.beforeSettings {
|
|
||||||
offlineRepo(it.buildscript.repositories, "settings", "${repos.settings}")
|
|
||||||
}
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (hasDependencies.plugin) ''
|
|
||||||
gradle.settingsEvaluated {
|
|
||||||
offlineRepo(it.pluginManagement.repositories, "plugin", "${repos.plugin}")
|
|
||||||
}
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (hasDependencies.buildscript) ''
|
|
||||||
gradle.projectsLoaded {
|
|
||||||
allprojects {
|
|
||||||
buildscript {
|
|
||||||
offlineRepo(repositories, "buildscript", "${repos.buildscript}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString (hasDependencies.project) ''
|
|
||||||
gradle.projectsLoaded {
|
|
||||||
allprojects {
|
|
||||||
offlineRepo(repositories, "project", "${repos.project}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
''}
|
|
||||||
|
|
||||||
${extraInit}
|
|
||||||
'';
|
|
||||||
|
|
||||||
mkGradle = gradleSpec:
|
|
||||||
gradleGen.gradleGen {
|
|
||||||
inherit (gradleSpec) nativeVersion;
|
|
||||||
|
|
||||||
name = "gradle-${gradleSpec.version}-${gradleSpec.type}";
|
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
inherit (gradleSpec) url sha256;
|
|
||||||
};
|
|
||||||
} // {
|
|
||||||
inherit (gradleSpec) version;
|
|
||||||
};
|
|
||||||
|
|
||||||
mkProjectEnv = projectSpec: rec {
|
|
||||||
inherit (projectSpec) name path version;
|
|
||||||
gradle = args.gradlePackage or mkGradle projectSpec.gradle;
|
|
||||||
initScript = mkInitScript projectSpec gradle;
|
|
||||||
};
|
|
||||||
|
|
||||||
gradleEnv = mapAttrs
|
|
||||||
(_: p: mkProjectEnv p)
|
|
||||||
(fromJSON (readFile envSpec));
|
|
||||||
|
|
||||||
projectEnv = gradleEnv."";
|
|
||||||
pname = args.pname or projectEnv.name;
|
|
||||||
version = args.version or projectEnv.version;
|
|
||||||
|
|
||||||
buildProject = env: flags: ''
|
|
||||||
gradle --offline --no-daemon --no-build-cache \
|
|
||||||
--info --full-stacktrace --warning-mode=all \
|
|
||||||
${optionalString enableParallelBuilding "--parallel"} \
|
|
||||||
${optionalString enableDebug "-Dorg.gradle.debug=true"} \
|
|
||||||
${optionalString (buildJdk != null) "-Dorg.gradle.java.home=${buildJdk.home}"} \
|
|
||||||
--init-script ${env.initScript} \
|
|
||||||
${optionalString (env.path != "") ''-p "${env.path}"''} \
|
|
||||||
${concatStringsSep " " flags}
|
|
||||||
'';
|
|
||||||
|
|
||||||
buildIncludedProjects =
|
|
||||||
concatStringsSep "\n" (mapAttrsToList
|
|
||||||
(_: env: buildProject env [ "build" ])
|
|
||||||
(removeAttrs gradleEnv [ "" ]));
|
|
||||||
|
|
||||||
buildRootProject = buildProject projectEnv gradleFlags;
|
|
||||||
|
|
||||||
in stdenv.mkDerivation (args // {
|
|
||||||
|
|
||||||
inherit pname version;
|
|
||||||
|
|
||||||
nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ projectEnv.gradle ];
|
|
||||||
|
|
||||||
buildPhase = args.buildPhase or ''
|
|
||||||
runHook preBuild
|
|
||||||
|
|
||||||
(
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
# use the init script here
|
|
||||||
TMPHOME=$(mktemp -d)
|
|
||||||
mkdir -p $TMPHOME/init.d
|
|
||||||
cp ${projectEnv.initScript} $TMPHOME/init.d
|
|
||||||
|
|
||||||
export "GRADLE_USER_HOME=$TMPHOME"
|
|
||||||
${buildIncludedProjects}
|
|
||||||
${buildRootProject}
|
|
||||||
)
|
|
||||||
|
|
||||||
runHook postBuild
|
|
||||||
'';
|
|
||||||
|
|
||||||
dontStrip = true;
|
|
||||||
})
|
|
||||||
@@ -12,6 +12,8 @@ import strikt.assertions.toPath
|
|||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
|
import kotlin.io.path.ExperimentalPathApi
|
||||||
|
import kotlin.io.path.createTempDirectory
|
||||||
|
|
||||||
private val moshi = Moshi.Builder().build()
|
private val moshi = Moshi.Builder().build()
|
||||||
|
|
||||||
@@ -36,6 +38,7 @@ class Fixture(val project: Path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OptIn(ExperimentalPathApi::class)
|
||||||
fun Root.fixture(name: String) {
|
fun Root.fixture(name: String) {
|
||||||
val fixture by memoized(
|
val fixture by memoized(
|
||||||
factory = {
|
factory = {
|
||||||
@@ -43,7 +46,7 @@ fun Root.fixture(name: String) {
|
|||||||
"$name: No test fixture found"
|
"$name: No test fixture found"
|
||||||
}
|
}
|
||||||
val fixtureRoot = Paths.get(url)
|
val fixtureRoot = Paths.get(url)
|
||||||
val dest = createTempDir("gradle2nix").toPath()
|
val dest = createTempDirectory("gradle2nix")
|
||||||
val src = checkNotNull(fixtureRoot.takeIf { Files.exists(it) }) {
|
val src = checkNotNull(fixtureRoot.takeIf { Files.exists(it) }) {
|
||||||
"$name: Test fixture not found: $fixtureRoot"
|
"$name: Test fixture not found: $fixtureRoot"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,11 @@
|
|||||||
plugins {
|
plugins {
|
||||||
base
|
base
|
||||||
idea
|
|
||||||
kotlin("jvm") version embeddedKotlinVersion apply false
|
|
||||||
kotlin("kapt") version embeddedKotlinVersion apply false
|
|
||||||
id("com.github.johnrengelman.shadow") version "5.2.0" apply false
|
|
||||||
id("org.ajoberstar.stutter") version "0.5.1" apply false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "org.nixos.gradle2nix"
|
group = "org.nixos.gradle2nix"
|
||||||
version = property("VERSION") ?: "unspecified"
|
version = property("VERSION") ?: "unspecified"
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
repositories {
|
|
||||||
jcenter()
|
|
||||||
maven { url = uri("https://repo.gradle.org/gradle/libs-releases") }
|
|
||||||
}
|
|
||||||
group = rootProject.group
|
group = rootProject.group
|
||||||
version = rootProject.version
|
version = rootProject.version
|
||||||
}
|
}
|
||||||
@@ -49,7 +40,7 @@ allprojects {
|
|||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
wrapper {
|
wrapper {
|
||||||
gradleVersion = "6.8-rc-1";
|
gradleVersion = "6.8.1"
|
||||||
distributionType = Wrapper.DistributionType.ALL
|
distributionType = Wrapper.DistributionType.ALL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
cp <?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>io.micrometer</groupId>
|
<groupId>io.micrometer</groupId>
|
||||||
<artifactId>micrometer-bom</artifactId>
|
<artifactId>micrometer-bom</artifactId>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
fb57aac12f2370e7115ab8af5265322397cae49e
|
07e9957e505eb062485e8ba52d14620e38baf45d
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
88e79ca0e696263e63bc9dc759a2e9c0d66e36d9
|
||||||
24
fixtures/repositories/m2/org/apache/test/maven-metadata.xml
Normal file
24
fixtures/repositories/m2/org/apache/test/maven-metadata.xml
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
or more contributor license agreements. See the NOTICE file
|
||||||
|
distributed with this work for additional information
|
||||||
|
regarding copyright ownership. The ASF licenses this file
|
||||||
|
to you under the Apache License, Version 2.0 (the
|
||||||
|
"License"); you may not use this file except in compliance
|
||||||
|
with the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
https://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing,
|
||||||
|
software distributed under the License is distributed on an
|
||||||
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||||
|
KIND, either express or implied. See the License for the
|
||||||
|
specific language governing permissions and limitations
|
||||||
|
under the License.
|
||||||
|
-->
|
||||||
|
<metadata>
|
||||||
|
<groupId>org.apache</groupId>
|
||||||
|
<artifactId>test</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
</metadata>
|
||||||
17
fixtures/s3/maven-snapshot/groovy/build.gradle
Normal file
17
fixtures/s3/maven-snapshot/groovy/build.gradle
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
plugins {
|
||||||
|
id('java')
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url "s3://repositories/m2"
|
||||||
|
credentials(AwsCredentials) {
|
||||||
|
accessKey "foo"
|
||||||
|
secretKey "bar"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation("org.apache:test-SNAPSHOT1:2.0.0-SNAPSHOT")
|
||||||
|
}
|
||||||
0
fixtures/s3/maven-snapshot/groovy/settings.gradle
Normal file
0
fixtures/s3/maven-snapshot/groovy/settings.gradle
Normal file
17
fixtures/s3/maven-snapshot/kotlin/build.gradle.kts
Normal file
17
fixtures/s3/maven-snapshot/kotlin/build.gradle.kts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
plugins {
|
||||||
|
java
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url = uri("s3://repositories/m2")
|
||||||
|
credentials(AwsCredentials::class) {
|
||||||
|
accessKey = "foo"
|
||||||
|
secretKey = "bar"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation("org.apache:test-SNAPSHOT1:2.0.0-SNAPSHOT")
|
||||||
|
}
|
||||||
17
fixtures/s3/maven/groovy/build.gradle
Normal file
17
fixtures/s3/maven/groovy/build.gradle
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
plugins {
|
||||||
|
id('java')
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url "s3://repositories/m2"
|
||||||
|
credentials(AwsCredentials) {
|
||||||
|
accessKey "foo"
|
||||||
|
secretKey "bar"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation("org.apache:test:1.0.0")
|
||||||
|
}
|
||||||
0
fixtures/s3/maven/groovy/settings.gradle
Normal file
0
fixtures/s3/maven/groovy/settings.gradle
Normal file
17
fixtures/s3/maven/kotlin/build.gradle.kts
Normal file
17
fixtures/s3/maven/kotlin/build.gradle.kts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
plugins {
|
||||||
|
java
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url = uri("s3://repositories/m2")
|
||||||
|
credentials(AwsCredentials::class) {
|
||||||
|
accessKey = "foo"
|
||||||
|
secretKey = "bar"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation("org.apache:test:1.0.0")
|
||||||
|
}
|
||||||
0
fixtures/s3/maven/kotlin/settings.gradle.kts
Normal file
0
fixtures/s3/maven/kotlin/settings.gradle.kts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
plugins {
|
||||||
|
java
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation("org.apache:test:1.0.0")
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
dependencyResolutionManagement {
|
||||||
|
repositories {
|
||||||
|
maven { url = uri("http://localhost:9999") }
|
||||||
|
}
|
||||||
|
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
|
||||||
|
}
|
||||||
6178
gradle-env.json
6178
gradle-env.json
File diff suppressed because it is too large
Load Diff
114
gradle-env.nix
114
gradle-env.nix
@@ -19,7 +19,15 @@
|
|||||||
# '';
|
# '';
|
||||||
# }
|
# }
|
||||||
|
|
||||||
{ stdenv, buildEnv, fetchurl, gradleGen, writeText, writeTextDir }:
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, buildEnv
|
||||||
|
, fetchs3
|
||||||
|
, fetchurl
|
||||||
|
, gradleGen
|
||||||
|
, writeText
|
||||||
|
, writeTextDir
|
||||||
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
# Path to the environment spec generated by gradle2nix (e.g. gradle-env.json).
|
# Path to the environment spec generated by gradle2nix (e.g. gradle-env.json).
|
||||||
@@ -38,29 +46,68 @@
|
|||||||
, extraInit ? ""
|
, extraInit ? ""
|
||||||
# Override the default JDK used to run Gradle itself.
|
# Override the default JDK used to run Gradle itself.
|
||||||
, buildJdk ? null
|
, buildJdk ? null
|
||||||
|
# Override functions which fetch dependency artifacts.
|
||||||
|
# Keys in this set are URL schemes such as "https" or "s3".
|
||||||
|
# Values are functions which take a dependency in the form
|
||||||
|
# `{ urls, sha256 }` and fetch into the Nix store. For example:
|
||||||
|
#
|
||||||
|
# {
|
||||||
|
# s3 = { urls, sha256 }: fetchs3 {
|
||||||
|
# s3url = builtins.head urls;
|
||||||
|
# inherit sha256;
|
||||||
|
# region = "us-west-2";
|
||||||
|
# credentials = {
|
||||||
|
# access_key_id = "foo";
|
||||||
|
# secret_access_key = "bar";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# }
|
||||||
|
, fetchers ? { }
|
||||||
, ... } @ args:
|
, ... } @ args:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (builtins)
|
inherit (builtins)
|
||||||
attrValues concatStringsSep filter fromJSON match replaceStrings sort;
|
attrValues concatStringsSep filter fromJSON getAttr head match
|
||||||
|
replaceStrings sort;
|
||||||
|
|
||||||
inherit (stdenv.lib)
|
inherit (lib)
|
||||||
assertMsg concatMapStringsSep groupBy' hasSuffix last mapAttrs
|
assertMsg concatMapStringsSep groupBy' hasSuffix hasPrefix last mapAttrs
|
||||||
mapAttrsToList optionalString readFile removeSuffix unique versionAtLeast
|
mapAttrsToList optionalString readFile removeSuffix unique versionAtLeast
|
||||||
versionOlder;
|
versionOlder;
|
||||||
|
|
||||||
mkDep = depSpec: stdenv.mkDerivation {
|
fetchers' = {
|
||||||
inherit (depSpec) name;
|
http = fetchurl;
|
||||||
|
https = fetchurl;
|
||||||
|
s3 = { urls, sha256 }: fetchs3 {
|
||||||
|
s3url = head urls;
|
||||||
|
inherit sha256;
|
||||||
|
};
|
||||||
|
} // fetchers;
|
||||||
|
|
||||||
src = fetchurl {
|
# Fetch urls using the scheme for the first entry only; there isn't a
|
||||||
inherit (depSpec) urls sha256;
|
# straightforward way to tell Nix to try multiple fetchers in turn
|
||||||
|
# and short-circuit on the first successful fetch.
|
||||||
|
fetch = { urls, sha256 }:
|
||||||
|
let
|
||||||
|
first = head urls;
|
||||||
|
scheme = head (builtins.match "([a-z0-9+.-]+)://.*" first);
|
||||||
|
fetch' = getAttr scheme fetchers';
|
||||||
|
urls' = filter (hasPrefix scheme) urls;
|
||||||
|
in
|
||||||
|
fetch' { urls = urls'; inherit sha256; };
|
||||||
|
|
||||||
|
mkDep = { name, path, urls, sha256, ... }: stdenv.mkDerivation {
|
||||||
|
inherit name;
|
||||||
|
|
||||||
|
src = fetch {
|
||||||
|
inherit urls sha256;
|
||||||
};
|
};
|
||||||
|
|
||||||
phases = "installPhase";
|
phases = "installPhase";
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/${depSpec.path}
|
mkdir -p $out/${path}
|
||||||
ln -s $src $out/${depSpec.path}/${depSpec.name}
|
ln -s $src $out/${path}/${name}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -190,6 +237,19 @@ let
|
|||||||
let
|
let
|
||||||
repos = mapAttrs (mkRepo projectSpec.name) projectSpec.dependencies;
|
repos = mapAttrs (mkRepo projectSpec.name) projectSpec.dependencies;
|
||||||
hasDependencies = mapAttrs (type: deps: deps != []) projectSpec.dependencies;
|
hasDependencies = mapAttrs (type: deps: deps != []) projectSpec.dependencies;
|
||||||
|
|
||||||
|
inSettings = pred: script:
|
||||||
|
optionalString pred (
|
||||||
|
if versionAtLeast gradle.version "6.0" then ''
|
||||||
|
gradle.beforeSettings {
|
||||||
|
${script}
|
||||||
|
}
|
||||||
|
'' else ''
|
||||||
|
gradle.settingsEvaluated {
|
||||||
|
${script}
|
||||||
|
}
|
||||||
|
''
|
||||||
|
);
|
||||||
in
|
in
|
||||||
assert (assertMsg (hasDependencies.settings -> versionAtLeast gradle.version "6.0") ''
|
assert (assertMsg (hasDependencies.settings -> versionAtLeast gradle.version "6.0") ''
|
||||||
Project `${projectSpec.name}' has settings script dependencies, such as settings
|
Project `${projectSpec.name}' has settings script dependencies, such as settings
|
||||||
@@ -224,16 +284,12 @@ let
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
${optionalString (hasDependencies.settings && (versionAtLeast gradle.version "6.0")) ''
|
${inSettings (hasDependencies.settings && (versionAtLeast gradle.version "6.0")) ''
|
||||||
gradle.beforeSettings {
|
|
||||||
offlineRepo(it.buildscript.repositories, "settings", "${repos.settings}")
|
offlineRepo(it.buildscript.repositories, "settings", "${repos.settings}")
|
||||||
}
|
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString (hasDependencies.plugin) ''
|
${inSettings (hasDependencies.plugin) ''
|
||||||
gradle.settingsEvaluated {
|
|
||||||
offlineRepo(it.pluginManagement.repositories, "plugin", "${repos.plugin}")
|
offlineRepo(it.pluginManagement.repositories, "plugin", "${repos.plugin}")
|
||||||
}
|
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString (hasDependencies.buildscript) ''
|
${optionalString (hasDependencies.buildscript) ''
|
||||||
@@ -246,13 +302,24 @@ let
|
|||||||
}
|
}
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${optionalString (hasDependencies.project) ''
|
${optionalString (hasDependencies.project) (
|
||||||
|
if versionAtLeast gradle.version "6.8"
|
||||||
|
then ''
|
||||||
|
gradle.beforeSettings {
|
||||||
|
it.dependencyResolutionManagement {
|
||||||
|
offlineRepo(repositories, "project", "${repos.project}")
|
||||||
|
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
''
|
||||||
|
else ''
|
||||||
gradle.projectsLoaded {
|
gradle.projectsLoaded {
|
||||||
allprojects {
|
allprojects {
|
||||||
offlineRepo(repositories, "project", "${repos.project}")
|
offlineRepo(repositories, "project", "${repos.project}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
''}
|
''
|
||||||
|
)}
|
||||||
|
|
||||||
${extraInit}
|
${extraInit}
|
||||||
'';
|
'';
|
||||||
@@ -285,6 +352,8 @@ let
|
|||||||
version = args.version or projectEnv.version;
|
version = args.version or projectEnv.version;
|
||||||
|
|
||||||
buildProject = env: flags: ''
|
buildProject = env: flags: ''
|
||||||
|
cp ${env.initScript} "$GRADLE_USER_HOME/init.d"
|
||||||
|
|
||||||
gradle --offline --no-daemon --no-build-cache \
|
gradle --offline --no-daemon --no-build-cache \
|
||||||
--info --full-stacktrace --warning-mode=all \
|
--info --full-stacktrace --warning-mode=all \
|
||||||
${optionalString enableParallelBuilding "--parallel"} \
|
${optionalString enableParallelBuilding "--parallel"} \
|
||||||
@@ -314,12 +383,11 @@ in stdenv.mkDerivation (args // {
|
|||||||
(
|
(
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
# use the init script here
|
# Work around https://github.com/gradle/gradle/issues/1055
|
||||||
TMPHOME=$(mktemp -d)
|
TMPHOME="$(mktemp -d)"
|
||||||
mkdir -p $TMPHOME/init.d
|
mkdir -p "$TMPHOME/init.d"
|
||||||
cp ${projectEnv.initScript} $TMPHOME/init.d
|
export GRADLE_USER_HOME="$TMPHOME"
|
||||||
|
|
||||||
export "GRADLE_USER_HOME=$TMPHOME"
|
|
||||||
${buildIncludedProjects}
|
${buildIncludedProjects}
|
||||||
${buildRootProject}
|
${buildRootProject}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
|
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
|
||||||
|
|
||||||
VERSION=1.0.0-rc2
|
VERSION=1.0.0-rc2
|
||||||
|
|
||||||
|
shadowVersion=6.1.0
|
||||||
|
stutterVersion=0.6.0
|
||||||
52
gradle/dependency-locks/settings-classpath.lockfile
Normal file
52
gradle/dependency-locks/settings-classpath.lockfile
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# 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.fasterxml.jackson.core:jackson-annotations:2.12.1
|
||||||
|
com.fasterxml.jackson.core:jackson-core:2.12.1
|
||||||
|
com.fasterxml.jackson.core:jackson-databind:2.12.1
|
||||||
|
com.fasterxml.jackson:jackson-bom:2.12.1
|
||||||
|
com.github.gundy:semver4j:0.16.4
|
||||||
|
com.github.jengelman.gradle.plugins:shadow:6.1.0
|
||||||
|
com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:6.1.0
|
||||||
|
com.google.code.gson:gson:2.8.6
|
||||||
|
commons-io:commons-io:2.6
|
||||||
|
de.undercouch:gradle-download-task:4.0.2
|
||||||
|
org.ajoberstar.stutter:org.ajoberstar.stutter.gradle.plugin:0.6.0
|
||||||
|
org.ajoberstar:gradle-stutter:0.6.0
|
||||||
|
org.antlr:antlr4-runtime:4.5.2-1
|
||||||
|
org.apache.ant:ant-launcher:1.9.7
|
||||||
|
org.apache.ant:ant:1.9.7
|
||||||
|
org.apache.logging.log4j:log4j-api:2.13.3
|
||||||
|
org.apache.logging.log4j:log4j-core:2.13.3
|
||||||
|
org.codehaus.plexus:plexus-utils:3.0.24
|
||||||
|
org.jdom:jdom2:2.0.6
|
||||||
|
org.jetbrains.intellij.deps:trove4j:1.0.20181211
|
||||||
|
org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.4.20
|
||||||
|
org.jetbrains.kotlin.kapt:org.jetbrains.kotlin.kapt.gradle.plugin:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-android-extensions:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-build-common:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-compiler-runner:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-daemon-client:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-reflect:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-script-runtime:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-scripting-common:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-scripting-jvm:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-util-io:1.4.20
|
||||||
|
org.jetbrains.kotlin:kotlin-util-klib:1.4.20
|
||||||
|
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7
|
||||||
|
org.jetbrains:annotations:13.0
|
||||||
|
org.ow2.asm:asm-analysis:9.0
|
||||||
|
org.ow2.asm:asm-commons:9.0
|
||||||
|
org.ow2.asm:asm-tree:9.0
|
||||||
|
org.ow2.asm:asm:9.0
|
||||||
|
org.vafer:jdependency:2.1.1
|
||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-rc-1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-all.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
24
ivy/build.gradle.kts
Normal file
24
ivy/build.gradle.kts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
plugins {
|
||||||
|
kotlin("jvm")
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
api("org.apache.ivy:ivy:latest.release")
|
||||||
|
api("com.amazonaws:aws-java-sdk-s3:latest.release")
|
||||||
|
|
||||||
|
testImplementation("com.adobe.testing:s3mock-junit5:latest.release")
|
||||||
|
testImplementation("io.strikt:strikt-core:latest.release")
|
||||||
|
testImplementation("org.junit.jupiter:junit-jupiter-api:latest.release")
|
||||||
|
testImplementation("org.junit.jupiter:junit-jupiter-params:latest.release")
|
||||||
|
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:latest.release")
|
||||||
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher:latest.release")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
test {
|
||||||
|
useJUnitPlatform {
|
||||||
|
includeEngines("junit-jupiter")
|
||||||
|
}
|
||||||
|
systemProperty("fixtures", "$rootDir/fixtures")
|
||||||
|
}
|
||||||
|
}
|
||||||
123
ivy/gradle.lockfile
Normal file
123
ivy/gradle.lockfile
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
# 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.
|
||||||
|
ch.qos.logback:logback-classic:1.2.3=testCompileClasspath,testRuntimeClasspath
|
||||||
|
ch.qos.logback:logback-core:1.2.3=testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.adobe.testing:s3mock-junit5:2.1.28=testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.adobe.testing:s3mock-testsupport-common:2.1.28=testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.adobe.testing:s3mock:2.1.28=testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.amazonaws:aws-java-sdk-core:1.11.946=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.amazonaws:aws-java-sdk-kms:1.11.946=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.amazonaws:aws-java-sdk-s3:1.11.946=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.amazonaws:jmespath-java:1.11.946=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.christophsturm:filepeek:0.1.2=testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson.core:jackson-annotations:2.6.0=compileClasspath,runtimeClasspath
|
||||||
|
com.fasterxml.jackson.core:jackson-annotations:2.9.0=testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson.core:jackson-core:2.6.7=compileClasspath,runtimeClasspath
|
||||||
|
com.fasterxml.jackson.core:jackson-core:2.9.9=testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson.core:jackson-databind:2.6.7.4=compileClasspath,runtimeClasspath
|
||||||
|
com.fasterxml.jackson.core:jackson-databind:2.9.9.3=testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.7=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.9=testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.9=testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.9=testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.9.9=testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.9=testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.fasterxml.woodstox:woodstox-core:5.1.0=testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.fasterxml:classmate:1.3.4=testCompileClasspath,testRuntimeClasspath
|
||||||
|
com.typesafe.netty:netty-reactive-streams-http:2.0.0=testRuntimeClasspath
|
||||||
|
com.typesafe.netty:netty-reactive-streams:2.0.0=testRuntimeClasspath
|
||||||
|
commons-codec:commons-codec:1.11=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
|
commons-io:commons-io:2.6=testCompileClasspath,testRuntimeClasspath
|
||||||
|
commons-logging:commons-logging:1.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
|
io.netty:netty-buffer:4.1.33.Final=testRuntimeClasspath
|
||||||
|
io.netty:netty-codec-http2:4.1.33.Final=testRuntimeClasspath
|
||||||
|
io.netty:netty-codec-http:4.1.33.Final=testRuntimeClasspath
|
||||||
|
io.netty:netty-codec:4.1.33.Final=testRuntimeClasspath
|
||||||
|
io.netty:netty-common:4.1.33.Final=testRuntimeClasspath
|
||||||
|
io.netty:netty-handler:4.1.33.Final=testRuntimeClasspath
|
||||||
|
io.netty:netty-resolver:4.1.33.Final=testRuntimeClasspath
|
||||||
|
io.netty:netty-transport-native-epoll:4.1.33.Final=testRuntimeClasspath
|
||||||
|
io.netty:netty-transport-native-unix-common:4.1.33.Final=testRuntimeClasspath
|
||||||
|
io.netty:netty-transport:4.1.33.Final=testRuntimeClasspath
|
||||||
|
io.strikt:strikt-core:0.28.2=testCompileClasspath,testRuntimeClasspath
|
||||||
|
javax.annotation:javax.annotation-api:1.3.2=testCompileClasspath,testRuntimeClasspath
|
||||||
|
javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath
|
||||||
|
javax.validation:validation-api:2.0.1.Final=testCompileClasspath,testRuntimeClasspath
|
||||||
|
joda-time:joda-time:2.8.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.apache.commons:commons-lang3:3.8.1=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.apache.httpcomponents:httpclient:4.5.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.apache.httpcomponents:httpcore:4.4.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.apache.ivy:ivy:2.5.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.apache.logging.log4j:log4j-api:2.11.2=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.apache.logging.log4j:log4j-to-slf4j:2.11.2=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.apiguardian:apiguardian-api:1.1.0=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.codehaus.woodstox:stax2-api:4.1=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-continuation:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-http:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-io:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-security:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-server:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-servlet:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-servlets:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-util:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-webapp:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.eclipse.jetty:jetty-xml:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.hibernate.validator:hibernate-validator:6.0.17.Final=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.jboss.logging:jboss-logging:3.3.2.Final=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-reflect:1.4.21-2=testRuntimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20=compileClasspath,runtimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.21-2=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.21-2=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21-2=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib:1.4.20=compileClasspath,runtimeClasspath
|
||||||
|
org.jetbrains.kotlin:kotlin-stdlib:1.4.21-2=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.2=testRuntimeClasspath
|
||||||
|
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2=testRuntimeClasspath
|
||||||
|
org.jetbrains:annotations:13.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.junit.jupiter:junit-jupiter-api:5.7.0=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.junit.jupiter:junit-jupiter-engine:5.7.0=testRuntimeClasspath
|
||||||
|
org.junit.jupiter:junit-jupiter-params:5.7.0=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.junit.platform:junit-platform-commons:1.7.0=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.junit.platform:junit-platform-engine:1.7.0=testRuntimeClasspath
|
||||||
|
org.junit.platform:junit-platform-launcher:1.7.0=testRuntimeClasspath
|
||||||
|
org.junit:junit-bom:5.7.0=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.mortbay.jasper:apache-el:8.5.40=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.reactivestreams:reactive-streams:1.0.2=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.slf4j:jul-to-slf4j:1.7.28=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.slf4j:slf4j-api:1.7.28=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework.boot:spring-boot-autoconfigure:2.1.9.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework.boot:spring-boot-starter-jetty:2.1.9.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework.boot:spring-boot-starter-json:2.1.9.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework.boot:spring-boot-starter-logging:2.1.9.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework.boot:spring-boot-starter-web:2.1.9.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework.boot:spring-boot-starter:2.1.9.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework.boot:spring-boot:2.1.9.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework:spring-aop:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework:spring-beans:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework:spring-context:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework:spring-core:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework:spring-expression:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework:spring-jcl:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework:spring-web:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.springframework:spring-webmvc:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
|
||||||
|
org.yaml:snakeyaml:1.23=testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:annotations:2.7.19=testCompileClasspath,testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:apache-client:2.7.19=testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:auth:2.7.19=testCompileClasspath,testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:aws-core:2.7.19=testCompileClasspath,testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:aws-query-protocol:2.7.19=testCompileClasspath,testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:aws-xml-protocol:2.7.19=testCompileClasspath,testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:http-client-spi:2.7.19=testCompileClasspath,testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:netty-nio-client:2.7.19=testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:profiles:2.7.19=testCompileClasspath,testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:protocol-core:2.7.19=testCompileClasspath,testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:regions:2.7.19=testCompileClasspath,testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:s3:2.7.19=testCompileClasspath,testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:sdk-core:2.7.19=testCompileClasspath,testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:url-connection-client:2.7.19=testCompileClasspath,testRuntimeClasspath
|
||||||
|
software.amazon.awssdk:utils:2.7.19=testCompileClasspath,testRuntimeClasspath
|
||||||
|
software.amazon.eventstream:eventstream:1.0.1=testCompileClasspath,testRuntimeClasspath
|
||||||
|
software.amazon.ion:ion-java:1.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||||
|
empty=
|
||||||
294
ivy/src/main/kotlin/org/nixos/gradle2nix/S3.kt
Normal file
294
ivy/src/main/kotlin/org/nixos/gradle2nix/S3.kt
Normal file
@@ -0,0 +1,294 @@
|
|||||||
|
package org.nixos.gradle2nix
|
||||||
|
|
||||||
|
import com.amazonaws.AmazonServiceException
|
||||||
|
import com.amazonaws.ClientConfiguration
|
||||||
|
import com.amazonaws.auth.AWSCredentials
|
||||||
|
import com.amazonaws.auth.AWSStaticCredentialsProvider
|
||||||
|
import com.amazonaws.client.builder.AwsClientBuilder
|
||||||
|
import com.amazonaws.regions.Region
|
||||||
|
import com.amazonaws.regions.RegionUtils
|
||||||
|
import com.amazonaws.regions.Regions
|
||||||
|
import com.amazonaws.services.s3.AmazonS3
|
||||||
|
import com.amazonaws.services.s3.AmazonS3ClientBuilder
|
||||||
|
import com.amazonaws.services.s3.model.GetObjectRequest
|
||||||
|
import com.amazonaws.services.s3.model.ListObjectsRequest
|
||||||
|
import com.amazonaws.services.s3.model.ObjectMetadata
|
||||||
|
import com.amazonaws.services.s3.model.S3Object
|
||||||
|
import com.amazonaws.services.s3.model.S3ObjectInputStream
|
||||||
|
import com.amazonaws.util.AwsHostNameUtils
|
||||||
|
import org.apache.http.conn.ssl.NoopHostnameVerifier
|
||||||
|
import org.apache.http.conn.ssl.SSLConnectionSocketFactory
|
||||||
|
import org.apache.ivy.core.settings.TimeoutConstraint
|
||||||
|
import org.apache.ivy.plugins.repository.AbstractRepository
|
||||||
|
import org.apache.ivy.plugins.repository.RepositoryCopyProgressListener
|
||||||
|
import org.apache.ivy.plugins.repository.Resource
|
||||||
|
import org.apache.ivy.plugins.repository.TransferEvent
|
||||||
|
import org.apache.ivy.util.FileUtil
|
||||||
|
import java.io.File
|
||||||
|
import java.io.FileOutputStream
|
||||||
|
import java.io.IOException
|
||||||
|
import java.io.InputStream
|
||||||
|
import java.net.Socket
|
||||||
|
import java.net.URI
|
||||||
|
import java.security.KeyManagementException
|
||||||
|
import java.security.NoSuchAlgorithmException
|
||||||
|
import java.security.SecureRandom
|
||||||
|
import java.security.cert.X509Certificate
|
||||||
|
import javax.net.ssl.SSLContext
|
||||||
|
import javax.net.ssl.SSLEngine
|
||||||
|
import javax.net.ssl.TrustManager
|
||||||
|
import javax.net.ssl.X509ExtendedTrustManager
|
||||||
|
|
||||||
|
|
||||||
|
class S3Repository(
|
||||||
|
private val client: AmazonS3,
|
||||||
|
timeoutConstraint: TimeoutConstraint? = null
|
||||||
|
) : AbstractRepository(timeoutConstraint) {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
credentials: AWSCredentials?,
|
||||||
|
endpoint: URI?,
|
||||||
|
timeoutConstraint: TimeoutConstraint?
|
||||||
|
) : this(
|
||||||
|
AmazonS3ClientBuilder.standard().apply {
|
||||||
|
credentials?.let { setCredentials(AWSStaticCredentialsProvider(it)) }
|
||||||
|
|
||||||
|
if (endpoint != null) {
|
||||||
|
setEndpointConfiguration(
|
||||||
|
AwsClientBuilder.EndpointConfiguration(
|
||||||
|
endpoint.toString(),
|
||||||
|
AwsHostNameUtils.parseRegion(endpoint.host, null) ?: Regions.US_EAST_1.name
|
||||||
|
)
|
||||||
|
)
|
||||||
|
isChunkedEncodingDisabled = true
|
||||||
|
isPathStyleAccessEnabled = true
|
||||||
|
} else {
|
||||||
|
region = Regions.US_EAST_1.name
|
||||||
|
}
|
||||||
|
|
||||||
|
if (System.getProperty("org.nixos.gradle2nix.s3test") != null) {
|
||||||
|
clientConfiguration = ClientConfiguration().apply {
|
||||||
|
apacheHttpClientConfig.sslSocketFactory = SSLConnectionSocketFactory(
|
||||||
|
createBlindlyTrustingSslContext(),
|
||||||
|
NoopHostnameVerifier.INSTANCE
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.build(),
|
||||||
|
timeoutConstraint
|
||||||
|
)
|
||||||
|
|
||||||
|
private val cache = mutableMapOf<String, S3Resource>()
|
||||||
|
|
||||||
|
private val progress = RepositoryCopyProgressListener(this)
|
||||||
|
|
||||||
|
override fun getResource(source: String): Resource =
|
||||||
|
cache.getOrPut(source) { S3Resource(this, URI(source)) }
|
||||||
|
|
||||||
|
override fun get(source: String, destination: File) {
|
||||||
|
fireTransferInitiated(getResource(source), TransferEvent.REQUEST_GET)
|
||||||
|
try {
|
||||||
|
val res = getResource(source)
|
||||||
|
val totalLength = res.contentLength
|
||||||
|
if (totalLength > 0) {
|
||||||
|
progress.totalLength = totalLength
|
||||||
|
}
|
||||||
|
destination.parentFile?.mkdirs()
|
||||||
|
FileUtil.copy(
|
||||||
|
res.openStream(),
|
||||||
|
FileOutputStream(destination),
|
||||||
|
progress,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
fireTransferCompleted(res.contentLength)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
fireTransferError(e)
|
||||||
|
throw e
|
||||||
|
} finally {
|
||||||
|
progress.totalLength = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun list(parent: String): List<String> =
|
||||||
|
S3Resource(this, URI(parent))
|
||||||
|
.let { resource ->
|
||||||
|
generateSequence({
|
||||||
|
try {
|
||||||
|
withClient(resource) {
|
||||||
|
listObjects(
|
||||||
|
ListObjectsRequest()
|
||||||
|
.withBucketName(resource.bucket)
|
||||||
|
.withPrefix(resource.key)
|
||||||
|
.withDelimiter("/")
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} catch (e: AmazonServiceException) {
|
||||||
|
throw S3RepositoryException(e)
|
||||||
|
}
|
||||||
|
}) { prev ->
|
||||||
|
if (!prev.isTruncated) {
|
||||||
|
null
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
withClient(resource) {
|
||||||
|
listNextBatchOfObjects(prev)
|
||||||
|
}
|
||||||
|
} catch (e: AmazonServiceException) {
|
||||||
|
throw S3RepositoryException(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.flatMap { listing ->
|
||||||
|
listing.commonPrefixes.asSequence() +
|
||||||
|
listing.objectSummaries.asSequence().map { it.key }
|
||||||
|
}
|
||||||
|
.toList()
|
||||||
|
|
||||||
|
internal fun <T> withClient(
|
||||||
|
resource: S3Resource,
|
||||||
|
block: AmazonS3.() -> T
|
||||||
|
): T = client.apply {
|
||||||
|
resource.region?.let { setRegion(it) }
|
||||||
|
}.block()
|
||||||
|
}
|
||||||
|
|
||||||
|
class S3Resource(
|
||||||
|
private val repository: S3Repository,
|
||||||
|
private val url: URI
|
||||||
|
) : Resource {
|
||||||
|
|
||||||
|
private val source: Source by lazy {
|
||||||
|
REGIONAL_ENDPOINT_PATTERN.find(url.normalize().toString())
|
||||||
|
?.let {
|
||||||
|
val (bucket, region, _, key) = it.destructured
|
||||||
|
Source(
|
||||||
|
bucket = bucket,
|
||||||
|
key = key,
|
||||||
|
region = when (region) {
|
||||||
|
"external-1" -> Region.getRegion(Regions.US_EAST_1)
|
||||||
|
else -> RegionUtils.getRegion(region)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
?: Source(
|
||||||
|
bucket = url.bucket(),
|
||||||
|
key = url.key(),
|
||||||
|
region = null
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
private val metadata: Metadata by lazy {
|
||||||
|
try {
|
||||||
|
getMetadata()
|
||||||
|
} catch (e: AmazonServiceException) {
|
||||||
|
null
|
||||||
|
}?.let { meta ->
|
||||||
|
Metadata(
|
||||||
|
exists = true,
|
||||||
|
contentLength = meta.contentLength,
|
||||||
|
lastModified = meta.lastModified.time
|
||||||
|
)
|
||||||
|
} ?: Metadata(
|
||||||
|
exists = false,
|
||||||
|
contentLength = 0,
|
||||||
|
lastModified = 0
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
val bucket: String get() = source.bucket
|
||||||
|
|
||||||
|
val key: String get() = source.key
|
||||||
|
|
||||||
|
val region: Region? get() = source.region
|
||||||
|
|
||||||
|
override fun getName(): String = url.toString()
|
||||||
|
|
||||||
|
override fun getLastModified(): Long = metadata.lastModified
|
||||||
|
|
||||||
|
override fun getContentLength(): Long = metadata.contentLength
|
||||||
|
|
||||||
|
override fun exists(): Boolean = metadata.exists
|
||||||
|
|
||||||
|
override fun isLocal(): Boolean = false
|
||||||
|
|
||||||
|
override fun clone(cloneName: String): Resource = S3Resource(repository, URI(cloneName))
|
||||||
|
|
||||||
|
override fun openStream(): InputStream =
|
||||||
|
try { getContent() }
|
||||||
|
catch (e: AmazonServiceException) { throw S3RepositoryException(e) }
|
||||||
|
?: throw S3RepositoryException()
|
||||||
|
|
||||||
|
private fun getMetadata(): ObjectMetadata? =
|
||||||
|
getObject(withContent = false)?.objectMetadata
|
||||||
|
|
||||||
|
private fun getContent(): S3ObjectInputStream? =
|
||||||
|
getObject(withContent = true)?.objectContent
|
||||||
|
|
||||||
|
private fun getObject(withContent: Boolean = true): S3Object? {
|
||||||
|
val request = GetObjectRequest(bucket, key)
|
||||||
|
if (!withContent) {
|
||||||
|
request.setRange(0, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
return try {
|
||||||
|
repository.withClient(this) { getObject(request) }
|
||||||
|
} catch (e: AmazonServiceException) {
|
||||||
|
val errorCode = e.errorCode
|
||||||
|
if (errorCode != null && "NoSuchKey".compareTo(errorCode, ignoreCase = true) == 0) {
|
||||||
|
null
|
||||||
|
} else {
|
||||||
|
e.printStackTrace()
|
||||||
|
throw e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private data class Source(
|
||||||
|
val bucket: String,
|
||||||
|
val key: String,
|
||||||
|
val region: Region?
|
||||||
|
)
|
||||||
|
|
||||||
|
private data class Metadata(
|
||||||
|
val exists: Boolean,
|
||||||
|
val contentLength: Long,
|
||||||
|
val lastModified: Long
|
||||||
|
)
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private val REGIONAL_ENDPOINT_PATTERN =
|
||||||
|
Regex("""^s3://(.+)?\.s3[.-]([a-z0-9-]+)\.amazonaws\.com(\.[a-z]+)?/(.+)""")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class S3RepositoryException : RuntimeException {
|
||||||
|
constructor() : super()
|
||||||
|
|
||||||
|
constructor(throwable: Throwable) : super(throwable)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun URI.bucket(): String = normalize().host
|
||||||
|
|
||||||
|
private fun URI.key(): String = normalize().path.removePrefix("/")
|
||||||
|
|
||||||
|
// Used for testing.
|
||||||
|
private fun createBlindlyTrustingSslContext(): SSLContext? {
|
||||||
|
return try {
|
||||||
|
SSLContext.getInstance("TLS").apply {
|
||||||
|
init(null, arrayOf<TrustManager>(object : X509ExtendedTrustManager() {
|
||||||
|
override fun getAcceptedIssuers(): Array<X509Certificate>? = null
|
||||||
|
override fun checkClientTrusted(arg0: Array<X509Certificate?>?, arg1: String?, arg2: Socket?) {}
|
||||||
|
override fun checkClientTrusted(arg0: Array<X509Certificate?>?, arg1: String?, arg2: SSLEngine?) {}
|
||||||
|
override fun checkClientTrusted(certs: Array<X509Certificate?>?, authType: String?) {}
|
||||||
|
override fun checkServerTrusted(certs: Array<X509Certificate?>?, authType: String?) {}
|
||||||
|
override fun checkServerTrusted(arg0: Array<X509Certificate?>?, arg1: String?, arg2: Socket?) {}
|
||||||
|
override fun checkServerTrusted(arg0: Array<X509Certificate?>?, arg1: String?, arg2: SSLEngine?) {}
|
||||||
|
}), SecureRandom())
|
||||||
|
}
|
||||||
|
} catch (e: NoSuchAlgorithmException) {
|
||||||
|
throw RuntimeException("Unexpected exception", e)
|
||||||
|
} catch (e: KeyManagementException) {
|
||||||
|
throw RuntimeException("Unexpected exception", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
113
ivy/src/test/kotlin/org/nixos/gradle2nix/S3Test.kt
Normal file
113
ivy/src/test/kotlin/org/nixos/gradle2nix/S3Test.kt
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
package org.nixos.gradle2nix
|
||||||
|
|
||||||
|
import com.adobe.testing.s3mock.junit5.S3MockExtension
|
||||||
|
import com.amazonaws.services.s3.AmazonS3
|
||||||
|
import org.apache.ivy.ant.IvyDependencyArtifact
|
||||||
|
import org.apache.ivy.core.module.descriptor.Artifact
|
||||||
|
import org.apache.ivy.core.module.descriptor.DefaultArtifact
|
||||||
|
import org.apache.ivy.core.module.id.ArtifactRevisionId
|
||||||
|
import org.apache.ivy.core.module.id.ModuleRevisionId
|
||||||
|
import org.apache.ivy.core.settings.IvySettings
|
||||||
|
import org.apache.ivy.plugins.repository.Resource
|
||||||
|
import org.apache.ivy.plugins.resolver.IBiblioResolver
|
||||||
|
import org.apache.ivy.plugins.resolver.URLResolver
|
||||||
|
import org.junit.jupiter.api.BeforeAll
|
||||||
|
import org.junit.jupiter.api.Test
|
||||||
|
import org.junit.jupiter.api.TestInstance
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension
|
||||||
|
import strikt.api.expectThat
|
||||||
|
import strikt.assertions.containsExactly
|
||||||
|
import strikt.assertions.isEmpty
|
||||||
|
import strikt.assertions.isEqualTo
|
||||||
|
import strikt.assertions.isFalse
|
||||||
|
import strikt.assertions.isNotEqualTo
|
||||||
|
import strikt.assertions.isNotNull
|
||||||
|
import strikt.assertions.isTrue
|
||||||
|
import java.io.File
|
||||||
|
import java.net.URI
|
||||||
|
import kotlin.io.path.ExperimentalPathApi
|
||||||
|
import kotlin.io.path.createTempDirectory
|
||||||
|
|
||||||
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
|
class S3Test {
|
||||||
|
companion object {
|
||||||
|
const val bucket = "repositories"
|
||||||
|
|
||||||
|
val fixtureRoot = File(System.getProperty("fixtures")).resolve(bucket)
|
||||||
|
|
||||||
|
@JvmField
|
||||||
|
@RegisterExtension
|
||||||
|
val s3mock: S3MockExtension = S3MockExtension.builder().withInitialBuckets(bucket).build()
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeAll
|
||||||
|
fun populateBucket(client: AmazonS3) {
|
||||||
|
fixtureRoot.walkTopDown()
|
||||||
|
.filter { it.isFile }
|
||||||
|
.forEach { file ->
|
||||||
|
val key = file.toRelativeString(fixtureRoot)
|
||||||
|
client.putObject(bucket, key, file)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun listsContents(client: AmazonS3) {
|
||||||
|
val repository = S3Repository(client)
|
||||||
|
expectThat(repository.list("s3://repositories/m2/org/apache/test/1.0.0/")).containsExactly(
|
||||||
|
"m2/org/apache/test/1.0.0/test-1.0.0.jar",
|
||||||
|
"m2/org/apache/test/1.0.0/test-1.0.0.pom",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun findsResourceMetadata(client: AmazonS3) {
|
||||||
|
val repository = S3Repository(client)
|
||||||
|
val resource: Resource = S3Resource(repository, URI("s3://repositories/m2/org/apache/test/1.0.0/test-1.0.0.pom"))
|
||||||
|
expectThat(resource).and {
|
||||||
|
get { exists() }.isTrue()
|
||||||
|
get { contentLength }.isNotEqualTo(-1L)
|
||||||
|
get { lastModified }.isNotEqualTo(-1L)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun downloadsResource(client: AmazonS3) {
|
||||||
|
val repository = S3Repository(client)
|
||||||
|
val resource: Resource = S3Resource(repository, URI("s3://repositories/m2/org/apache/test/1.0.0/test-1.0.0.pom"))
|
||||||
|
val source = fixtureRoot.resolve("m2/org/apache/test/1.0.0/test-1.0.0.pom").readText()
|
||||||
|
|
||||||
|
expectThat(resource.openStream().bufferedReader().readText()).isEqualTo(source)
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExperimentalPathApi
|
||||||
|
@Test
|
||||||
|
fun locatesArtifact(client: AmazonS3) {
|
||||||
|
val resolver = IBiblioResolver().apply {
|
||||||
|
name = "s3"
|
||||||
|
root = "s3://repositories/m2/"
|
||||||
|
isM2compatible = true
|
||||||
|
settings = IvySettings().apply {
|
||||||
|
defaultInit()
|
||||||
|
setDefaultRepositoryCacheBasedir(createTempDirectory().toString())
|
||||||
|
}
|
||||||
|
repository = S3Repository(client)
|
||||||
|
}
|
||||||
|
val origin = resolver.locate(DefaultArtifact(
|
||||||
|
ArtifactRevisionId.newInstance(
|
||||||
|
ModuleRevisionId.newInstance("org.apache", "test", "1.0.0"),
|
||||||
|
"test",
|
||||||
|
"jar",
|
||||||
|
"jar"
|
||||||
|
),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
false
|
||||||
|
))
|
||||||
|
|
||||||
|
expectThat(origin).isNotNull().and {
|
||||||
|
get { isExists }.isTrue()
|
||||||
|
get { isLocal }.isFalse()
|
||||||
|
get { location }.isEqualTo("s3://repositories/m2/org/apache/test/1.0.0/test-1.0.0.jar")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
5
plugin/.stutter/java11.lock
Normal file
5
plugin/.stutter/java11.lock
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# DO NOT MODIFY: Generated by Stutter plugin.
|
||||||
|
5.0
|
||||||
|
5.6.4
|
||||||
|
6.0.1
|
||||||
|
6.8.1
|
||||||
@@ -4,5 +4,4 @@
|
|||||||
5.0
|
5.0
|
||||||
5.6.4
|
5.6.4
|
||||||
6.0.1
|
6.0.1
|
||||||
6.7.1
|
6.8.1
|
||||||
6.8-milestone-3
|
|
||||||
|
|||||||
@@ -11,10 +11,8 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
compatTest {
|
test {
|
||||||
resources {
|
java.srcDir("src/test/kotlin")
|
||||||
srcDir("$rootDir/fixtures")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,25 +27,26 @@ configurations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
compileOnly("org.gradle:gradle-tooling-api:${gradle.gradleVersion}")
|
||||||
|
implementation("org.apache.maven:maven-repository-metadata:latest.release")
|
||||||
|
implementation(project(":ivy"))
|
||||||
implementation(project(":model"))
|
implementation(project(":model"))
|
||||||
shadow(gradleApi())
|
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("stdlib-jdk8"))
|
||||||
compatTestImplementation(embeddedKotlin("test-junit5"))
|
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(gradleTestKit())
|
||||||
compatTestImplementation(project(":model"))
|
compatTestImplementation(project(":model"))
|
||||||
compatTestImplementation("io.strikt:strikt-core:latest.release")
|
compatTestRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:latest.release")
|
||||||
compatTestImplementation("com.squareup.okio:okio:latest.release")
|
compatTestRuntimeOnly("org.junit.platform:junit-platform-launcher:latest.release")
|
||||||
compatTestImplementation("io.javalin:javalin:latest.release")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gradlePlugin {
|
gradlePlugin {
|
||||||
@@ -85,10 +84,11 @@ tasks {
|
|||||||
includeEngines("junit-jupiter")
|
includeEngines("junit-jupiter")
|
||||||
}
|
}
|
||||||
|
|
||||||
afterTest(KotlinClosure2<TestDescriptor, TestResult, Any>({ descriptor, result ->
|
// Default logging config exposes a classpath conflict between
|
||||||
// work around a bug in Gradle versions before 6.1, see https://github.com/junit-team/junit5/issues/2041
|
// the Gradle API and SFL4J.
|
||||||
val test = descriptor as org.gradle.api.internal.tasks.testing.TestDescriptorInternal
|
// (Sprint Boot is used in S3Mock)
|
||||||
println("[${test.classDisplayName}] > [${test.displayName}]: ${result.resultType}")
|
systemProperty("org.springframework.boot.logging.LoggingSystem", "org.springframework.boot.logging.java.JavaLoggingSystem")
|
||||||
}))
|
|
||||||
|
systemProperty("fixtures", "$rootDir/fixtures")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ com.github.gundy:semver4j:0.16.4=classpath
|
|||||||
com.google.code.gson:gson:2.8.6=classpath
|
com.google.code.gson:gson:2.8.6=classpath
|
||||||
de.undercouch:gradle-download-task:4.0.2=classpath
|
de.undercouch:gradle-download-task:4.0.2=classpath
|
||||||
org.antlr:antlr4-runtime:4.5.2-1=classpath
|
org.antlr:antlr4-runtime:4.5.2-1=classpath
|
||||||
org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:1.4.4=classpath
|
org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:1.4.9=classpath
|
||||||
org.gradle.kotlin:gradle-kotlin-dsl-plugins:1.4.4=classpath
|
org.gradle.kotlin:gradle-kotlin-dsl-plugins:1.4.9=classpath
|
||||||
org.jetbrains.intellij.deps:trove4j:1.0.20181211=classpath
|
org.jetbrains.intellij.deps:trove4j:1.0.20181211=classpath
|
||||||
org.jetbrains.kotlin:kotlin-android-extensions:1.4.20=classpath
|
org.jetbrains.kotlin:kotlin-android-extensions:1.4.20=classpath
|
||||||
org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.4.20=classpath
|
org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.4.20=classpath
|
||||||
|
|||||||
@@ -1,53 +1,118 @@
|
|||||||
# This is a Gradle generated file for dependency locking.
|
# This is a Gradle generated file for dependency locking.
|
||||||
# Manual edits can break the build and are not advised.
|
# Manual edits can break the build and are not advised.
|
||||||
# This file is expected to be part of source control.
|
# This file is expected to be part of source control.
|
||||||
|
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.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.moshi:moshi:1.11.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
com.squareup.okio:okio-metadata:2.9.0=compatTestImplementationDependenciesMetadata
|
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:1.17.5=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
com.squareup.okio:okio:2.9.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
com.squareup.okio:okio:3.0.0-alpha.1=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
dev.minutest:minutest:1.11.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
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.github.classgraph:classgraph:4.8.28=compatTestRuntimeClasspath
|
io.github.classgraph:classgraph:4.8.28=compatTestRuntimeClasspath
|
||||||
io.javalin:javalin:3.12.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
io.javalin:javalin:3.13.3=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
io.strikt:strikt-core:0.28.1=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
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.servlet:javax.servlet-api:3.1.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
|
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
|
net.swiftzer.semver:semver:1.1.1=compatTestRuntimeClasspath,default,runtimeClasspath,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.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.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
|
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.plexus:plexus-utils:3.2.1=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.eclipse.jetty.websocket:websocket-api:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.codehaus.woodstox:stax2-api:4.1=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.eclipse.jetty.websocket:websocket-client:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.eclipse.jetty.websocket:websocket-api:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.eclipse.jetty.websocket:websocket-common:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.eclipse.jetty.websocket:websocket-client:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.eclipse.jetty.websocket:websocket-server:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.eclipse.jetty.websocket:websocket-common:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.eclipse.jetty.websocket:websocket-servlet:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.eclipse.jetty.websocket:websocket-server:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.eclipse.jetty:jetty-client:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.eclipse.jetty.websocket:websocket-servlet:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.eclipse.jetty:jetty-http:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.eclipse.jetty:jetty-client:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.eclipse.jetty:jetty-io:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.eclipse.jetty:jetty-continuation:9.4.19.v20190610=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.eclipse.jetty:jetty-security:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.eclipse.jetty:jetty-http:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.eclipse.jetty:jetty-server:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.eclipse.jetty:jetty-io:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.eclipse.jetty:jetty-servlet:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.eclipse.jetty:jetty-security:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.eclipse.jetty:jetty-util:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.eclipse.jetty:jetty-server:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.eclipse.jetty:jetty-webapp:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.eclipse.jetty:jetty-servlet:9.4.35.v20201120=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.eclipse.jetty:jetty-xml:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.eclipse.jetty:jetty-servlets:9.4.19.v20190610=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.gradle:gradle-tooling-api:6.8-rc-1=compileClasspath,compileOnly,compileOnlyDependenciesMetadata
|
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.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.intellij.deps:trove4j:1.0.20181211=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.20=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-daemon-embeddable:1.4.20=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
|
||||||
org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.4.20=kotlinCompilerPluginClasspath
|
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-gradle-plugin-model:1.4.20=kotlinCompilerPluginClasspath
|
||||||
org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:1.4.20=kotlinKlibCommonizerClasspath
|
org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:1.4.20=kotlinKlibCommonizerClasspath
|
||||||
org.jetbrains.kotlin:kotlin-reflect:1.4.20=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,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-sam-with-receiver:1.4.20=kotlinCompilerPluginClasspath
|
||||||
org.jetbrains.kotlin:kotlin-script-runtime:1.4.20=kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath
|
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-common:1.4.20=kotlinCompilerPluginClasspath
|
||||||
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable: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-compiler-impl-embeddable:1.4.20=kotlinCompilerPluginClasspath
|
||||||
org.jetbrains.kotlin:kotlin-scripting-jvm:1.4.20=kotlinCompilerPluginClasspath
|
org.jetbrains.kotlin:kotlin-scripting-jvm:1.4.20=kotlinCompilerPluginClasspath
|
||||||
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath,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-jdk7:1.4.20=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.21-2=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.20=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.20=compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
||||||
org.jetbrains.kotlin:kotlin-stdlib:1.4.20=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath,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-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-common:1.4.20=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
org.jetbrains.kotlin:kotlin-test-junit5:1.4.20=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.jetbrains.kotlin:kotlin-test-junit5:1.4.20=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
@@ -55,7 +120,7 @@ org.jetbrains.kotlin:kotlin-test:1.4.20=compatTestCompileClasspath,compatTestImp
|
|||||||
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.2=compatTestRuntimeClasspath
|
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.3.7=kotlinCompilerPluginClasspath
|
||||||
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2=compatTestRuntimeClasspath
|
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2=compatTestRuntimeClasspath
|
||||||
org.jetbrains:annotations:13.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
|
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-api:5.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
|
||||||
org.junit.jupiter:junit-jupiter-engine:5.7.0=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.jupiter:junit-jupiter-params:5.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
@@ -63,7 +128,43 @@ org.junit.platform:junit-platform-commons:1.7.0=compatTestCompileClasspath,compa
|
|||||||
org.junit.platform:junit-platform-engine:1.7.0=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.platform:junit-platform-launcher:1.7.0=compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
|
||||||
org.junit:junit-bom:5.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,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.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.28=compileClasspath,compileOnly,compileOnlyDependenciesMetadata
|
||||||
org.slf4j:slf4j-api:1.7.30=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
org.slf4j:slf4j-api:1.7.30=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
|
||||||
|
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
|
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
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import dev.minutest.Tests
|
|||||||
import dev.minutest.experimental.minus
|
import dev.minutest.experimental.minus
|
||||||
import dev.minutest.junit.JUnit5Minutests
|
import dev.minutest.junit.JUnit5Minutests
|
||||||
import dev.minutest.rootContext
|
import dev.minutest.rootContext
|
||||||
|
import dev.minutest.test
|
||||||
import org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.BINTRAY_JCENTER_URL
|
import org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.BINTRAY_JCENTER_URL
|
||||||
import org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.MAVEN_CENTRAL_URL
|
import org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.MAVEN_CENTRAL_URL
|
||||||
import strikt.api.expectThat
|
import strikt.api.expectThat
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import dev.minutest.Tests
|
|||||||
import dev.minutest.experimental.minus
|
import dev.minutest.experimental.minus
|
||||||
import dev.minutest.junit.JUnit5Minutests
|
import dev.minutest.junit.JUnit5Minutests
|
||||||
import dev.minutest.rootContext
|
import dev.minutest.rootContext
|
||||||
|
import dev.minutest.test
|
||||||
import strikt.api.expectThat
|
import strikt.api.expectThat
|
||||||
import strikt.assertions.all
|
import strikt.assertions.all
|
||||||
import strikt.assertions.containsExactly
|
import strikt.assertions.containsExactly
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.nixos.gradle2nix
|
|||||||
import dev.minutest.Tests
|
import dev.minutest.Tests
|
||||||
import dev.minutest.junit.JUnit5Minutests
|
import dev.minutest.junit.JUnit5Minutests
|
||||||
import dev.minutest.rootContext
|
import dev.minutest.rootContext
|
||||||
|
import dev.minutest.test
|
||||||
import strikt.api.expectThat
|
import strikt.api.expectThat
|
||||||
import strikt.assertions.all
|
import strikt.assertions.all
|
||||||
import strikt.assertions.containsExactly
|
import strikt.assertions.containsExactly
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import dev.minutest.experimental.FOCUS
|
|||||||
import dev.minutest.experimental.minus
|
import dev.minutest.experimental.minus
|
||||||
import dev.minutest.junit.JUnit5Minutests
|
import dev.minutest.junit.JUnit5Minutests
|
||||||
import dev.minutest.rootContext
|
import dev.minutest.rootContext
|
||||||
|
import dev.minutest.test
|
||||||
import strikt.api.expectThat
|
import strikt.api.expectThat
|
||||||
import strikt.assertions.contains
|
import strikt.assertions.contains
|
||||||
import strikt.assertions.containsExactly
|
import strikt.assertions.containsExactly
|
||||||
|
|||||||
52
plugin/src/compatTest/kotlin/org/nixos/gradle2nix/S3Test.kt
Normal file
52
plugin/src/compatTest/kotlin/org/nixos/gradle2nix/S3Test.kt
Normal 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"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
package org.nixos.gradle2nix
|
package org.nixos.gradle2nix
|
||||||
|
|
||||||
import dev.minutest.Tests
|
import dev.minutest.Tests
|
||||||
|
import dev.minutest.experimental.minus
|
||||||
import dev.minutest.junit.JUnit5Minutests
|
import dev.minutest.junit.JUnit5Minutests
|
||||||
import dev.minutest.rootContext
|
import dev.minutest.rootContext
|
||||||
|
import dev.minutest.test
|
||||||
import strikt.api.expectThat
|
import strikt.api.expectThat
|
||||||
import strikt.assertions.containsExactly
|
import strikt.assertions.containsExactly
|
||||||
|
|
||||||
@@ -10,11 +12,22 @@ class SettingsTest : JUnit5Minutests {
|
|||||||
@Tests
|
@Tests
|
||||||
fun tests() = rootContext("settings tests") {
|
fun tests() = rootContext("settings tests") {
|
||||||
withRepository("m2") {
|
withRepository("m2") {
|
||||||
|
|
||||||
withFixture("settings/buildscript") {
|
withFixture("settings/buildscript") {
|
||||||
test("resolves settings plugin in buildscript classpath") {
|
test("resolves settings plugin in buildscript classpath") {
|
||||||
expectThat(build()) {
|
expectThat(build()) {
|
||||||
get("settings dependencies") { settingsDependencies }.ids
|
get("settings dependencies") { settingsDependencies }.ids.containsExactly(
|
||||||
.containsExactly(
|
"org.apache:test:1.0.0@jar",
|
||||||
|
"org.apache:test:1.0.0@pom"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
withFixture("settings/dependency-resolution-management") {
|
||||||
|
GRADLE_MIN("6.8") - test("uses repositories from settings script") {
|
||||||
|
expectThat(build()) {
|
||||||
|
get("root project dependencies") { rootProject.projectDependencies }.ids.containsExactly(
|
||||||
"org.apache:test:1.0.0@jar",
|
"org.apache:test:1.0.0@jar",
|
||||||
"org.apache:test:1.0.0@pom"
|
"org.apache:test:1.0.0@pom"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.nixos.gradle2nix
|
|||||||
import dev.minutest.Tests
|
import dev.minutest.Tests
|
||||||
import dev.minutest.junit.JUnit5Minutests
|
import dev.minutest.junit.JUnit5Minutests
|
||||||
import dev.minutest.rootContext
|
import dev.minutest.rootContext
|
||||||
|
import dev.minutest.test
|
||||||
import org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.BINTRAY_JCENTER_URL
|
import org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.BINTRAY_JCENTER_URL
|
||||||
import strikt.api.expectThat
|
import strikt.api.expectThat
|
||||||
import strikt.assertions.all
|
import strikt.assertions.all
|
||||||
|
|||||||
@@ -1,14 +1,22 @@
|
|||||||
package org.nixos.gradle2nix
|
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 com.squareup.moshi.Moshi
|
||||||
import dev.minutest.ContextBuilder
|
import dev.minutest.ContextBuilder
|
||||||
import dev.minutest.MinutestFixture
|
import dev.minutest.MinutestFixture
|
||||||
import dev.minutest.Node
|
import dev.minutest.Node
|
||||||
import dev.minutest.TestContextBuilder
|
import dev.minutest.TestContextBuilder
|
||||||
import dev.minutest.closeableFixture
|
import dev.minutest.afterEach
|
||||||
|
import dev.minutest.beforeEach
|
||||||
import dev.minutest.experimental.SKIP
|
import dev.minutest.experimental.SKIP
|
||||||
import dev.minutest.experimental.TransformingAnnotation
|
import dev.minutest.experimental.TransformingAnnotation
|
||||||
|
import dev.minutest.given
|
||||||
|
import dev.minutest.givenClosable
|
||||||
|
import dev.minutest.given_
|
||||||
import io.javalin.Javalin
|
import io.javalin.Javalin
|
||||||
|
import io.javalin.http.staticfiles.Location
|
||||||
import okio.buffer
|
import okio.buffer
|
||||||
import okio.source
|
import okio.source
|
||||||
import org.gradle.internal.classpath.DefaultClassPath
|
import org.gradle.internal.classpath.DefaultClassPath
|
||||||
@@ -21,10 +29,12 @@ import strikt.assertions.map
|
|||||||
import java.io.Closeable
|
import java.io.Closeable
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.StringWriter
|
import java.io.StringWriter
|
||||||
import java.nio.file.Paths
|
import java.util.concurrent.atomic.AtomicBoolean
|
||||||
|
|
||||||
private val moshi = Moshi.Builder().build()
|
private val moshi = Moshi.Builder().build()
|
||||||
|
|
||||||
|
val fixtureRoot = File(System.getProperty("fixtures"))
|
||||||
|
|
||||||
val gradleVersion = System.getProperty("compat.gradle.version")
|
val gradleVersion = System.getProperty("compat.gradle.version")
|
||||||
?.let(GradleVersion::version)
|
?.let(GradleVersion::version)
|
||||||
?: GradleVersion.current()
|
?: GradleVersion.current()
|
||||||
@@ -65,7 +75,8 @@ fun File.buildKotlin(
|
|||||||
|
|
||||||
private fun File.build(
|
private fun File.build(
|
||||||
configurations: List<String>,
|
configurations: List<String>,
|
||||||
subprojects: List<String>
|
subprojects: List<String>,
|
||||||
|
extraArguments: List<String> = emptyList()
|
||||||
): DefaultBuild {
|
): DefaultBuild {
|
||||||
val log = StringWriter()
|
val log = StringWriter()
|
||||||
|
|
||||||
@@ -79,7 +90,8 @@ private fun File.build(
|
|||||||
"--init-script=${initscript()}",
|
"--init-script=${initscript()}",
|
||||||
"--stacktrace",
|
"--stacktrace",
|
||||||
"-Porg.nixos.gradle2nix.configurations=${configurations.joinToString(",")}",
|
"-Porg.nixos.gradle2nix.configurations=${configurations.joinToString(",")}",
|
||||||
"-Porg.nixos.gradle2nix.subprojects=${subprojects.joinToString(",")}"
|
"-Porg.nixos.gradle2nix.subprojects=${subprojects.joinToString(",")}",
|
||||||
|
*(extraArguments.toTypedArray())
|
||||||
)
|
)
|
||||||
.runCatching { build() }
|
.runCatching { build() }
|
||||||
|
|
||||||
@@ -103,15 +115,64 @@ val <T : Iterable<Artifact>> Assertion.Builder<T>.ids: Assertion.Builder<Iterabl
|
|||||||
|
|
||||||
private fun File.parents() = generateSequence(parentFile) { it.parentFile }
|
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
|
@MinutestFixture
|
||||||
class RepositoryFixture(private val server: Javalin) : Closeable {
|
class RepositoryFixture(
|
||||||
|
private val server: Javalin,
|
||||||
|
parent: ArgumentsSupplier? = null
|
||||||
|
) : ArgumentsSupplier(parent), Closeable {
|
||||||
override fun close() {
|
override fun close() {
|
||||||
server.stop()
|
server.stop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@MinutestFixture
|
@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
|
val dest: File
|
||||||
|
|
||||||
init {
|
init {
|
||||||
@@ -127,7 +188,10 @@ class TestFixture(val name: String, val source: File) : Closeable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@MinutestFixture
|
@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
|
private val dest: File
|
||||||
|
|
||||||
init {
|
init {
|
||||||
@@ -138,30 +202,48 @@ class ProjectFixture(private val parent: TestFixture, private val source: File)
|
|||||||
dest = parent.dest.resolve(rel)
|
dest = parent.dest.resolve(rel)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun copy() {
|
fun copySource() {
|
||||||
source.copyRecursively(dest, true)
|
source.copyRecursively(dest, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun build(
|
fun build(
|
||||||
configurations: List<String> = emptyList(),
|
configurations: List<String> = emptyList(),
|
||||||
subprojects: List<String> = emptyList()
|
subprojects: List<String> = emptyList()
|
||||||
) = dest.build(configurations, subprojects)
|
) = dest.build(configurations, subprojects, parent.extraArguments)
|
||||||
|
|
||||||
override fun close() {
|
override fun close() {
|
||||||
dest.deleteRecursively()
|
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(
|
fun ContextBuilder<*>.withRepository(
|
||||||
name: String,
|
name: String,
|
||||||
block: TestContextBuilder<*, RepositoryFixture>.() -> Unit
|
block: TestContextBuilder<*, RepositoryFixture>.() -> Unit
|
||||||
) = derivedContext<RepositoryFixture>("with repository: ${name}") {
|
) = derivedContext<RepositoryFixture>("with repository: $name") {
|
||||||
closeableFixture {
|
given_ { parent ->
|
||||||
RepositoryFixture(Javalin.create { config ->
|
RepositoryFixture(
|
||||||
config.addStaticFiles("/repositories/$name")
|
server = Javalin.create { config ->
|
||||||
}.start(9999))
|
config.addStaticFiles("${fixtureRoot}/repositories/$name", Location.EXTERNAL)
|
||||||
|
}.start(9999),
|
||||||
|
parent = parent as? ArgumentsSupplier
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
afterEach { it.close() }
|
||||||
|
|
||||||
block()
|
block()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,26 +251,50 @@ fun ContextBuilder<*>.withFixture(
|
|||||||
name: String,
|
name: String,
|
||||||
block: TestContextBuilder<*, ProjectFixture>.() -> Unit
|
block: TestContextBuilder<*, ProjectFixture>.() -> Unit
|
||||||
) = derivedContext<TestFixture>(name) {
|
) = derivedContext<TestFixture>(name) {
|
||||||
val url = checkNotNull(Thread.currentThread().contextClassLoader.getResource(name)?.toURI()) {
|
|
||||||
"$name: No test fixture found"
|
|
||||||
}
|
|
||||||
val fixtureRoot = Paths.get(url).toFile().absoluteFile
|
|
||||||
|
|
||||||
deriveFixture {
|
val projectRoot = fixtureRoot.resolve(name).also {
|
||||||
TestFixture(name, fixtureRoot)
|
check(it.exists()) { "$name: project fixture not found: $it" }
|
||||||
}
|
}
|
||||||
|
|
||||||
val testRoots = fixtureRoot.listFiles()!!
|
given_ { parent ->
|
||||||
|
TestFixture(name, projectRoot, parent as? ArgumentsSupplier)
|
||||||
|
}
|
||||||
|
|
||||||
|
val testRoots = projectRoot.listFiles()!!
|
||||||
.filter { it.isDirectory }
|
.filter { it.isDirectory }
|
||||||
.map { it.absoluteFile }
|
.map { it.absoluteFile }
|
||||||
.toList()
|
.toList()
|
||||||
|
|
||||||
testRoots.forEach { testRoot ->
|
testRoots.forEach { testRoot ->
|
||||||
derivedContext<ProjectFixture>(testRoot.name) {
|
derivedContext<ProjectFixture>(testRoot.name) {
|
||||||
deriveFixture { ProjectFixture(this, testRoot) }
|
given_ { parent -> ProjectFixture(parent, testRoot) }
|
||||||
before { copy() }
|
beforeEach { copySource() }
|
||||||
after { close() }
|
afterEach { close() }
|
||||||
block()
|
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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
package org.nixos.gradle2nix
|
package org.nixos.gradle2nix
|
||||||
|
|
||||||
import dev.minutest.Tests
|
import dev.minutest.Tests
|
||||||
|
import dev.minutest.given
|
||||||
import dev.minutest.junit.JUnit5Minutests
|
import dev.minutest.junit.JUnit5Minutests
|
||||||
import dev.minutest.rootContext
|
import dev.minutest.rootContext
|
||||||
|
import dev.minutest.test
|
||||||
import strikt.api.expectThat
|
import strikt.api.expectThat
|
||||||
import strikt.assertions.isEqualTo
|
import strikt.assertions.isEqualTo
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@@ -10,7 +12,7 @@ import java.io.File
|
|||||||
class WrapperTest : JUnit5Minutests {
|
class WrapperTest : JUnit5Minutests {
|
||||||
@Tests
|
@Tests
|
||||||
fun tests() = rootContext<File>("wrapper tests") {
|
fun tests() = rootContext<File>("wrapper tests") {
|
||||||
fixture { createTempDir("gradle2nix") }
|
given { createTempDir("gradle2nix") }
|
||||||
|
|
||||||
test("resolves gradle wrapper version") {
|
test("resolves gradle wrapper version") {
|
||||||
expectThat(buildKotlin("""
|
expectThat(buildKotlin("""
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ enum class ConfigurationScope {
|
|||||||
internal class ConfigurationResolverFactory(
|
internal class ConfigurationResolverFactory(
|
||||||
project: Project,
|
project: Project,
|
||||||
scope: ConfigurationScope,
|
scope: ConfigurationScope,
|
||||||
repositories: RepositoryHandler
|
repositories: List<ResolutionAwareRepository>
|
||||||
) {
|
) {
|
||||||
private val ivySettings = IvySettings().apply {
|
private val ivySettings = IvySettings().apply {
|
||||||
defaultInit()
|
defaultInit()
|
||||||
@@ -49,7 +49,6 @@ internal class ConfigurationResolverFactory(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val resolvers = repositories
|
private val resolvers = repositories
|
||||||
.filterIsInstance<ResolutionAwareRepository>()
|
|
||||||
.filterNot { it.createResolver().isLocal }
|
.filterNot { it.createResolver().isLocal }
|
||||||
.mapNotNull { it.repositoryResolver(project, scope, ivySettings) }
|
.mapNotNull { it.repositoryResolver(project, scope, ivySettings) }
|
||||||
|
|
||||||
@@ -62,7 +61,7 @@ internal class ConfigurationResolver(
|
|||||||
private val resolvers: List<RepositoryResolver>,
|
private val resolvers: List<RepositoryResolver>,
|
||||||
private val dependencies: DependencyHandler
|
private val dependencies: DependencyHandler
|
||||||
) {
|
) {
|
||||||
private val failed = mutableListOf<ArtifactIdentifier>()
|
private val failed = mutableSetOf<ArtifactIdentifier>()
|
||||||
private val ivy = Ivy.newInstance(ivySettings)
|
private val ivy = Ivy.newInstance(ivySettings)
|
||||||
|
|
||||||
val unresolved: List<ArtifactIdentifier> = failed.toList()
|
val unresolved: List<ArtifactIdentifier> = failed.toList()
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import org.gradle.api.Task
|
|||||||
import org.gradle.api.artifacts.Configuration
|
import org.gradle.api.artifacts.Configuration
|
||||||
import org.gradle.api.artifacts.ProjectDependency
|
import org.gradle.api.artifacts.ProjectDependency
|
||||||
import org.gradle.api.internal.GradleInternal
|
import org.gradle.api.internal.GradleInternal
|
||||||
|
import org.gradle.api.internal.artifacts.repositories.ResolutionAwareRepository
|
||||||
import org.gradle.api.invocation.Gradle
|
import org.gradle.api.invocation.Gradle
|
||||||
import org.gradle.api.tasks.TaskContainer
|
import org.gradle.api.tasks.TaskContainer
|
||||||
import org.gradle.api.tasks.wrapper.Wrapper
|
import org.gradle.api.tasks.wrapper.Wrapper
|
||||||
@@ -132,7 +133,11 @@ private fun Project.buildGradle(): DefaultGradle =
|
|||||||
private fun Project.settingsDependencies(): List<DefaultArtifact> {
|
private fun Project.settingsDependencies(): List<DefaultArtifact> {
|
||||||
val buildscript = (gradle as GradleInternal).settings.buildscript
|
val buildscript = (gradle as GradleInternal).settings.buildscript
|
||||||
|
|
||||||
val resolverFactory = ConfigurationResolverFactory(this, ConfigurationScope.SETTINGS, buildscript.repositories)
|
val resolverFactory = ConfigurationResolverFactory(
|
||||||
|
this,
|
||||||
|
ConfigurationScope.SETTINGS,
|
||||||
|
buildscript.repositories.filterIsInstance<ResolutionAwareRepository>()
|
||||||
|
)
|
||||||
val resolver = resolverFactory.create(buildscript.dependencies)
|
val resolver = resolverFactory.create(buildscript.dependencies)
|
||||||
|
|
||||||
logger.lifecycle(" Settings script")
|
logger.lifecycle(" Settings script")
|
||||||
@@ -208,7 +213,11 @@ private fun Project.buildProject(
|
|||||||
private fun Project.buildscriptDependencies(
|
private fun Project.buildscriptDependencies(
|
||||||
pluginArtifacts: List<DefaultArtifact>
|
pluginArtifacts: List<DefaultArtifact>
|
||||||
): Pair<List<DefaultArtifact>, List<ArtifactIdentifier>> {
|
): Pair<List<DefaultArtifact>, List<ArtifactIdentifier>> {
|
||||||
val resolverFactory = ConfigurationResolverFactory(this, ConfigurationScope.BUILDSCRIPT, buildscript.repositories)
|
val resolverFactory = ConfigurationResolverFactory(
|
||||||
|
this,
|
||||||
|
ConfigurationScope.BUILDSCRIPT,
|
||||||
|
buildscript.repositories.filterIsInstance<ResolutionAwareRepository>()
|
||||||
|
)
|
||||||
val resolver = resolverFactory.create(buildscript.dependencies)
|
val resolver = resolverFactory.create(buildscript.dependencies)
|
||||||
val pluginIds = pluginArtifacts.map(DefaultArtifact::id)
|
val pluginIds = pluginArtifacts.map(DefaultArtifact::id)
|
||||||
return buildscript.configurations
|
return buildscript.configurations
|
||||||
@@ -221,8 +230,11 @@ private fun Project.buildscriptDependencies(
|
|||||||
private fun Project.projectDependencies(
|
private fun Project.projectDependencies(
|
||||||
explicitConfigurations: List<String>
|
explicitConfigurations: List<String>
|
||||||
): Pair<List<DefaultArtifact>, List<ArtifactIdentifier>> {
|
): Pair<List<DefaultArtifact>, List<ArtifactIdentifier>> {
|
||||||
val resolverFactory = ConfigurationResolverFactory(this, ConfigurationScope.PROJECT, repositories)
|
val resolver = ConfigurationResolverFactory(
|
||||||
val resolver = resolverFactory.create(dependencies)
|
this,
|
||||||
|
ConfigurationScope.PROJECT,
|
||||||
|
RepositoriesCollector.create(project).collectRepositories()
|
||||||
|
).create(dependencies)
|
||||||
return collectConfigurations(explicitConfigurations)
|
return collectConfigurations(explicitConfigurations)
|
||||||
.flatMap(resolver::resolve)
|
.flatMap(resolver::resolve)
|
||||||
.distinct()
|
.distinct()
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nixos.gradle2nix
|
package org.nixos.gradle2nix
|
||||||
|
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
|
import org.gradle.api.internal.artifacts.repositories.ResolutionAwareRepository
|
||||||
import org.gradle.plugin.management.PluginRequest
|
import org.gradle.plugin.management.PluginRequest
|
||||||
import org.gradle.plugin.use.internal.PluginDependencyResolutionServices
|
import org.gradle.plugin.use.internal.PluginDependencyResolutionServices
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
@@ -14,7 +15,7 @@ internal open class PluginResolver @Inject constructor(
|
|||||||
private val resolver = ConfigurationResolverFactory(
|
private val resolver = ConfigurationResolverFactory(
|
||||||
project,
|
project,
|
||||||
ConfigurationScope.PLUGIN,
|
ConfigurationScope.PLUGIN,
|
||||||
pluginDependencyResolutionServices.resolveRepositoryHandler
|
pluginDependencyResolutionServices.resolveRepositoryHandler.filterIsInstance<ResolutionAwareRepository>()
|
||||||
).create(pluginDependencyResolutionServices.dependencyHandler)
|
).create(pluginDependencyResolutionServices.dependencyHandler)
|
||||||
|
|
||||||
fun resolve(pluginRequests: List<PluginRequest>): List<DefaultArtifact> {
|
fun resolve(pluginRequests: List<PluginRequest>): List<DefaultArtifact> {
|
||||||
@@ -28,4 +29,3 @@ internal open class PluginResolver @Inject constructor(
|
|||||||
return resolver.resolve(configurations.detachedConfiguration(*markerDependencies.toTypedArray()))
|
return resolver.resolve(configurations.detachedConfiguration(*markerDependencies.toTypedArray()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package org.nixos.gradle2nix
|
||||||
|
|
||||||
|
import org.gradle.api.internal.artifacts.repositories.ResolutionAwareRepository
|
||||||
|
import org.gradle.api.Project
|
||||||
|
import org.gradle.api.artifacts.dsl.RepositoryHandler
|
||||||
|
import org.gradle.api.initialization.dsl.ScriptHandler
|
||||||
|
import org.gradle.api.internal.artifacts.RepositoriesSupplier
|
||||||
|
import org.gradle.kotlin.dsl.newInstance
|
||||||
|
import org.gradle.util.GradleVersion
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
interface RepositoriesCollector {
|
||||||
|
fun collectRepositories(): List<ResolutionAwareRepository>
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun create(project: Project): RepositoriesCollector =
|
||||||
|
if (GradleVersion.current() >= GradleVersion.version("6.8")) {
|
||||||
|
project.objects.newInstance<RepositoriesCollector68>()
|
||||||
|
} else {
|
||||||
|
project.objects.newInstance<RepositoriesCollectorBase>()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
open class RepositoriesCollectorBase @Inject constructor(
|
||||||
|
private val repositories: RepositoryHandler
|
||||||
|
): RepositoriesCollector {
|
||||||
|
override fun collectRepositories(): List<ResolutionAwareRepository> =
|
||||||
|
repositories.filterIsInstance<ResolutionAwareRepository>()
|
||||||
|
}
|
||||||
|
|
||||||
|
open class RepositoriesCollector68 @Inject constructor(
|
||||||
|
private val repositoriesSupplier: RepositoriesSupplier
|
||||||
|
): RepositoriesCollector {
|
||||||
|
override fun collectRepositories(): List<ResolutionAwareRepository> =
|
||||||
|
repositoriesSupplier.get()
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package org.nixos.gradle2nix
|
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.LogOptions
|
||||||
import org.apache.ivy.core.cache.ArtifactOrigin
|
import org.apache.ivy.core.cache.ArtifactOrigin
|
||||||
import org.apache.ivy.core.cache.CacheResourceOptions
|
import org.apache.ivy.core.cache.CacheResourceOptions
|
||||||
@@ -9,7 +11,12 @@ import org.apache.ivy.core.module.id.ArtifactRevisionId
|
|||||||
import org.apache.ivy.core.module.id.ModuleRevisionId
|
import org.apache.ivy.core.module.id.ModuleRevisionId
|
||||||
import org.apache.ivy.core.resolve.DownloadOptions
|
import org.apache.ivy.core.resolve.DownloadOptions
|
||||||
import org.apache.ivy.core.settings.IvySettings
|
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.repository.url.URLResource
|
||||||
|
import org.apache.ivy.plugins.resolver.AbstractResolver
|
||||||
import org.apache.ivy.plugins.resolver.IBiblioResolver
|
import org.apache.ivy.plugins.resolver.IBiblioResolver
|
||||||
import org.apache.ivy.plugins.resolver.URLResolver
|
import org.apache.ivy.plugins.resolver.URLResolver
|
||||||
import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader
|
import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader
|
||||||
@@ -17,13 +24,21 @@ import org.codehaus.plexus.util.ReaderFactory
|
|||||||
import org.codehaus.plexus.util.xml.pull.XmlPullParserException
|
import org.codehaus.plexus.util.xml.pull.XmlPullParserException
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.artifacts.repositories.ArtifactRepository
|
import org.gradle.api.artifacts.repositories.ArtifactRepository
|
||||||
|
import org.gradle.api.artifacts.repositories.AuthenticationContainer
|
||||||
|
import org.gradle.api.artifacts.repositories.AuthenticationSupported
|
||||||
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
|
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
|
||||||
import org.gradle.api.artifacts.repositories.MavenArtifactRepository
|
import org.gradle.api.artifacts.repositories.MavenArtifactRepository
|
||||||
|
import org.gradle.api.artifacts.repositories.UrlArtifactRepository
|
||||||
|
import org.gradle.api.credentials.AwsCredentials
|
||||||
import org.gradle.api.internal.artifacts.repositories.ResolutionAwareRepository
|
import org.gradle.api.internal.artifacts.repositories.ResolutionAwareRepository
|
||||||
import org.gradle.api.internal.artifacts.repositories.resolver.IvyResolver
|
import org.gradle.api.internal.artifacts.repositories.resolver.IvyResolver
|
||||||
import org.gradle.api.logging.Logger
|
import org.gradle.api.logging.Logger
|
||||||
import org.gradle.api.logging.Logging
|
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.io.IOException
|
||||||
|
import java.net.URI
|
||||||
import org.apache.ivy.core.module.descriptor.Artifact as IvyArtifact
|
import org.apache.ivy.core.module.descriptor.Artifact as IvyArtifact
|
||||||
import org.apache.ivy.core.module.descriptor.DefaultArtifact as IvyDefaultArtifact
|
import org.apache.ivy.core.module.descriptor.DefaultArtifact as IvyDefaultArtifact
|
||||||
import org.apache.ivy.plugins.resolver.RepositoryResolver as IvyRepositoryResolver
|
import org.apache.ivy.plugins.resolver.RepositoryResolver as IvyRepositoryResolver
|
||||||
@@ -66,12 +81,23 @@ internal class MavenResolver(
|
|||||||
isM2compatible = true
|
isM2compatible = true
|
||||||
settings = ivySettings
|
settings = ivySettings
|
||||||
setCache(cacheManager(project, scope, ivySettings, repository).name)
|
setCache(cacheManager(project, scope, ivySettings, repository).name)
|
||||||
|
setRepository(resolverRepository(repository))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun resolve(artifactId: DefaultArtifactIdentifier, sha256: String?): DefaultArtifact? {
|
override fun resolve(artifactId: DefaultArtifactIdentifier, sha256: String?): DefaultArtifact? {
|
||||||
val ivyArtifact: IvyArtifact = artifactId.toArtifact()
|
val ivyArtifact: IvyArtifact = artifactId.toArtifact()
|
||||||
val origin = ivyResolver.locate(ivyArtifact)?.takeIf(ArtifactOrigin::isExists) ?: return null
|
val origin = ivyResolver.locate(ivyArtifact)
|
||||||
val hash = sha256 ?: ivyResolver.download(origin, downloadOptions).localFile?.sha256() ?: return null
|
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 {
|
val snapshotVersion: SnapshotVersion? = artifactId.version.snapshotVersion()?.let {
|
||||||
findSnapshotVersion(artifactId, it)
|
findSnapshotVersion(artifactId, it)
|
||||||
}
|
}
|
||||||
@@ -91,9 +117,9 @@ internal class MavenResolver(
|
|||||||
snapshotVersion: SnapshotVersion
|
snapshotVersion: SnapshotVersion
|
||||||
): SnapshotVersion {
|
): SnapshotVersion {
|
||||||
if (snapshotVersion.timestamp != null) return 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(
|
val metadataFile = ivyResolver.repositoryCacheManager.downloadRepositoryResource(
|
||||||
URLResource(metadataLocation, ivyResolver.timeoutConstraint),
|
ivyResolver.repository.getResource(metadataLocation),
|
||||||
"maven-metadata",
|
"maven-metadata",
|
||||||
"maven-metadata",
|
"maven-metadata",
|
||||||
"xml",
|
"xml",
|
||||||
@@ -142,12 +168,22 @@ internal class IvyResolver(
|
|||||||
for (p in ivyResolver.artifactPatterns) addArtifactPattern(p)
|
for (p in ivyResolver.artifactPatterns) addArtifactPattern(p)
|
||||||
settings = ivySettings
|
settings = ivySettings
|
||||||
setCache(cacheManager(project, scope, ivySettings, repository).name)
|
setCache(cacheManager(project, scope, ivySettings, repository).name)
|
||||||
|
setRepository(resolverRepository(repository))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun resolve(artifactId: DefaultArtifactIdentifier, sha256: String?): DefaultArtifact? {
|
override fun resolve(artifactId: DefaultArtifactIdentifier, sha256: String?): DefaultArtifact? {
|
||||||
val ivyArtifact: IvyArtifact = artifactId.toArtifact()
|
val ivyArtifact: IvyArtifact = artifactId.toArtifact()
|
||||||
val origin = ivyResolver.locate(ivyArtifact)?.takeIf(ArtifactOrigin::isExists) ?: return null
|
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(
|
return DefaultArtifact(
|
||||||
id = DefaultArtifactIdentifier(artifactId),
|
id = DefaultArtifactIdentifier(artifactId),
|
||||||
name = artifactId.filename(null),
|
name = artifactId.filename(null),
|
||||||
@@ -167,7 +203,9 @@ private fun cacheManager(
|
|||||||
return DefaultRepositoryCacheManager(
|
return DefaultRepositoryCacheManager(
|
||||||
"${scope.name.toLowerCase()}-${repository.name}-cache",
|
"${scope.name.toLowerCase()}-${repository.name}-cache",
|
||||||
ivySettings,
|
ivySettings,
|
||||||
project.buildDir.resolve("tmp/gradle2nix/${scope.name.toLowerCase()}/${repository.name}")
|
project.buildDir.resolve("tmp/gradle2nix/${repository.name}").also {
|
||||||
|
it.mkdirs()
|
||||||
|
}
|
||||||
).also {
|
).also {
|
||||||
ivySettings.addRepositoryCacheManager(it)
|
ivySettings.addRepositoryCacheManager(it)
|
||||||
}
|
}
|
||||||
@@ -223,4 +261,57 @@ private fun ArtifactIdentifier.filename(
|
|||||||
append(".", extension)
|
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 : ArtifactRepository,
|
||||||
|
T : AuthenticationSupported =
|
||||||
|
when (val scheme = repository.url.scheme) {
|
||||||
|
"s3" -> s3Repository(
|
||||||
|
repository.getCredentials(AwsCredentials::class),
|
||||||
|
LazyTimeoutConstraint(this)
|
||||||
|
)
|
||||||
|
"http", "https" -> URLRepository(LazyTimeoutConstraint(this))
|
||||||
|
else -> throw IllegalStateException("Unknown repository URL scheme: $scheme")
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun s3Repository(
|
||||||
|
credentials: AwsCredentials?,
|
||||||
|
timeoutConstraint: TimeoutConstraint
|
||||||
|
): Repository {
|
||||||
|
val awsCredentials = credentials?.let {
|
||||||
|
if (it.sessionToken == null) {
|
||||||
|
BasicAWSCredentials(it.accessKey, it.secretKey)
|
||||||
|
} else {
|
||||||
|
BasicSessionCredentials(it.accessKey, it.secretKey, it.sessionToken)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return S3Repository(
|
||||||
|
credentials = awsCredentials,
|
||||||
|
endpoint = System.getProperty("org.gradle.s3.endpoint")?.let { URI(it) },
|
||||||
|
timeoutConstraint = timeoutConstraint
|
||||||
|
).apply {
|
||||||
|
name = "AWS S3"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class LazyTimeoutConstraint(
|
||||||
|
private val resolver: AbstractResolver
|
||||||
|
) : TimeoutConstraint {
|
||||||
|
override fun getConnectionTimeout(): Int =
|
||||||
|
resolver.timeoutConstraint?.connectionTimeout ?: -1
|
||||||
|
|
||||||
|
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}")
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nixos.gradle2nix
|
package org.nixos.gradle2nix
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import java.net.URI
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
import java.security.MessageDigest
|
import java.security.MessageDigest
|
||||||
|
|
||||||
@@ -19,3 +20,5 @@ private fun ByteArray.sha256() = buildString {
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal fun String.toUrl(): URL = URL(this)
|
internal fun String.toUrl(): URL = URL(this)
|
||||||
|
|
||||||
|
internal fun String.toUri(): URI = URI(this)
|
||||||
|
|||||||
@@ -1,3 +1,44 @@
|
|||||||
|
@file:Suppress("UnstableApiUsage")
|
||||||
|
|
||||||
enableFeaturePreview("ONE_LOCKFILE_PER_PROJECT")
|
enableFeaturePreview("ONE_LOCKFILE_PER_PROJECT")
|
||||||
|
|
||||||
include(":app", ":model", ":plugin")
|
pluginManagement {
|
||||||
|
val shadowVersion: String by settings
|
||||||
|
val stutterVersion: String by settings
|
||||||
|
|
||||||
|
resolutionStrategy {
|
||||||
|
eachPlugin {
|
||||||
|
when (requested.id.id) {
|
||||||
|
"com.github.johnrengelman.shadow" -> useVersion(shadowVersion)
|
||||||
|
"org.ajoberstar.stutter" -> useVersion(stutterVersion)
|
||||||
|
}
|
||||||
|
when (requested.id.namespace) {
|
||||||
|
"org.jetbrains.kotlin",
|
||||||
|
"org.jetbrains.kotlin.plugin" -> useVersion(embeddedKotlinVersion)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
kotlin("jvm") apply false
|
||||||
|
kotlin("kapt") apply false
|
||||||
|
id("com.github.johnrengelman.shadow") apply false
|
||||||
|
id("org.ajoberstar.stutter") apply false
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
maven { url = uri("https://repo.gradle.org/gradle/libs-releases") }
|
||||||
|
}
|
||||||
|
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
|
||||||
|
}
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
configurations.classpath {
|
||||||
|
resolutionStrategy.activateDependencyLocking()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
include(":app", ":ivy", ":model", ":plugin")
|
||||||
|
|||||||
Reference in New Issue
Block a user