11 Commits

Author SHA1 Message Date
Tad Fisher
7c02e63afa Add extraInit and buildJdk args 2020-12-01 16:44:44 -08:00
Tad Fisher
fd6a6f4693 Resolve and apply settings buildscript dependencies 2020-11-24 16:35:48 -08:00
Tad Fisher
a99b5f40e3 Ignore Gradle cache when hashing metadata artifacts 2020-11-23 14:29:14 -08:00
Tad Fisher
beb157cf18 Update build; improve caching; improve tests 2020-11-22 19:32:18 -08:00
Tad Fisher
2ad217b878 Merge pull request #24 from Mic92/fix-docs
Merge lenient configs
2020-10-23 00:16:10 -07:00
Jörg Thalheim
e05b6382ca gradle-env: fix example usage 2020-10-23 09:01:09 +02:00
Tad Fisher
b88ee98da2 Merge pull request #19 from eyJhb/buildscript-fix
fix init file not working on buildSrc
2020-08-06 14:00:49 -07:00
eyjhb
59e8130e64 fix init file not working on buildSrc 2020-08-01 13:41:51 +02:00
Tad Fisher
dd5d60e835 Fix dependency resolution for plugins in buildSrc 2020-04-27 17:42:58 -07:00
Tad Fisher
23cb225ccf Fix native-platform jar detection 2020-04-27 13:09:41 -07:00
Tad Fisher
c949f19891 Bump dependencies 2020-04-27 12:45:06 -07:00
103 changed files with 5335 additions and 1915 deletions

View File

@@ -4,6 +4,7 @@ plugins {
kotlin("jvm") kotlin("jvm")
kotlin("kapt") kotlin("kapt")
application application
idea
} }
dependencies { dependencies {
@@ -18,10 +19,15 @@ dependencies {
implementation("com.squareup.moshi:moshi-kotlin:latest.release") implementation("com.squareup.moshi:moshi-kotlin:latest.release")
kapt("com.squareup.moshi:moshi-kotlin-codegen:latest.release") kapt("com.squareup.moshi:moshi-kotlin-codegen:latest.release")
implementation("com.squareup.okio:okio:latest.release") implementation("com.squareup.okio:okio:latest.release")
testRuntimeOnly(kotlin("reflect"))
testImplementation("org.spekframework.spek2:spek-dsl-jvm:latest.release")
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:latest.release")
testImplementation("io.strikt:strikt-core:latest.release")
} }
application { application {
mainClassName = "org.nixos.gradle2nix.MainKt" mainClass.set("org.nixos.gradle2nix.MainKt")
applicationName = "gradle2nix" applicationName = "gradle2nix"
applicationDefaultJvmArgs += "-Dorg.nixos.gradle2nix.share=@APP_HOME@/share" applicationDefaultJvmArgs += "-Dorg.nixos.gradle2nix.share=@APP_HOME@/share"
applicationDistribution applicationDistribution
@@ -30,11 +36,19 @@ application {
.rename("plugin.*\\.jar", "plugin.jar") .rename("plugin.*\\.jar", "plugin.jar")
} }
sourceSets {
test {
resources {
srcDir("$rootDir/fixtures")
}
}
}
tasks { tasks {
(run) { (run) {
dependsOn(installDist) dependsOn(installDist)
doFirst { doFirst {
jvmArgs = listOf("-Dorg.nixos.gradle2nix.share=${installDist.get().destinationDir.resolve("share")}") systemProperties("org.nixos.gradle2nix.share" to installDist.get().destinationDir.resolve("share"))
} }
} }
@@ -45,9 +59,28 @@ tasks {
} }
} }
test {
dependsOn(installDist)
doFirst {
systemProperties("org.nixos.gradle2nix.share" to installDist.get().destinationDir.resolve("share"))
}
useJUnitPlatform {
includeEngines("spek2")
}
testLogging {
events("passed", "skipped", "failed")
}
}
withType<KotlinCompile> { withType<KotlinCompile> {
kotlinOptions { kotlinOptions {
jvmTarget = "1.8" jvmTarget = "1.8"
} }
} }
idea {
module {
}
}
} }

33
app/gradle.lockfile Normal file
View File

@@ -0,0 +1,33 @@
# 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.christophsturm:filepeek:0.1.2=testRuntimeClasspath
com.github.ajalt:clikt:2.8.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:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.squareup.okio:okio:2.9.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
io.github.classgraph:classgraph:4.8.37=testRuntimeClasspath
io.strikt:strikt-core:0.28.0=testCompileClasspath,testRuntimeClasspath
net.swiftzer.semver:semver:1.1.1=runtimeClasspath,testRuntimeClasspath
org.apiguardian:apiguardian-api:1.1.0=testRuntimeClasspath
org.gradle:gradle-tooling-api:6.8-milestone-3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-reflect:1.4.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib:1.4.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.3=testRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.3.9=testRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9=testRuntimeClasspath
org.jetbrains:annotations:13.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-commons:1.6.0=testRuntimeClasspath
org.junit.platform:junit-platform-engine:1.6.0=testRuntimeClasspath
org.junit:junit-bom:5.6.0=testRuntimeClasspath
org.opentest4j:opentest4j:1.2.0=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.spekframework.spek2:spek-dsl-jvm:2.0.14=testCompileClasspath,testRuntimeClasspath
org.spekframework.spek2:spek-runner-junit5:2.0.14=testRuntimeClasspath
org.spekframework.spek2:spek-runtime-jvm:2.0.14=testRuntimeClasspath
empty=

View File

@@ -1,16 +0,0 @@
# 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.github.ajalt:clikt:2.3.0
com.squareup.moshi:moshi-adapters:1.9.2
com.squareup.moshi:moshi-kotlin:1.9.2
com.squareup.moshi:moshi:1.9.2
com.squareup.okio:okio:2.4.3
org.gradle:gradle-tooling-api:6.1
org.jetbrains.kotlin:kotlin-reflect:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61
org.jetbrains.kotlin:kotlin-stdlib:1.3.61
org.jetbrains:annotations:13.0
org.slf4j:slf4j-api:2.0.0-alpha1

View File

@@ -1,18 +0,0 @@
# 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.github.ajalt:clikt:2.3.0
com.squareup.moshi:moshi-adapters:1.9.2
com.squareup.moshi:moshi-kotlin:1.9.2
com.squareup.moshi:moshi:1.9.2
com.squareup.okio:okio:2.4.3
net.swiftzer.semver:semver:1.1.1
org.gradle:gradle-tooling-api:6.1
org.jetbrains.kotlin:kotlin-reflect:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61
org.jetbrains.kotlin:kotlin-stdlib:1.3.61
org.jetbrains:annotations:13.0
org.slf4j:slf4j-api:2.0.0-alpha1
org.slf4j:slf4j-simple:2.0.0-alpha1

View File

@@ -1,16 +0,0 @@
# 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.github.ajalt:clikt:2.3.0
com.squareup.moshi:moshi-adapters:1.9.2
com.squareup.moshi:moshi-kotlin:1.9.2
com.squareup.moshi:moshi:1.9.2
com.squareup.okio:okio:2.4.3
org.gradle:gradle-tooling-api:6.1
org.jetbrains.kotlin:kotlin-reflect:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61
org.jetbrains.kotlin:kotlin-stdlib:1.3.61
org.jetbrains:annotations:13.0
org.slf4j:slf4j-api:2.0.0-alpha1

View File

@@ -1,18 +0,0 @@
# 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.github.ajalt:clikt:2.3.0
com.squareup.moshi:moshi-adapters:1.9.2
com.squareup.moshi:moshi-kotlin:1.9.2
com.squareup.moshi:moshi:1.9.2
com.squareup.okio:okio:2.4.3
net.swiftzer.semver:semver:1.1.1
org.gradle:gradle-tooling-api:6.1
org.jetbrains.kotlin:kotlin-reflect:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61
org.jetbrains.kotlin:kotlin-stdlib:1.3.61
org.jetbrains:annotations:13.0
org.slf4j:slf4j-api:2.0.0-alpha1
org.slf4j:slf4j-simple:2.0.0-alpha1

View File

@@ -4,7 +4,7 @@
# #
# with (import <nixpkgs> {}); # with (import <nixpkgs> {});
# let # let
# buildGradle = callPackage ./gradleEnv.nix {}; # buildGradle = callPackage ./gradle-env.nix {};
# in # in
# buildGradle { # buildGradle {
# envSpec = ./gradle-env.json; # envSpec = ./gradle-env.json;
@@ -21,23 +21,33 @@
{ stdenv, buildEnv, fetchurl, gradleGen, writeText, writeTextDir }: { stdenv, buildEnv, fetchurl, gradleGen, writeText, writeTextDir }:
{ envSpec {
# Path to the environment spec generated by gradle2nix (e.g. gradle-env.json).
envSpec
, pname ? null , pname ? null
, version ? null , version ? null
, enableParallelBuilding ? true , enableParallelBuilding ? true
# Arguments to Gradle used to build the project in buildPhase.
, gradleFlags ? [ "build" ] , gradleFlags ? [ "build" ]
# Gradle package to use instead of the one generated by gradle2nix.
, gradlePackage ? null , 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 , 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: , ... } @ args:
let let
inherit (builtins) inherit (builtins)
filter sort replaceStrings attrValues match fromJSON attrValues concatStringsSep filter fromJSON match replaceStrings sort;
concatStringsSep;
inherit (stdenv.lib) inherit (stdenv.lib)
versionOlder unique mapAttrs last concatMapStringsSep removeSuffix assertMsg concatMapStringsSep groupBy' hasSuffix last mapAttrs
optionalString groupBy' readFile hasSuffix; mapAttrsToList optionalString readFile removeSuffix unique versionAtLeast
versionOlder;
mkDep = depSpec: stdenv.mkDerivation { mkDep = depSpec: stdenv.mkDerivation {
inherit (depSpec) name; inherit (depSpec) name;
@@ -176,10 +186,20 @@ let
paths = map mkDep deps ++ mkModuleMetadata deps ++ mkSnapshotMetadata deps; paths = map mkDep deps ++ mkModuleMetadata deps ++ mkSnapshotMetadata deps;
}; };
mkInitScript = projectSpec: mkInitScript = projectSpec: gradle:
let let
repos = mapAttrs (mkRepo projectSpec.name) projectSpec.dependencies; repos = mapAttrs (mkRepo projectSpec.name) projectSpec.dependencies;
hasDependencies = mapAttrs (type: deps: deps != []) projectSpec.dependencies;
in 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" '' writeText "init.gradle" ''
static def offlineRepo(RepositoryHandler repositories, String env, String path) { static def offlineRepo(RepositoryHandler repositories, String env, String path) {
repositories.clear() repositories.clear()
@@ -204,18 +224,37 @@ let
} }
} }
gradle.settingsEvaluated { ${optionalString (hasDependencies.settings && (versionAtLeast gradle.version "6.0")) ''
offlineRepo(it.pluginManagement.repositories, "plugin", "${repos.plugin}") gradle.beforeSettings {
} offlineRepo(it.buildscript.repositories, "settings", "${repos.settings}")
}
''}
gradle.projectsLoaded { ${optionalString (hasDependencies.plugin) ''
allprojects { gradle.settingsEvaluated {
buildscript { offlineRepo(it.pluginManagement.repositories, "plugin", "${repos.plugin}")
offlineRepo(repositories, "buildscript", "${repos.buildscript}") }
} ''}
offlineRepo(repositories, "project", "${repos.project}")
} ${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: mkGradle = gradleSpec:
@@ -227,12 +266,14 @@ let
src = fetchurl { src = fetchurl {
inherit (gradleSpec) url sha256; inherit (gradleSpec) url sha256;
}; };
} // {
inherit (gradleSpec) version;
}; };
mkProjectEnv = projectSpec: { mkProjectEnv = projectSpec: rec {
inherit (projectSpec) name version; inherit (projectSpec) name path version;
initScript = mkInitScript projectSpec;
gradle = args.gradlePackage or mkGradle projectSpec.gradle; gradle = args.gradlePackage or mkGradle projectSpec.gradle;
initScript = mkInitScript projectSpec gradle;
}; };
gradleEnv = mapAttrs gradleEnv = mapAttrs
@@ -243,6 +284,24 @@ let
pname = args.pname or projectEnv.name; pname = args.pname or projectEnv.name;
version = args.version or projectEnv.version; 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 // { in stdenv.mkDerivation (args // {
inherit pname version; inherit pname version;
@@ -253,15 +312,16 @@ in stdenv.mkDerivation (args // {
runHook preBuild runHook preBuild
( (
set -x set -eux
env \
"GRADLE_USER_HOME=$(mktemp -d)" \ # use the init script here
gradle --offline --no-daemon --no-build-cache \ TMPHOME=$(mktemp -d)
--info --full-stacktrace --warning-mode=all \ mkdir -p $TMPHOME/init.d
${optionalString enableParallelBuilding "--parallel"} \ cp ${projectEnv.initScript} $TMPHOME/init.d
${optionalString enableDebug "-Dorg.gradle.debug=true"} \
--init-script ${projectEnv.initScript} \ export "GRADLE_USER_HOME=$TMPHOME"
${concatStringsSep " " gradleFlags} ${buildIncludedProjects}
${buildRootProject}
) )
runHook postBuild runHook postBuild

View File

@@ -19,6 +19,7 @@ fun buildEnv(builds: Map<String, DefaultBuild>): Map<String, NixGradleEnv> =
path = path, path = path,
gradle = build.gradle, gradle = build.gradle,
dependencies = mapOf( dependencies = mapOf(
"settings" to build.settingsDependencies,
"plugin" to build.pluginDependencies, "plugin" to build.pluginDependencies,
"buildscript" to build.rootProject.collectDependencies(DefaultProject::buildscriptDependencies), "buildscript" to build.rootProject.collectDependencies(DefaultProject::buildscriptDependencies),
"project" to build.rootProject.collectDependencies(DefaultProject::projectDependencies) "project" to build.rootProject.collectDependencies(DefaultProject::projectDependencies)

View File

@@ -24,7 +24,6 @@ fun ProjectConnection.getBuildModel(config: Config, path: String): DefaultBuild
if (config.gradleArgs != null) addArguments(config.gradleArgs) if (config.gradleArgs != null) addArguments(config.gradleArgs)
if (path.isNotEmpty()) addArguments("--project-dir=$path") if (path.isNotEmpty()) addArguments("--project-dir=$path")
if (!config.quiet) { if (!config.quiet) {
setColorOutput(true)
setStandardOutput(System.err) setStandardOutput(System.err)
setStandardError(System.err) setStandardError(System.err)
} }

View File

@@ -12,7 +12,6 @@ import com.github.ajalt.clikt.parameters.options.default
import com.github.ajalt.clikt.parameters.options.flag import com.github.ajalt.clikt.parameters.options.flag
import com.github.ajalt.clikt.parameters.options.multiple import com.github.ajalt.clikt.parameters.options.multiple
import com.github.ajalt.clikt.parameters.options.option import com.github.ajalt.clikt.parameters.options.option
import com.github.ajalt.clikt.parameters.options.split
import com.github.ajalt.clikt.parameters.options.validate import com.github.ajalt.clikt.parameters.options.validate
import com.github.ajalt.clikt.parameters.types.file import com.github.ajalt.clikt.parameters.types.file
import com.squareup.moshi.Moshi import com.squareup.moshi.Moshi
@@ -55,7 +54,7 @@ class Main : CliktCommand(
private val includes: List<File> by option("--include", "-i", private val includes: List<File> by option("--include", "-i",
metavar = "DIR", metavar = "DIR",
help = "Add an additional project to include") help = "Add an additional project to include")
.file(exists = true, fileOkay = false, folderOkay = true, readable = true) .file(mustExist = true, canBeFile = false, canBeDir = true, mustBeReadable = true)
.multiple() .multiple()
.validate { files -> .validate { files ->
val failures = files.filterNot { it.isProjectRoot() } val failures = files.filterNot { it.isProjectRoot() }
@@ -79,12 +78,12 @@ class Main : CliktCommand(
} }
} }
private val outDir: File? by option("--out-dir", "-o", val outDir: File? by option("--out-dir", "-o",
metavar = "DIR", metavar = "DIR",
help = "Path to write generated files (default: PROJECT-DIR)") help = "Path to write generated files (default: PROJECT-DIR)")
.file(fileOkay = false, folderOkay = true) .file(canBeFile = false, canBeDir = true)
private val envFile: String by option("--env", "-e", val envFile: String by option("--env", "-e",
metavar = "FILENAME", metavar = "FILENAME",
help = "Prefix for environment files (.json and .nix)") help = "Prefix for environment files (.json and .nix)")
.default("gradle-env") .default("gradle-env")
@@ -105,8 +104,11 @@ class Main : CliktCommand(
} }
} }
// Visible for testing
lateinit var config: Config
override fun run() { override fun run() {
val config = Config( config = Config(
gradleVersion, gradleVersion,
gradleArgs, gradleArgs,
configurations, configurations,

View File

@@ -0,0 +1,19 @@
package org.nixos.gradle2nix
import org.spekframework.spek2.Spek
import org.spekframework.spek2.style.specification.describe
import strikt.api.expectThat
import strikt.assertions.containsKey
object BuildSrcTest : Spek({
fixture("buildsrc/plugin-in-buildsrc/kotlin")
val fixture: Fixture by memoized()
describe("project with plugin in buildSrc") {
fixture.run()
it("should include buildSrc in gradle env", timeout = 0) {
expectThat(fixture.env()).containsKey("buildSrc")
}
}
})

View File

@@ -0,0 +1,57 @@
package org.nixos.gradle2nix
import com.squareup.moshi.Moshi
import com.squareup.moshi.Types
import okio.buffer
import okio.source
import org.spekframework.spek2.dsl.Root
import strikt.api.expectThat
import strikt.assertions.exists
import strikt.assertions.isNotNull
import strikt.assertions.toPath
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths
private val moshi = Moshi.Builder().build()
class Fixture(val project: Path) {
private val app = Main()
fun run(vararg args: String) {
app.main(args.toList() + project.toString())
}
fun env(): Map<String, NixGradleEnv> {
val file = (app.outDir ?: project.toFile()).resolve("${app.envFile}.json")
expectThat(file).toPath().exists()
val env = file.source().buffer().use { source ->
moshi
.adapter<Map<String, NixGradleEnv>>(
Types.newParameterizedType(Map::class.java, String::class.java, NixGradleEnv::class.java)
).fromJson(source)
}
expectThat(env).isNotNull()
return env!!
}
}
fun Root.fixture(name: String) {
val fixture by memoized(
factory = {
val url = checkNotNull(Thread.currentThread().contextClassLoader.getResource(name)?.toURI()) {
"$name: No test fixture found"
}
val fixtureRoot = Paths.get(url)
val dest = createTempDir("gradle2nix").toPath()
val src = checkNotNull(fixtureRoot.takeIf { Files.exists(it) }) {
"$name: Test fixture not found: $fixtureRoot"
}
src.toFile().copyRecursively(dest.toFile())
Fixture(dest)
},
destructor = {
it.project.toFile().deleteRecursively()
}
)
}

View File

@@ -36,12 +36,11 @@ allprojects {
tasks.register("lock") { tasks.register("lock") {
doFirst { doFirst {
assert(gradle.startParameter.isWriteDependencyLocks) assert(gradle.startParameter.isWriteDependencyLocks)
file("buildscript-gradle.lockfile").delete()
file("gradle.lockfile").delete()
} }
doLast { doLast {
sourceSets.all { configurations.matching { it.isCanBeResolved}.all { resolve() }
configurations[compileClasspathConfigurationName].resolve()
configurations[runtimeClasspathConfigurationName].resolve()
}
} }
} }
} }
@@ -50,7 +49,7 @@ allprojects {
tasks { tasks {
wrapper { wrapper {
gradleVersion = "6.1" gradleVersion = "6.8-milestone-3"
distributionType = Wrapper.DistributionType.ALL distributionType = Wrapper.DistributionType.ALL
} }
} }

View File

@@ -3,17 +3,36 @@
with pkgs; with pkgs;
let let
buildGradle = pkgs.callPackage ./gradle-env.nix {}; buildGradle = callPackage ./gradle-env.nix {};
in buildGradle { gradle2nix = buildGradle {
envSpec = ./gradle-env.json; envSpec = ./gradle-env.json;
src = ./.; src = lib.cleanSourceWith {
filter = lib.cleanSourceFilter;
src = lib.cleanSourceWith {
filter = path: type: let baseName = baseNameOf path; in !(
(type == "directory" && (
baseName == "build" ||
baseName == ".idea" ||
baseName == ".gradle"
)) ||
(lib.hasSuffix ".iml" baseName)
);
src = ./.;
};
};
gradleFlags = [ "installDist" ]; gradleFlags = [ "installDist" ];
installPhase = '' installPhase = ''
mkdir -p $out mkdir -p $out
cp -r app/build/install/gradle2nix/* $out/ cp -r app/build/install/gradle2nix/* $out/
''; '';
}
passthru = {
plugin = "${gradle2nix}/share/plugin.jar";
};
};
in gradle2nix

View File

@@ -0,0 +1,4 @@
plugins {
`java-library`
id("com.example.custom-spotless")
}

View File

@@ -0,0 +1,12 @@
plugins {
`kotlin-dsl`
}
repositories {
jcenter()
gradlePluginPortal()
}
dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:3.28.1")
}

View File

@@ -0,0 +1,11 @@
package com.example
plugins {
com.diffplug.gradle.spotless
}
spotless {
kotlin {
ktlint()
}
}

View File

@@ -0,0 +1,12 @@
plugins {
java
}
repositories {
maven { url = uri("http://localhost:9999") }
}
dependencies {
implementation(platform("io.micrometer:micrometer-bom:1.5.1"))
implementation("io.micrometer:micrometer-core")
}

View File

@@ -0,0 +1,11 @@
plugins {
id "java"
}
repositories {
maven { url = uri("http://localhost:9999") }
}
dependencies {
implementation "org.apache:test-SNAPSHOT1:2.0.2-SNAPSHOT"
}

View File

@@ -0,0 +1,11 @@
plugins {
java
}
repositories {
maven { url = uri("http://localhost:9999") }
}
dependencies {
"implementation"("org.apache:test-SNAPSHOT1:2.0.2-SNAPSHOT")
}

View File

@@ -3,10 +3,9 @@ plugins {
} }
repositories { repositories {
mavenCentral() maven { url = uri("http://localhost:9999") }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
} }
dependencies { dependencies {
implementation "com.squareup.okio:okio:2.5.0-SNAPSHOT" implementation "org.apache:test-SNAPSHOT2:2.0.2-SNAPSHOT"
} }

View File

@@ -3,10 +3,9 @@ plugins {
} }
repositories { repositories {
mavenCentral() maven { url = uri("http://localhost:9999") }
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }
} }
dependencies { dependencies {
"implementation"("com.squareup.okio:okio:2.5.0-SNAPSHOT") "implementation"("org.apache:test-SNAPSHOT2:2.0.2-SNAPSHOT")
} }

View File

@@ -0,0 +1 @@
version = '1.1.0'

View File

@@ -0,0 +1,9 @@
with (import <nixpkgs> {});
let
buildGradle = callPackage ./gradle-env.nix {};
in
buildGradle {
envSpec = ./gradle-env.json;
src = ./.;
gradleFlags = [ "tasks" ];
}

View File

@@ -0,0 +1,456 @@
{
"": {
"name": "settings-buildscript",
"version": "1.1.0",
"path": "",
"gradle": {
"version": "5.0",
"type": "bin",
"url": "https://services.gradle.org/distributions/gradle-5.0-bin.zip",
"sha256": "6157ac9f3410bc63644625b3b3e9e96c963afd7910ae0697792db57813ee79a6",
"nativeVersion": "0.14"
},
"dependencies": {
"settings": [
{
"id": {
"group": "com.googlecode.javaewah",
"name": "JavaEWAH",
"version": "1.1.6",
"type": "jar",
"extension": "jar"
},
"name": "JavaEWAH-1.1.6.jar",
"path": "com/googlecode/javaewah/JavaEWAH/1.1.6",
"urls": [
"https://plugins.gradle.org/m2/com/googlecode/javaewah/JavaEWAH/1.1.6/JavaEWAH-1.1.6.jar"
],
"sha256": "f78d44a1e3877f1ce748b4a85df5171e5e8e9a5c3c6f63bb9003db6f84cce952"
},
{
"id": {
"group": "com.googlecode.javaewah",
"name": "JavaEWAH",
"version": "1.1.6",
"type": "pom",
"extension": "pom"
},
"name": "JavaEWAH-1.1.6.pom",
"path": "com/googlecode/javaewah/JavaEWAH/1.1.6",
"urls": [
"https://plugins.gradle.org/m2/com/googlecode/javaewah/JavaEWAH/1.1.6/JavaEWAH-1.1.6.pom"
],
"sha256": "7f4ff919b1ee17bf3776e058a3f20e6173db23a5e44cf2d107ec7570c186abf0"
},
{
"id": {
"group": "com.jcraft",
"name": "jsch",
"version": "0.1.54",
"type": "jar",
"extension": "jar"
},
"name": "jsch-0.1.54.jar",
"path": "com/jcraft/jsch/0.1.54",
"urls": [
"https://plugins.gradle.org/m2/com/jcraft/jsch/0.1.54/jsch-0.1.54.jar"
],
"sha256": "92eb273a3316762478fdd4fe03a0ce1842c56f496c9c12fe1235db80450e1fdb"
},
{
"id": {
"group": "com.jcraft",
"name": "jsch",
"version": "0.1.54",
"type": "pom",
"extension": "pom"
},
"name": "jsch-0.1.54.pom",
"path": "com/jcraft/jsch/0.1.54",
"urls": [
"https://plugins.gradle.org/m2/com/jcraft/jsch/0.1.54/jsch-0.1.54.pom"
],
"sha256": "ab8f512039be7f6ae20e18e743b4a9d8a20958494431917da58ae5aaef8a3478"
},
{
"id": {
"group": "commons-codec",
"name": "commons-codec",
"version": "1.6",
"type": "jar",
"extension": "jar"
},
"name": "commons-codec-1.6.jar",
"path": "commons-codec/commons-codec/1.6",
"urls": [
"https://plugins.gradle.org/m2/commons-codec/commons-codec/1.6/commons-codec-1.6.jar"
],
"sha256": "54b34e941b8e1414bd3e40d736efd3481772dc26db3296f6aa45cec9f6203d86"
},
{
"id": {
"group": "commons-codec",
"name": "commons-codec",
"version": "1.6",
"type": "pom",
"extension": "pom"
},
"name": "commons-codec-1.6.pom",
"path": "commons-codec/commons-codec/1.6",
"urls": [
"https://plugins.gradle.org/m2/commons-codec/commons-codec/1.6/commons-codec-1.6.pom"
],
"sha256": "a06e35d3fff3a6b813d94894ebf3e498f9540c864c5b39ae783907e3a6c72889"
},
{
"id": {
"group": "commons-logging",
"name": "commons-logging",
"version": "1.1.3",
"type": "jar",
"extension": "jar"
},
"name": "commons-logging-1.1.3.jar",
"path": "commons-logging/commons-logging/1.1.3",
"urls": [
"https://plugins.gradle.org/m2/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar"
],
"sha256": "70903f6fc82e9908c8da9f20443f61d90f0870a312642991fe8462a0b9391784"
},
{
"id": {
"group": "commons-logging",
"name": "commons-logging",
"version": "1.1.3",
"type": "pom",
"extension": "pom"
},
"name": "commons-logging-1.1.3.pom",
"path": "commons-logging/commons-logging/1.1.3",
"urls": [
"https://plugins.gradle.org/m2/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.pom"
],
"sha256": "3250ac3ac6bd60ed0631f5cd0335032b2993d63e405a6ae0555d27a7e4865849"
},
{
"id": {
"group": "gradle.plugin.net.vivin",
"name": "gradle-semantic-build-versioning",
"version": "4.0.0",
"type": "jar",
"extension": "jar"
},
"name": "gradle-semantic-build-versioning-4.0.0.jar",
"path": "gradle/plugin/net/vivin/gradle-semantic-build-versioning/4.0.0",
"urls": [
"https://plugins.gradle.org/m2/gradle/plugin/net/vivin/gradle-semantic-build-versioning/4.0.0/gradle-semantic-build-versioning-4.0.0.jar"
],
"sha256": "5138e67ce8e019437800b93c9f6f9d0fcbebefadc96fbc4ebc0975c99a261ef8"
},
{
"id": {
"group": "gradle.plugin.net.vivin",
"name": "gradle-semantic-build-versioning",
"version": "4.0.0",
"type": "pom",
"extension": "pom"
},
"name": "gradle-semantic-build-versioning-4.0.0.pom",
"path": "gradle/plugin/net/vivin/gradle-semantic-build-versioning/4.0.0",
"urls": [
"https://plugins.gradle.org/m2/gradle/plugin/net/vivin/gradle-semantic-build-versioning/4.0.0/gradle-semantic-build-versioning-4.0.0.pom"
],
"sha256": "4f2828741607ed102d95eb5f189d496c7840ed463acea89f1e51a60567714ef7"
},
{
"id": {
"group": "org.apache",
"name": "apache",
"version": "9",
"type": "pom",
"extension": "pom"
},
"name": "apache-9.pom",
"path": "org/apache/apache/9",
"urls": [
"https://plugins.gradle.org/m2/org/apache/apache/9/apache-9.pom"
],
"sha256": "4946e60a547c8eda69f3bc23c5b6f0dadcf8469ea49b1d1da7de34aecfcf18dd"
},
{
"id": {
"group": "org.apache",
"name": "apache",
"version": "13",
"type": "pom",
"extension": "pom"
},
"name": "apache-13.pom",
"path": "org/apache/apache/13",
"urls": [
"https://plugins.gradle.org/m2/org/apache/apache/13/apache-13.pom"
],
"sha256": "ff513db0361fd41237bef4784968bc15aae478d4ec0a9496f811072ccaf3841d"
},
{
"id": {
"group": "org.apache.commons",
"name": "commons-parent",
"version": "22",
"type": "pom",
"extension": "pom"
},
"name": "commons-parent-22.pom",
"path": "org/apache/commons/commons-parent/22",
"urls": [
"https://plugins.gradle.org/m2/org/apache/commons/commons-parent/22/commons-parent-22.pom"
],
"sha256": "fb8c5e55e30a7addb4ff210858a0e8d2494ed6757bbe19012da99d51586c3cbb"
},
{
"id": {
"group": "org.apache.commons",
"name": "commons-parent",
"version": "28",
"type": "pom",
"extension": "pom"
},
"name": "commons-parent-28.pom",
"path": "org/apache/commons/commons-parent/28",
"urls": [
"https://plugins.gradle.org/m2/org/apache/commons/commons-parent/28/commons-parent-28.pom"
],
"sha256": "14733a68e8b120b69de60cd96d222146dcf32f03c1c6cc6a750b1269bafe86c7"
},
{
"id": {
"group": "org.apache.httpcomponents",
"name": "httpclient",
"version": "4.3.6",
"type": "jar",
"extension": "jar"
},
"name": "httpclient-4.3.6.jar",
"path": "org/apache/httpcomponents/httpclient/4.3.6",
"urls": [
"https://plugins.gradle.org/m2/org/apache/httpcomponents/httpclient/4.3.6/httpclient-4.3.6.jar"
],
"sha256": "79838d9eaef73d4f852c63a480830c3a2d4b590f0ab3ae815a489463e4714004"
},
{
"id": {
"group": "org.apache.httpcomponents",
"name": "httpclient",
"version": "4.3.6",
"type": "pom",
"extension": "pom"
},
"name": "httpclient-4.3.6.pom",
"path": "org/apache/httpcomponents/httpclient/4.3.6",
"urls": [
"https://plugins.gradle.org/m2/org/apache/httpcomponents/httpclient/4.3.6/httpclient-4.3.6.pom"
],
"sha256": "d02634f6131e914961c02aa836711ebac72704b27e26c5bd223bbad89b1b64c3"
},
{
"id": {
"group": "org.apache.httpcomponents",
"name": "httpcomponents-client",
"version": "4.3.6",
"type": "pom",
"extension": "pom"
},
"name": "httpcomponents-client-4.3.6.pom",
"path": "org/apache/httpcomponents/httpcomponents-client/4.3.6",
"urls": [
"https://plugins.gradle.org/m2/org/apache/httpcomponents/httpcomponents-client/4.3.6/httpcomponents-client-4.3.6.pom"
],
"sha256": "4ada2827b496339826891c7c81dceba647029de6fc1888b16b3cab5650abcc63"
},
{
"id": {
"group": "org.apache.httpcomponents",
"name": "httpcomponents-core",
"version": "4.3.3",
"type": "pom",
"extension": "pom"
},
"name": "httpcomponents-core-4.3.3.pom",
"path": "org/apache/httpcomponents/httpcomponents-core/4.3.3",
"urls": [
"https://plugins.gradle.org/m2/org/apache/httpcomponents/httpcomponents-core/4.3.3/httpcomponents-core-4.3.3.pom"
],
"sha256": "c16e2fc0d49ba7a02cef5b5e2600585a9f673553328a6f9e58f24296df1dd031"
},
{
"id": {
"group": "org.apache.httpcomponents",
"name": "httpcore",
"version": "4.3.3",
"type": "jar",
"extension": "jar"
},
"name": "httpcore-4.3.3.jar",
"path": "org/apache/httpcomponents/httpcore/4.3.3",
"urls": [
"https://plugins.gradle.org/m2/org/apache/httpcomponents/httpcore/4.3.3/httpcore-4.3.3.jar"
],
"sha256": "5285de80af1651c489313b91a9f40c65a4cdcb6b3bde716fcc028d16869a5a93"
},
{
"id": {
"group": "org.apache.httpcomponents",
"name": "httpcore",
"version": "4.3.3",
"type": "pom",
"extension": "pom"
},
"name": "httpcore-4.3.3.pom",
"path": "org/apache/httpcomponents/httpcore/4.3.3",
"urls": [
"https://plugins.gradle.org/m2/org/apache/httpcomponents/httpcore/4.3.3/httpcore-4.3.3.pom"
],
"sha256": "b427f7cf67c75a4e3f9e2108d35bf45303573c145ec778fcadcffacef17a1264"
},
{
"id": {
"group": "org.apache.httpcomponents",
"name": "project",
"version": "7",
"type": "pom",
"extension": "pom"
},
"name": "project-7.pom",
"path": "org/apache/httpcomponents/project/7",
"urls": [
"https://plugins.gradle.org/m2/org/apache/httpcomponents/project/7/project-7.pom"
],
"sha256": "3d6eba428555a558de046b5d76eacc1f5a54b4f5f20b84d636ed7aff18aa48c3"
},
{
"id": {
"group": "org.eclipse.jgit",
"name": "org.eclipse.jgit",
"version": "4.8.0.201706111038-r",
"type": "jar",
"extension": "jar"
},
"name": "org.eclipse.jgit-4.8.0.201706111038-r.jar",
"path": "org/eclipse/jgit/org.eclipse.jgit/4.8.0.201706111038-r",
"urls": [
"https://plugins.gradle.org/m2/org/eclipse/jgit/org.eclipse.jgit/4.8.0.201706111038-r/org.eclipse.jgit-4.8.0.201706111038-r.jar"
],
"sha256": "49d912e8d5cce0dd08dca3d390189db8692a8f7e3363cdbbe182581462000aba"
},
{
"id": {
"group": "org.eclipse.jgit",
"name": "org.eclipse.jgit",
"version": "4.8.0.201706111038-r",
"type": "pom",
"extension": "pom"
},
"name": "org.eclipse.jgit-4.8.0.201706111038-r.pom",
"path": "org/eclipse/jgit/org.eclipse.jgit/4.8.0.201706111038-r",
"urls": [
"https://plugins.gradle.org/m2/org/eclipse/jgit/org.eclipse.jgit/4.8.0.201706111038-r/org.eclipse.jgit-4.8.0.201706111038-r.pom"
],
"sha256": "a556a9f5adfc6af49b2a12e72dc3cd7e43db8fdc216c0f35885972a2f5ada27d"
},
{
"id": {
"group": "org.eclipse.jgit",
"name": "org.eclipse.jgit-parent",
"version": "4.8.0.201706111038-r",
"type": "pom",
"extension": "pom"
},
"name": "org.eclipse.jgit-parent-4.8.0.201706111038-r.pom",
"path": "org/eclipse/jgit/org.eclipse.jgit-parent/4.8.0.201706111038-r",
"urls": [
"https://plugins.gradle.org/m2/org/eclipse/jgit/org.eclipse.jgit-parent/4.8.0.201706111038-r/org.eclipse.jgit-parent-4.8.0.201706111038-r.pom"
],
"sha256": "396a4cc894206873ff107d066a996252b0b47f585b88cf57fc3b31e93d492878"
},
{
"id": {
"group": "org.slf4j",
"name": "slf4j-api",
"version": "1.7.2",
"type": "jar",
"extension": "jar"
},
"name": "slf4j-api-1.7.2.jar",
"path": "org/slf4j/slf4j-api/1.7.2",
"urls": [
"https://plugins.gradle.org/m2/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.jar"
],
"sha256": "3bae789b401333b2a1d1603b7fa573e19908628191707203f6eb708cdee2c052"
},
{
"id": {
"group": "org.slf4j",
"name": "slf4j-api",
"version": "1.7.2",
"type": "pom",
"extension": "pom"
},
"name": "slf4j-api-1.7.2.pom",
"path": "org/slf4j/slf4j-api/1.7.2",
"urls": [
"https://plugins.gradle.org/m2/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.pom"
],
"sha256": "2eaca71afe0a1516f4abd8e9ff907838d268f38c81c3a542cce8d7f3b87c5d4c"
},
{
"id": {
"group": "org.slf4j",
"name": "slf4j-parent",
"version": "1.7.2",
"type": "pom",
"extension": "pom"
},
"name": "slf4j-parent-1.7.2.pom",
"path": "org/slf4j/slf4j-parent/1.7.2",
"urls": [
"https://plugins.gradle.org/m2/org/slf4j/slf4j-parent/1.7.2/slf4j-parent-1.7.2.pom"
],
"sha256": "1d8e084a6f2384ade42685332b52a0ece090478641dc14c0fa8c52e1e2984425"
},
{
"id": {
"group": "org.sonatype.oss",
"name": "oss-parent",
"version": "5",
"type": "pom",
"extension": "pom"
},
"name": "oss-parent-5.pom",
"path": "org/sonatype/oss/oss-parent/5",
"urls": [
"https://plugins.gradle.org/m2/org/sonatype/oss/oss-parent/5/oss-parent-5.pom"
],
"sha256": "1678d4120a585d8a630131aeec4c524d928398583b7eab616ee7d5a87f520d3d"
},
{
"id": {
"group": "org.sonatype.oss",
"name": "oss-parent",
"version": "6",
"type": "pom",
"extension": "pom"
},
"name": "oss-parent-6.pom",
"path": "org/sonatype/oss/oss-parent/6",
"urls": [
"https://plugins.gradle.org/m2/org/sonatype/oss/oss-parent/6/oss-parent-6.pom"
],
"sha256": "b4306d13e8f5392458a1b30866f1cff161b3d2e6999a88d059eea3932c8a8499"
}
],
"plugin": [],
"buildscript": [],
"project": []
}
}
}

View File

@@ -0,0 +1,318 @@
# 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 }:
{ envSpec
, pname ? null
, version ? null
, enableParallelBuilding ? true
, gradleFlags ? [ "build" ]
, gradlePackage ? null
, enableDebug ? false
, ... } @ 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}")
}
}
''}
'';
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"} \
--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 -x
# 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;
})

View File

@@ -0,0 +1 @@
startingVersion = '1.0.0'

View File

@@ -0,0 +1,14 @@
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'gradle.plugin.net.vivin:gradle-semantic-build-versioning:4.0.0'
}
}
rootProject.name = "settings-buildscript"
//apply plugin: 'net.vivin.gradle-semantic-build-versioning'

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
~ Copyright 2020 the original author or authors.
~
~ Licensed 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
~
~ http://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 modelVersion="1.0.0">
<groupId>com.github.anuken</groupId>
<artifactId>packr</artifactId>
<version>-packr-1.2-g034efe5-114</version>
<versioning>
<snapshot>
<timestamp>packr-1.2-g034efe5</timestamp>
<buildNumber>114</buildNumber>
</snapshot>
</versioning>
</metadata>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.anuken</groupId>
<artifactId>packr</artifactId>
<version>-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.zeroturnaround</groupId>
<artifactId>zt-zip</artifactId>
<version>1.10</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.eclipsesource.minimal-json</groupId>
<artifactId>minimal-json</artifactId>
<version>0.9.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.lexicalscope.jewelcli</groupId>
<artifactId>jewelcli</artifactId>
<version>0.8.9</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.6</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
~ Copyright 2020 the original author or authors.
~
~ Licensed 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
~
~ http://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 modelVersion="1.0.0">
<groupId>com.github.anuken</groupId>
<artifactId>packr</artifactId>
<versioning>
<release>packr-1.2</release>
<versions>
<version>packr-1.2</version>
</versions>
</versioning>
</metadata>

View File

@@ -0,0 +1,3 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Thu Sep 24 11:23:49 PDT 2020
micrometer-bom-1.5.1.pom>maven-public=

View File

@@ -0,0 +1,174 @@
cp <?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">
<modelVersion>4.0.0</modelVersion>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-bom</artifactId>
<version>1.5.1</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-jersey2</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-appoptics</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-atlas</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-azure-monitor</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-cloudwatch</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-cloudwatch2</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-datadog</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-dynatrace</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-elastic</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-ganglia</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-graphite</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-humio</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-influx</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-jmx</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-kairos</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-new-relic</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-opentsdb</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-signalfx</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-stackdriver</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-statsd</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-wavefront</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-test</artifactId>
<version>1.5.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<name>micrometer-bom</name>
<description>Micrometer BOM (Bill of Materials) for managing Micrometer artifact versions</description>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<nebula_Manifest_Version>1.0</nebula_Manifest_Version>
<nebula_Implementation_Title>io.micrometer#micrometer-bom;1.5.1</nebula_Implementation_Title>
<nebula_Implementation_Version>1.5.1</nebula_Implementation_Version>
<nebula_Built_Status>release</nebula_Built_Status>
<nebula_Built_By>circleci</nebula_Built_By>
<nebula_Built_OS>Linux</nebula_Built_OS>
<nebula_Build_Date>2020-05-08_16:43:24</nebula_Build_Date>
<nebula_Gradle_Version>6.4</nebula_Gradle_Version>
<nebula_Module_Source>/micrometer-bom</nebula_Module_Source>
<nebula_Module_Origin>git@github.com:micrometer-metrics/micrometer.git</nebula_Module_Origin>
<nebula_Change>5984c10</nebula_Change>
<nebula_Branch>5984c10fc12b781652e27a9ea95c439f96e73cf8</nebula_Branch>
<nebula_Build_Host>82db0d896427</nebula_Build_Host>
<nebula_Build_Job>LOCAL</nebula_Build_Job>
<nebula_Build_Number>LOCAL</nebula_Build_Number>
<nebula_Build_Id>LOCAL</nebula_Build_Id>
<nebula_Created_By>14.0.1+7 (Oracle Corporation)</nebula_Created_By>
<nebula_Build_Java_Version>14.0.1</nebula_Build_Java_Version>
<nebula_Module_Owner>tludwig@vmware.com</nebula_Module_Owner>
<nebula_Module_Email>tludwig@vmware.com</nebula_Module_Email>
</properties>
<url>https://github.com/micrometer-metrics/micrometer</url>
<scm>
<url>git@github.com:micrometer-metrics/micrometer.git</url>
</scm>
<developers>
<developer>
<id>shakuzen</id>
<name>Tommy Ludwig</name>
<email>tludwig@vmware.com</email>
</developer>
</developers>
</project>

View File

@@ -0,0 +1 @@
fb57aac12f2370e7115ab8af5265322397cae49e

View File

@@ -0,0 +1,4 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Sat Nov 21 19:26:36 PST 2020
micrometer-core-1.5.1.jar>central=
micrometer-core-1.5.1.pom>central=

View File

@@ -0,0 +1 @@
f58ddf32310729011f6c2171fbe1a085b4336b2f

View File

@@ -0,0 +1,239 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId>
<version>1.5.1</version>
<dependencies>
<dependency>
<groupId>org.hdrhistogram</groupId>
<artifactId>HdrHistogram</artifactId>
<version>2.1.12</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.latencyutils</groupId>
<artifactId>LatencyUtils</artifactId>
<version>2.0.3</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<artifactId>HdrHistogram</artifactId>
<groupId>org.hdrhistogram</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
<version>4.0.7</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>29.0-jre</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>2.8.2</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.10.6</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
<version>4.0.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>6.0.0.Alpha5</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.4.28.v20200408</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-client</artifactId>
<version>9.4.28.v20200408</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>8.5.54</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.12</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpasyncclient</artifactId>
<version>4.1.4</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.netflix.hystrix</groupId>
<artifactId>hystrix-core</artifactId>
<version>1.5.12</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.2</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>3.3.5.RELEASE</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty</artifactId>
<version>0.9.7.RELEASE</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.14</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.5.0</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.12.3</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq</artifactId>
<version>3.13.1</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.5.0</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-streams</artifactId>
<version>2.5.0</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
<name>micrometer-core</name>
<description>Application monitoring instrumentation facade</description>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<nebula_Manifest_Version>1.0</nebula_Manifest_Version>
<nebula_Implementation_Title>io.micrometer#micrometer-core;1.5.1</nebula_Implementation_Title>
<nebula_Implementation_Version>1.5.1</nebula_Implementation_Version>
<nebula_Built_Status>integration</nebula_Built_Status>
<nebula_Built_By>circleci</nebula_Built_By>
<nebula_Built_OS>Linux</nebula_Built_OS>
<nebula_Build_Date>2020-05-08_16:43:25</nebula_Build_Date>
<nebula_Gradle_Version>6.4</nebula_Gradle_Version>
<nebula_Module_Source>/micrometer-core</nebula_Module_Source>
<nebula_Module_Origin>git@github.com:micrometer-metrics/micrometer.git</nebula_Module_Origin>
<nebula_Change>5984c10</nebula_Change>
<nebula_Branch>5984c10fc12b781652e27a9ea95c439f96e73cf8</nebula_Branch>
<nebula_Build_Host>82db0d896427</nebula_Build_Host>
<nebula_Build_Job>LOCAL</nebula_Build_Job>
<nebula_Build_Number>LOCAL</nebula_Build_Number>
<nebula_Build_Id>LOCAL</nebula_Build_Id>
<nebula_Created_By>14.0.1+7 (Oracle Corporation)</nebula_Created_By>
<nebula_Build_Java_Version>14.0.1</nebula_Build_Java_Version>
<nebula_Module_Owner>tludwig@vmware.com</nebula_Module_Owner>
<nebula_Module_Email>tludwig@vmware.com</nebula_Module_Email>
<nebula_X_Compile_Target_JDK>14</nebula_X_Compile_Target_JDK>
<nebula_X_Compile_Source_JDK>14</nebula_X_Compile_Source_JDK>
</properties>
<url>https://github.com/micrometer-metrics/micrometer</url>
<scm>
<url>git@github.com:micrometer-metrics/micrometer.git</url>
</scm>
<developers>
<developer>
<id>shakuzen</id>
<name>Tommy Ludwig</name>
<email>tludwig@vmware.com</email>
</developer>
</developers>
</project>

View File

@@ -0,0 +1 @@
e68ba4ca00f195e4aa6a5ccd78feef2d24c578ca

View File

@@ -0,0 +1,32 @@
<?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-SNAPSHOT1</artifactId>
<version>2.0.0-SNAPSHOT</version>
<versioning>
<snapshot>
<timestamp>20070310.181613</timestamp>
<buildNumber>3</buildNumber>
</snapshot>
<lastUpdated>20070310181754</lastUpdated>
</versioning>
</metadata>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<!--
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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache</groupId>
<artifactId>test-SNAPSHOT1</artifactId>
<name>Test Module for Ivy M2 parsing</name>
<version>2.0.0-SNAPSHOT</version>
</project>

View File

@@ -0,0 +1,32 @@
<?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-SNAPSHOT1</artifactId>
<version>2.0.2-SNAPSHOT</version>
<versioning>
<snapshot>
<timestamp>20070310.181613</timestamp>
<buildNumber>3</buildNumber>
</snapshot>
<lastUpdated>20070310181754</lastUpdated>
</versioning>
</metadata>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<!--
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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache</groupId>
<artifactId>test-SNAPSHOT1</artifactId>
<name>Test Module for Ivy M2 parsing</name>
<version>2.0.2-SNAPSHOT</version>
</project>

View File

@@ -0,0 +1,32 @@
<?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-SNAPSHOT1</artifactId>
<version>2.0.2-SNAPSHOT</version>
<versioning>
<versions>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.2-SNAPSHOT</version>
</versions>
<lastUpdated>20070310181754</lastUpdated>
</versioning>
</metadata>

View File

@@ -0,0 +1,30 @@
<?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-SNAPSHOT2</artifactId>
<version>2.0.2-SNAPSHOT</version>
<versioning>
<snapshot>
<buildNumber>3</buildNumber>
</snapshot>
<lastUpdated>20070310181754</lastUpdated>
</versioning>
</metadata>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<!--
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.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache</groupId>
<artifactId>test-SNAPSHOT2</artifactId>
<name>Test Module for Ivy M2 parsing</name>
<version>2.0.2-SNAPSHOT</version>
</project>

View File

@@ -0,0 +1,31 @@
<?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-SNAPSHOT2</artifactId>
<version>2.0.2-SNAPSHOT</version>
<versioning>
<versions>
<version>2.0.2-SNAPSHOT</version>
</versions>
<lastUpdated>20070310181754</lastUpdated>
</versioning>
</metadata>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache</groupId>
<artifactId>test</artifactId>
<version>1.0.0</version>
<name>test</name>
<description>
test
</description>
</project>

View File

@@ -0,0 +1,268 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.hdrhistogram</groupId>
<artifactId>HdrHistogram</artifactId>
<version>2.1.12</version>
<name>HdrHistogram</name>
<url>http://hdrhistogram.github.io/HdrHistogram/</url>
<description>
HdrHistogram supports the recording and analyzing sampled data value
counts across a configurable integer value range with configurable value
precision within the range. Value precision is expressed as the number of
significant digits in the value recording, and provides control over value
quantization behavior across the value range and the subsequent value
resolution at any given level.
</description>
<licenses>
<license>
<comments>
* This code was Written by Gil Tene of Azul Systems, and released to the
* public domain, as explained at http://creativecommons.org/publicdomain/zero/1.0/
</comments>
<name>Public Domain, per Creative Commons CC0</name>
<url>http://creativecommons.org/publicdomain/zero/1.0/</url>
</license>
<license>
<name>BSD-2-Clause</name>
<url>https://opensource.org/licenses/BSD-2-Clause</url>
</license>
</licenses>
<developers>
<developer>
<id>giltene</id>
<name>Gil Tene</name>
<url>https://github.com/giltene</url>
</developer>
</developers>
<scm>
<url>scm:git:git://github.com/HdrHistogram/HdrHistogram.git</url>
<connection>scm:git:git://github.com/HdrHistogram/HdrHistogram.git</connection>
<developerConnection>scm:git:git@github.com:HdrHistogram/HdrHistogram.git</developerConnection>
<tag>HdrHistogram-2.1.12</tag>
</scm>
<issueManagement>
<url>https://github.com/HdrHistogram/HdrHistogram/issues</url>
<system>GitHub Issues</system>
</issueManagement>
<packaging>bundle</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.template.file>src/main/java/org/HdrHistogram/Version.java.template</version.template.file>
<version.file>src/main/java/org/HdrHistogram/Version.java</version.file>
<junit.version>4.12</junit.version>
<junit.jupiter.version>5.5.2</junit.jupiter.version>
<junit.vintage.version>5.5.2</junit.vintage.version>
</properties>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.5.3</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<inherited>true</inherited>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0-M1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<enableAssertions>false</enableAssertions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>release</releaseProfiles>
<goals>deploy</goals>
</configuration>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>maven-replacer-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>${version.template.file}</file>
<outputFile>${version.file}</outputFile>
<replacements>
<replacement>
<token>\$BUILD_TIME\$</token>
<value>${maven.build.timestamp}</value>
</replacement>
<replacement>
<token>\$VERSION\$</token>
<value>${project.version}</value>
</replacement>
</replacements>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy-installed</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<type>${project.packaging}</type>
<destFileName>HdrHistogram.jar</destFileName>
</artifactItem>
</artifactItems>
<outputDirectory>${project.basedir}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.vintage.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,4 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Sat Nov 21 19:26:36 PST 2020
HdrHistogram-2.1.12.jar>central=
HdrHistogram-2.1.12.pom>central=

View File

@@ -0,0 +1 @@
769c0b82cb2421c8256300e907298a9410a2a3d3

View File

@@ -0,0 +1,198 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<groupId>org.latencyutils</groupId>
<artifactId>LatencyUtils</artifactId>
<version>2.0.3</version>
<name>LatencyUtils</name>
<url>http://latencyutils.github.io/LatencyUtils/</url>
<description>
LatencyUtils is a package that provides latency recording and reporting utilities.
</description>
<licenses>
<license>
<comments>
* This code was Written by Gil Tene of Azul Systems, and released to the
* public domain, as explained at http://creativecommons.org/publicdomain/zero/1.0/
</comments>
<name>Public Domain, per Creative Commons CC0</name>
<url>http://creativecommons.org/publicdomain/zero/1.0/</url>
</license>
</licenses>
<developers>
<developer>
<id>giltene</id>
<name>Gil Tene</name>
<url>https://github.com/giltene</url>
</developer>
</developers>
<scm>
<url>scm:git:git://github.com/LatencyUtils/LatencyUtils.git</url>
<connection>scm:git:git://github.com/LatencyUtils/LatencyUtils.git</connection>
<developerConnection>scm:git:git@github.com:LatencyUtils/LatencyUtils.git</developerConnection>
<tag>HEAD</tag>
</scm>
<issueManagement>
<url>https://github.com/LatencyUtils/LatencyUtils/issues</url>
<system>GitHub Issues</system>
</issueManagement>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<enableAssertions>false</enableAssertions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5</version>
<configuration>
<arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy-installed</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<type>${project.packaging}</type>
<destFileName>LatencyUtils.jar</destFileName>
</artifactItem>
</artifactItems>
<outputDirectory>${project.basedir}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.4</version>
<configuration>
<passphrase>${gpg.passphrase}</passphrase>
</configuration>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hdrhistogram</groupId>
<artifactId>HdrHistogram</artifactId>
<version>2.1.8</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1 @@
5baec26b6f9e5b17fdd200fc20af85eead4287c4

View File

@@ -0,0 +1,6 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Sat Nov 21 19:26:36 PST 2020
LatencyUtils-2.0.3.jar>central=
LatencyUtils-2.0.3.jar>maven-public=
LatencyUtils-2.0.3.pom>maven-public=
LatencyUtils-2.0.3.pom>central=

View File

@@ -0,0 +1,10 @@
buildscript {
repositories {
maven {
url 'http://localhost:9999/'
}
}
dependencies {
classpath 'org.apache:test:1.0.0'
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
# #
# with (import <nixpkgs> {}); # with (import <nixpkgs> {});
# let # let
# buildGradle = callPackage ./gradleEnv.nix {}; # buildGradle = callPackage ./gradle-env.nix {};
# in # in
# buildGradle { # buildGradle {
# envSpec = ./gradle-env.json; # envSpec = ./gradle-env.json;
@@ -21,23 +21,33 @@
{ stdenv, buildEnv, fetchurl, gradleGen, writeText, writeTextDir }: { stdenv, buildEnv, fetchurl, gradleGen, writeText, writeTextDir }:
{ envSpec {
# Path to the environment spec generated by gradle2nix (e.g. gradle-env.json).
envSpec
, pname ? null , pname ? null
, version ? null , version ? null
, enableParallelBuilding ? true , enableParallelBuilding ? true
# Arguments to Gradle used to build the project in buildPhase.
, gradleFlags ? [ "build" ] , gradleFlags ? [ "build" ]
# Gradle package to use instead of the one generated by gradle2nix.
, gradlePackage ? null , 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 , 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: , ... } @ args:
let let
inherit (builtins) inherit (builtins)
filter sort replaceStrings attrValues match fromJSON attrValues concatStringsSep filter fromJSON match replaceStrings sort;
concatStringsSep;
inherit (stdenv.lib) inherit (stdenv.lib)
versionOlder unique mapAttrs last concatMapStringsSep removeSuffix assertMsg concatMapStringsSep groupBy' hasSuffix last mapAttrs
optionalString groupBy' readFile hasSuffix; mapAttrsToList optionalString readFile removeSuffix unique versionAtLeast
versionOlder;
mkDep = depSpec: stdenv.mkDerivation { mkDep = depSpec: stdenv.mkDerivation {
inherit (depSpec) name; inherit (depSpec) name;
@@ -176,10 +186,20 @@ let
paths = map mkDep deps ++ mkModuleMetadata deps ++ mkSnapshotMetadata deps; paths = map mkDep deps ++ mkModuleMetadata deps ++ mkSnapshotMetadata deps;
}; };
mkInitScript = projectSpec: mkInitScript = projectSpec: gradle:
let let
repos = mapAttrs (mkRepo projectSpec.name) projectSpec.dependencies; repos = mapAttrs (mkRepo projectSpec.name) projectSpec.dependencies;
hasDependencies = mapAttrs (type: deps: deps != []) projectSpec.dependencies;
in 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" '' writeText "init.gradle" ''
static def offlineRepo(RepositoryHandler repositories, String env, String path) { static def offlineRepo(RepositoryHandler repositories, String env, String path) {
repositories.clear() repositories.clear()
@@ -204,18 +224,37 @@ let
} }
} }
gradle.settingsEvaluated { ${optionalString (hasDependencies.settings && (versionAtLeast gradle.version "6.0")) ''
offlineRepo(it.pluginManagement.repositories, "plugin", "${repos.plugin}") gradle.beforeSettings {
} offlineRepo(it.buildscript.repositories, "settings", "${repos.settings}")
}
''}
gradle.projectsLoaded { ${optionalString (hasDependencies.plugin) ''
allprojects { gradle.settingsEvaluated {
buildscript { offlineRepo(it.pluginManagement.repositories, "plugin", "${repos.plugin}")
offlineRepo(repositories, "buildscript", "${repos.buildscript}") }
} ''}
offlineRepo(repositories, "project", "${repos.project}")
} ${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: mkGradle = gradleSpec:
@@ -227,12 +266,14 @@ let
src = fetchurl { src = fetchurl {
inherit (gradleSpec) url sha256; inherit (gradleSpec) url sha256;
}; };
} // {
inherit (gradleSpec) version;
}; };
mkProjectEnv = projectSpec: { mkProjectEnv = projectSpec: rec {
inherit (projectSpec) name version; inherit (projectSpec) name path version;
initScript = mkInitScript projectSpec;
gradle = args.gradlePackage or mkGradle projectSpec.gradle; gradle = args.gradlePackage or mkGradle projectSpec.gradle;
initScript = mkInitScript projectSpec gradle;
}; };
gradleEnv = mapAttrs gradleEnv = mapAttrs
@@ -243,6 +284,24 @@ let
pname = args.pname or projectEnv.name; pname = args.pname or projectEnv.name;
version = args.version or projectEnv.version; 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 // { in stdenv.mkDerivation (args // {
inherit pname version; inherit pname version;
@@ -253,15 +312,16 @@ in stdenv.mkDerivation (args // {
runHook preBuild runHook preBuild
( (
set -x set -eux
env \
"GRADLE_USER_HOME=$(mktemp -d)" \ # use the init script here
gradle --offline --no-daemon --no-build-cache \ TMPHOME=$(mktemp -d)
--info --full-stacktrace --warning-mode=all \ mkdir -p $TMPHOME/init.d
${optionalString enableParallelBuilding "--parallel"} \ cp ${projectEnv.initScript} $TMPHOME/init.d
${optionalString enableDebug "-Dorg.gradle.debug=true"} \
--init-script ${projectEnv.initScript} \ export "GRADLE_USER_HOME=$TMPHOME"
${concatStringsSep " " gradleFlags} ${buildIncludedProjects}
${buildRootProject}
) )
runHook postBuild runHook postBuild

Binary file not shown.

View File

@@ -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.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-milestone-3-all.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

2
gradlew vendored
View File

@@ -82,6 +82,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"` APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"` JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath # We build the pattern for arguments to be converted via cygpath

25
gradlew.bat vendored
View File

@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init if "%ERRORLEVEL%" == "0" goto execute
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -51,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=% set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init if exist "%JAVA_EXE%" goto execute
echo. echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -61,28 +64,14 @@ echo location of your Java installation.
goto fail goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute :execute
@rem Setup the command line @rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle @rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell

13
model/gradle.lockfile Normal file
View File

@@ -0,0 +1,13 @@
# 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.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.squareup.okio:okio:1.17.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
net.swiftzer.semver:semver:1.1.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-reflect:1.4.10=compileClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10=compileClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10=compileClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10=compileClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib:1.4.10=compileClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains:annotations:13.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
empty=

View File

@@ -1,12 +0,0 @@
# 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.squareup.moshi:moshi:1.9.2
com.squareup.okio:okio:1.16.0
net.swiftzer.semver:semver:1.1.1
org.jetbrains.kotlin:kotlin-reflect:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61
org.jetbrains.kotlin:kotlin-stdlib:1.3.61
org.jetbrains:annotations:13.0

View File

@@ -1,6 +0,0 @@
# 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.squareup.moshi:moshi:1.9.2
com.squareup.okio:okio:1.16.0
net.swiftzer.semver:semver:1.1.1

View File

@@ -1,12 +0,0 @@
# 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.squareup.moshi:moshi:1.9.2
com.squareup.okio:okio:1.16.0
net.swiftzer.semver:semver:1.1.1
org.jetbrains.kotlin:kotlin-reflect:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61
org.jetbrains.kotlin:kotlin-stdlib:1.3.61
org.jetbrains:annotations:13.0

View File

@@ -1,12 +0,0 @@
# 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.squareup.moshi:moshi:1.9.2
com.squareup.okio:okio:1.16.0
net.swiftzer.semver:semver:1.1.1
org.jetbrains.kotlin:kotlin-reflect:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61
org.jetbrains.kotlin:kotlin-stdlib:1.3.61
org.jetbrains:annotations:13.0

View File

@@ -8,12 +8,14 @@ import java.lang.IllegalArgumentException
@JsonClass(generateAdapter = true) @JsonClass(generateAdapter = true)
data class DefaultBuild( data class DefaultBuild(
override val gradle: DefaultGradle, override val gradle: DefaultGradle,
override val settingsDependencies: List<DefaultArtifact>,
override val pluginDependencies: List<DefaultArtifact>, override val pluginDependencies: List<DefaultArtifact>,
override val rootProject: DefaultProject, override val rootProject: DefaultProject,
override val includedBuilds: List<DefaultIncludedBuild> override val includedBuilds: List<DefaultIncludedBuild>
) : Build, Serializable { ) : Build, Serializable {
constructor(model: Build) : this( constructor(model: Build) : this(
DefaultGradle(model.gradle), DefaultGradle(model.gradle),
model.settingsDependencies.map(::DefaultArtifact),
model.pluginDependencies.map(::DefaultArtifact), model.pluginDependencies.map(::DefaultArtifact),
DefaultProject(model.rootProject), DefaultProject(model.rootProject),
model.includedBuilds.map(::DefaultIncludedBuild) model.includedBuilds.map(::DefaultIncludedBuild)

View File

@@ -2,6 +2,7 @@ package org.nixos.gradle2nix
interface Build { interface Build {
val gradle: Gradle val gradle: Gradle
val settingsDependencies: List<Artifact>
val pluginDependencies: List<Artifact> val pluginDependencies: List<Artifact>
val rootProject: Project val rootProject: Project
val includedBuilds: List<IncludedBuild> val includedBuilds: List<IncludedBuild>

View File

@@ -1,10 +0,0 @@
# DO NOT MODIFY: Generated by Stutter plugin.
5.0
5.1.1
5.2.1
5.3.1
5.4.1
5.5.1
5.6.4
6.0.1
6.1

View File

@@ -1,17 +1,8 @@
# DO NOT MODIFY: Generated by Stutter plugin. # DO NOT MODIFY: Generated by Stutter plugin.
4.4.1 4.4.1
4.5.1
4.6
4.7
4.8.1
4.9
4.10.3 4.10.3
5.0 5.0
5.1.1
5.2.1
5.3.1
5.4.1
5.5.1
5.6.4 5.6.4
6.0.1 6.0.1
6.1 6.7.1
6.8-milestone-3

View File

@@ -47,6 +47,7 @@ dependencies {
compatTestImplementation(project(":model")) compatTestImplementation(project(":model"))
compatTestImplementation("io.strikt:strikt-core:latest.release") compatTestImplementation("io.strikt:strikt-core:latest.release")
compatTestImplementation("com.squareup.okio:okio:latest.release") compatTestImplementation("com.squareup.okio:okio:latest.release")
compatTestImplementation("io.javalin:javalin:latest.release")
} }
gradlePlugin { gradlePlugin {
@@ -65,6 +66,7 @@ kotlinDslPluginOptions {
} }
stutter { stutter {
isSparse = true
java(8) { java(8) {
compatibleRange("4.4") compatibleRange("4.4")
} }
@@ -79,6 +81,14 @@ tasks {
} }
withType<Test> { withType<Test> {
useJUnitPlatform() useJUnitPlatform {
includeEngines("junit-jupiter")
}
afterTest(KotlinClosure2<TestDescriptor, TestResult, Any>({ descriptor, result ->
// work around a bug in Gradle versions before 6.1, see https://github.com/junit-team/junit5/issues/2041
val test = descriptor as org.gradle.api.internal.tasks.testing.TestDescriptorInternal
println("[${test.classDisplayName}] > [${test.displayName}]: ${result.resultType}")
}))
} }
} }

View File

@@ -0,0 +1,36 @@
# 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.github.gundy:semver4j:0.16.4=classpath
com.google.code.gson:gson:2.8.5=classpath
de.undercouch:gradle-download-task:4.0.2=classpath
org.antlr:antlr4-runtime:4.5.2-1=classpath
org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:1.4.2=classpath
org.gradle.kotlin:gradle-kotlin-dsl-plugins:1.4.2=classpath
org.jetbrains.intellij.deps:trove4j:1.0.20181211=classpath
org.jetbrains.kotlin:kotlin-android-extensions:1.4.10=classpath
org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.4.10=classpath
org.jetbrains.kotlin:kotlin-build-common:1.4.10=classpath
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.10=classpath
org.jetbrains.kotlin:kotlin-compiler-runner:1.4.10=classpath
org.jetbrains.kotlin:kotlin-daemon-client:1.4.10=classpath
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.4.10=classpath
org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.4.10=classpath
org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.4.10=classpath
org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10=classpath
org.jetbrains.kotlin:kotlin-reflect:1.4.10=classpath
org.jetbrains.kotlin:kotlin-sam-with-receiver:1.4.10=classpath
org.jetbrains.kotlin:kotlin-script-runtime:1.4.10=classpath
org.jetbrains.kotlin:kotlin-scripting-common:1.4.10=classpath
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.4.10=classpath
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.4.10=classpath
org.jetbrains.kotlin:kotlin-scripting-jvm:1.4.10=classpath
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10=classpath
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10=classpath
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10=classpath
org.jetbrains.kotlin:kotlin-stdlib:1.4.10=classpath
org.jetbrains.kotlin:kotlin-util-io:1.4.10=classpath
org.jetbrains.kotlin:kotlin-util-klib:1.4.10=classpath
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7=classpath
org.jetbrains:annotations:13.0=classpath
empty=

69
plugin/gradle.lockfile Normal file
View File

@@ -0,0 +1,69 @@
# 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.christophsturm:filepeek:0.1.2=compatTestRuntimeClasspath
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:1.17.5=compileClasspath,default,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.squareup.okio:okio:2.9.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
dev.minutest:minutest:1.11.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
io.github.classgraph:classgraph:4.8.28=compatTestRuntimeClasspath
io.javalin:javalin:3.12.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
io.strikt:strikt-core:0.28.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
javax.servlet:javax.servlet-api:3.1.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
net.swiftzer.semver:semver:1.1.1=compatTestRuntimeClasspath,default,runtimeClasspath,testRuntimeClasspath
org.apache.ivy:ivy:2.5.0=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.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.eclipse.jetty.websocket:websocket-client:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty.websocket:websocket-common:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty.websocket:websocket-server:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty.websocket:websocket-servlet:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-client:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-http:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-io:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-security:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-server:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-servlet:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-util:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-webapp:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.eclipse.jetty:jetty-xml:9.4.31.v20200723=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.gradle:gradle-tooling-api:6.8-milestone-3=compileClasspath,compileOnly,compileOnlyDependenciesMetadata
org.jetbrains.intellij.deps:trove4j:1.0.20181211=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.4.10=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath
org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.4.10=kotlinCompilerPluginClasspath
org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.4.10=kotlinCompilerPluginClasspath
org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:1.4.10=kotlinKlibCommonizerClasspath
org.jetbrains.kotlin:kotlin-reflect:1.4.10=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-sam-with-receiver:1.4.10=kotlinCompilerPluginClasspath
org.jetbrains.kotlin:kotlin-script-runtime:1.4.10=kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath
org.jetbrains.kotlin:kotlin-scripting-common:1.4.10=kotlinCompilerPluginClasspath
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.4.10=kotlinCompilerPluginClasspath
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.4.10=kotlinCompilerPluginClasspath
org.jetbrains.kotlin:kotlin-scripting-jvm:1.4.10=kotlinCompilerPluginClasspath
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib:1.4.10=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-test-annotations-common:1.4.10=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.jetbrains.kotlin:kotlin-test-common:1.4.10=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.jetbrains.kotlin:kotlin-test-junit5:1.4.10=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.jetbrains.kotlin:kotlin-test:1.4.10=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.3.9=compatTestRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7=kotlinCompilerPluginClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9=compatTestRuntimeClasspath
org.jetbrains:annotations:13.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compileClasspath,compileOnly,compileOnlyDependenciesMetadata,embeddedKotlin,kotlinCompilerClasspath,kotlinCompilerPluginClasspath,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.junit.jupiter:junit-jupiter-api:5.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.junit.jupiter:junit-jupiter-engine:5.7.0=compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.junit.jupiter:junit-jupiter-params:5.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
org.junit.platform:junit-platform-commons:1.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.junit.platform:junit-platform-engine:1.7.0=compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.junit.platform:junit-platform-launcher:1.7.0=compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.junit:junit-bom:5.7.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.opentest4j:opentest4j:1.2.0=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath,compatTestRuntimeOnlyDependenciesMetadata
org.slf4j:slf4j-api:1.7.28=compileClasspath,compileOnly,compileOnlyDependenciesMetadata
org.slf4j:slf4j-api:1.7.30=compatTestCompileClasspath,compatTestImplementationDependenciesMetadata,compatTestRuntimeClasspath
empty=annotationProcessor,apiDependenciesMetadata,archives,compatTestAnnotationProcessor,compatTestApiDependenciesMetadata,compatTestCompile,compatTestCompileOnly,compatTestCompileOnlyDependenciesMetadata,compatTestKotlinScriptDef,compatTestKotlinScriptDefExtensions,compatTestRuntime,compile,kotlinNativeCompilerPluginClasspath,kotlinScriptDef,kotlinScriptDefExtensions,runtime,runtimeOnlyDependenciesMetadata,shadow,testAnnotationProcessor,testApiDependenciesMetadata,testCompile,testCompileOnly,testCompileOnlyDependenciesMetadata,testKotlinScriptDef,testKotlinScriptDefExtensions,testRuntime,testRuntimeOnlyDependenciesMetadata

View File

@@ -1,37 +0,0 @@
# 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.google.code.gson:gson:2.8.5
commons-codec:commons-codec:1.9
commons-logging:commons-logging:1.2
de.undercouch:gradle-download-task:3.4.3
org.apache.httpcomponents:httpclient:4.5.3
org.apache.httpcomponents:httpcore:4.4.6
org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:1.3.3
org.gradle.kotlin:plugins:1.3.3
org.jetbrains.intellij.deps:trove4j:1.0.20181211
org.jetbrains.kotlin:kotlin-android-extensions:1.3.61
org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.3.61
org.jetbrains.kotlin:kotlin-build-common:1.3.61
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.61
org.jetbrains.kotlin:kotlin-compiler-runner:1.3.61
org.jetbrains.kotlin:kotlin-daemon-client:1.3.61
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.3.61
org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.3.61
org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.3.61
org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61
org.jetbrains.kotlin:kotlin-native-utils:1.3.61
org.jetbrains.kotlin:kotlin-reflect:1.3.61
org.jetbrains.kotlin:kotlin-sam-with-receiver:1.3.61
org.jetbrains.kotlin:kotlin-script-runtime:1.3.61
org.jetbrains.kotlin:kotlin-scripting-common:1.3.61
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.3.61
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.3.61
org.jetbrains.kotlin:kotlin-scripting-jvm:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61
org.jetbrains.kotlin:kotlin-stdlib:1.3.61
org.jetbrains.kotlin:kotlin-util-io:1.3.61
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.1
org.jetbrains:annotations:13.0

View File

@@ -1,23 +0,0 @@
# 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.squareup.moshi:moshi:1.9.2
com.squareup.okio:okio:2.4.3
dev.minutest:minutest:1.10.0
io.strikt:strikt-core:0.23.4
org.apiguardian:apiguardian-api:1.1.0
org.jetbrains.kotlin:kotlin-reflect:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61
org.jetbrains.kotlin:kotlin-stdlib:1.3.61
org.jetbrains.kotlin:kotlin-test-annotations-common:1.3.61
org.jetbrains.kotlin:kotlin-test-common:1.3.61
org.jetbrains.kotlin:kotlin-test-junit5:1.3.61
org.jetbrains.kotlin:kotlin-test:1.3.61
org.jetbrains:annotations:13.0
org.junit.jupiter:junit-jupiter-api:5.6.0
org.junit.jupiter:junit-jupiter-params:5.6.0
org.junit.platform:junit-platform-commons:1.6.0
org.junit:junit-bom:5.6.0
org.opentest4j:opentest4j:1.2.0

View File

@@ -1,30 +0,0 @@
# 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.christophsturm:filepeek:0.1.1
com.squareup.moshi:moshi:1.9.2
com.squareup.okio:okio:2.4.3
dev.minutest:minutest:1.10.0
io.github.classgraph:classgraph:4.8.28
io.strikt:strikt-core:0.23.4
net.swiftzer.semver:semver:1.1.1
org.apiguardian:apiguardian-api:1.1.0
org.jetbrains.kotlin:kotlin-reflect:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61
org.jetbrains.kotlin:kotlin-stdlib:1.3.61
org.jetbrains.kotlin:kotlin-test-annotations-common:1.3.61
org.jetbrains.kotlin:kotlin-test-common:1.3.61
org.jetbrains.kotlin:kotlin-test-junit5:1.3.61
org.jetbrains.kotlin:kotlin-test:1.3.61
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3
org.jetbrains:annotations:13.0
org.junit.jupiter:junit-jupiter-api:5.6.0
org.junit.jupiter:junit-jupiter-engine:5.6.0
org.junit.jupiter:junit-jupiter-params:5.6.0
org.junit.platform:junit-platform-commons:1.6.0
org.junit.platform:junit-platform-engine:1.6.0
org.junit.platform:junit-platform-launcher:1.6.0
org.junit:junit-bom:5.6.0
org.opentest4j:opentest4j:1.2.0

View File

@@ -1,15 +0,0 @@
# 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.squareup.moshi:moshi:1.9.2
com.squareup.okio:okio:1.16.0
org.apache.ivy:ivy:2.5.0
org.apache.maven:maven-repository-metadata:3.6.3
org.codehaus.plexus:plexus-utils:3.2.1
org.gradle:gradle-tooling-api:6.1
org.jetbrains.kotlin:kotlin-reflect:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61
org.jetbrains.kotlin:kotlin-stdlib:1.3.61
org.jetbrains:annotations:13.0

View File

@@ -1,9 +0,0 @@
# 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.squareup.moshi:moshi:1.9.2
com.squareup.okio:okio:1.16.0
net.swiftzer.semver:semver:1.1.1
org.apache.ivy:ivy:2.5.0
org.apache.maven:maven-repository-metadata:3.6.3
org.codehaus.plexus:plexus-utils:3.2.1

View File

@@ -1,14 +0,0 @@
# 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.squareup.moshi:moshi:1.9.2
com.squareup.okio:okio:1.16.0
org.apache.ivy:ivy:2.5.0
org.apache.maven:maven-repository-metadata:3.6.3
org.codehaus.plexus:plexus-utils:3.2.1
org.jetbrains.kotlin:kotlin-reflect:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61
org.jetbrains.kotlin:kotlin-stdlib:1.3.61
org.jetbrains:annotations:13.0

View File

@@ -1,15 +0,0 @@
# 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.squareup.moshi:moshi:1.9.2
com.squareup.okio:okio:1.16.0
net.swiftzer.semver:semver:1.1.1
org.apache.ivy:ivy:2.5.0
org.apache.maven:maven-repository-metadata:3.6.3
org.codehaus.plexus:plexus-utils:3.2.1
org.jetbrains.kotlin:kotlin-reflect:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.61
org.jetbrains.kotlin:kotlin-stdlib:1.3.61
org.jetbrains:annotations:13.0

View File

@@ -1,6 +1,7 @@
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 org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.BINTRAY_JCENTER_URL import org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.BINTRAY_JCENTER_URL
@@ -18,7 +19,7 @@ import strikt.assertions.startsWith
class BasicTest : JUnit5Minutests { class BasicTest : JUnit5Minutests {
@Tests @Tests
fun tests() = rootContext<Fixture>("basic tests") { fun tests() = rootContext("basic tests") {
withFixture("basic/basic-java-project") { withFixture("basic/basic-java-project") {
test("builds basic java project") { test("builds basic java project") {
expectThat(build()) { expectThat(build()) {
@@ -57,12 +58,13 @@ class BasicTest : JUnit5Minutests {
} }
withFixture("basic/basic-kotlin-project") { withFixture("basic/basic-kotlin-project") {
test("excludes embedded kotlin repo") { GRADLE_MIN("4.9") - test("excludes embedded kotlin repo") {
expectThat(build()) { expectThat(build()) {
get("all dependencies") { get("all dependencies") {
pluginDependencies + pluginDependencies +
rootProject.buildscriptDependencies + rootProject.buildscriptDependencies +
rootProject.projectDependencies rootProject.projectDependencies
}.flatMap { it.urls }.all { not { startsWith("file:") } } }.flatMap { it.urls }.all { not { startsWith("file:") } }
} }
} }

View File

@@ -1,67 +1,99 @@
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 strikt.api.expectThat import strikt.api.expectThat
import strikt.assertions.all import strikt.assertions.all
import strikt.assertions.contains
import strikt.assertions.containsExactly import strikt.assertions.containsExactly
import strikt.assertions.filter import strikt.assertions.filter
import strikt.assertions.isEqualTo import strikt.assertions.isEqualTo
import strikt.assertions.isNotEqualTo
import strikt.assertions.isNotNull import strikt.assertions.isNotNull
import strikt.assertions.single import strikt.assertions.isNull
import strikt.assertions.startsWith
class DependencyTest : JUnit5Minutests { class DependencyTest : JUnit5Minutests {
@Tests @Tests
fun tests() = rootContext<Fixture>("dependency tests") { fun tests() = rootContext("dependency tests") {
withFixture("dependency/classifier") { withRepository("m2") {
test("resolves dependency with classifier") {
expectThat(build()) { withFixture("dependency/classifier") {
get("root project dependencies") { rootProject.projectDependencies }.ids.containsExactly( test("resolves dependency with classifier") {
"com.badlogicgames.gdx:gdx-parent:1.9.9@pom", expectThat(build()) {
"com.badlogicgames.gdx:gdx-platform:1.9.9:natives-desktop@jar", get("root project dependencies") { rootProject.projectDependencies }.ids.containsExactly(
"com.badlogicgames.gdx:gdx-platform:1.9.9@pom", "com.badlogicgames.gdx:gdx-parent:1.9.9@pom",
"org.sonatype.oss:oss-parent:5@pom" "com.badlogicgames.gdx:gdx-platform:1.9.9:natives-desktop@jar",
) "com.badlogicgames.gdx:gdx-platform:1.9.9@pom",
"org.sonatype.oss:oss-parent:5@pom"
)
}
} }
} }
}
withFixture("dependency/dynamic-snapshot") { withFixture("dependency/maven-bom") {
test("resolves snapshot dependency with dynamic version") { GRADLE_MIN("5.0") - test("resolves dependencies from maven bom platform") {
expectThat(build()) { expectThat(build()) {
get("root project dependencies") { rootProject.projectDependencies } get("root project dependencies") { rootProject.projectDependencies }
.filter { it.id.name == "packr" } .ids
.all { .containsExactly(
get("id.version") { id.version }.isEqualTo("-SNAPSHOT") "io.micrometer:micrometer-bom:1.5.1@pom",
get("timestamp") { timestamp }.isNotNull() "io.micrometer:micrometer-core:1.5.1@jar",
get("build") { build }.isNotNull() "io.micrometer:micrometer-core:1.5.1@pom",
} "org.hdrhistogram:HdrHistogram:2.1.12@jar",
} "org.hdrhistogram:HdrHistogram:2.1.12@pom"
}
}
withFixture("dependency/snapshot") {
test("resolves snapshot dependency") {
expectThat(build()) {
get("root project dependencies") { rootProject.projectDependencies }
.filter { it.id.name == "okio" }
.and {
ids.containsExactly(
"com.squareup.okio:okio:2.5.0-SNAPSHOT@jar",
"com.squareup.okio:okio:2.5.0-SNAPSHOT@module",
"com.squareup.okio:okio:2.5.0-SNAPSHOT@pom"
) )
all { }
}
}
withFixture("dependency/snapshot") {
test("resolves snapshot dependency") {
expectThat(build()) {
get("root project dependencies") { rootProject.projectDependencies }
.and {
ids.containsExactly(
"org.apache:test-SNAPSHOT2:2.0.2-SNAPSHOT@jar",
"org.apache:test-SNAPSHOT2:2.0.2-SNAPSHOT@pom"
)
all {
get("timestamp") { timestamp }.isNull()
get("build") { build }.isNotNull()
}
}
}
}
}
withFixture("dependency/snapshot-dynamic") {
test("resolves snapshot dependency with dynamic version") {
expectThat(build()) {
get("root project dependencies") { rootProject.projectDependencies }
.and {
ids.containsExactly(
"org.apache:test-SNAPSHOT1:2.0.2-SNAPSHOT@jar",
"org.apache:test-SNAPSHOT1:2.0.2-SNAPSHOT@pom"
)
all {
get("timestamp") { timestamp }.isEqualTo("20070310.181613")
get("build") { build }.isEqualTo(3)
}
}
}
}
}
withFixture("dependency/snapshot-redirect") {
test("resolves snapshot dependency with redirect") {
expectThat(build()) {
get("root project dependencies") { rootProject.projectDependencies }
.filter { it.id.name == "packr" }
.all {
get("id.version") { id.version }.isEqualTo("-SNAPSHOT")
get("timestamp") { timestamp }.isNotNull() get("timestamp") { timestamp }.isNotNull()
get("build") { build }.isNotNull() get("build") { build }.isNotNull()
get("urls") { urls }.single().startsWith(SONATYPE_OSS_URL)
} }
} }
} }
} }
} }

View File

@@ -12,7 +12,7 @@ import strikt.assertions.startsWith
class IvyTest : JUnit5Minutests { class IvyTest : JUnit5Minutests {
@Tests @Tests
fun tests() = rootContext<Fixture>("ivy tests") { fun tests() = rootContext("ivy tests") {
withFixture("ivy/basic") { withFixture("ivy/basic") {
test("resolves ivy dependencies") { test("resolves ivy dependencies") {
expectThat(build()) { expectThat(build()) {

View File

@@ -1,14 +1,17 @@
package org.nixos.gradle2nix package org.nixos.gradle2nix
import dev.minutest.Tests import dev.minutest.Tests
import dev.minutest.experimental.FOCUS
import dev.minutest.experimental.minus
import dev.minutest.junit.JUnit5Minutests import dev.minutest.junit.JUnit5Minutests
import dev.minutest.rootContext import dev.minutest.rootContext
import strikt.api.expectThat import strikt.api.expectThat
import strikt.assertions.contains import strikt.assertions.contains
import strikt.assertions.containsExactly
class PluginTest : JUnit5Minutests { class PluginTest : JUnit5Minutests {
@Tests @Tests
fun tests() = rootContext<Fixture>("plugin tests") { fun tests() = rootContext("plugin tests") {
withFixture("plugin/resolves-from-default-repo") { withFixture("plugin/resolves-from-default-repo") {
test("resolves plugin from default repo") { test("resolves plugin from default repo") {
expectThat(build()) { expectThat(build()) {

View File

@@ -0,0 +1,26 @@
package org.nixos.gradle2nix
import dev.minutest.Tests
import dev.minutest.junit.JUnit5Minutests
import dev.minutest.rootContext
import strikt.api.expectThat
import strikt.assertions.containsExactly
class SettingsTest : JUnit5Minutests {
@Tests
fun tests() = rootContext("settings tests") {
withRepository("m2") {
withFixture("settings/buildscript") {
test("resolves settings plugin in buildscript classpath") {
expectThat(build()) {
get("settings dependencies") { settingsDependencies }.ids
.containsExactly(
"org.apache:test:1.0.0@jar",
"org.apache:test:1.0.0@pom"
)
}
}
}
}
}
}

View File

@@ -17,7 +17,7 @@ import strikt.assertions.startsWith
class SubprojectsTest : JUnit5Minutests { class SubprojectsTest : JUnit5Minutests {
@Tests @Tests
fun tests() = rootContext<Fixture>("subproject tests") { fun tests() = rootContext("subproject tests") {
withFixture("subprojects/multi-module") { withFixture("subprojects/multi-module") {
test("builds multi-module project") { test("builds multi-module project") {
expectThat(build().rootProject) { expectThat(build().rootProject) {

View File

@@ -3,7 +3,12 @@ package org.nixos.gradle2nix
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.TestContextBuilder import dev.minutest.TestContextBuilder
import dev.minutest.closeableFixture
import dev.minutest.experimental.SKIP
import dev.minutest.experimental.TransformingAnnotation
import io.javalin.Javalin
import okio.buffer import okio.buffer
import okio.source import okio.source
import org.gradle.internal.classpath.DefaultClassPath import org.gradle.internal.classpath.DefaultClassPath
@@ -13,26 +18,29 @@ import org.gradle.util.GradleVersion
import org.junit.jupiter.api.Assumptions.assumeTrue import org.junit.jupiter.api.Assumptions.assumeTrue
import strikt.api.Assertion import strikt.api.Assertion
import strikt.assertions.map import strikt.assertions.map
import java.io.Closeable
import java.io.File import java.io.File
import java.io.StringWriter import java.io.StringWriter
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths import java.nio.file.Paths
import kotlin.streams.toList
const val SONATYPE_OSS_URL = "https://oss.sonatype.org/content/repositories/snapshots/"
private val moshi = Moshi.Builder().build() private val moshi = Moshi.Builder().build()
private val gradleVersion = GradleVersion.version(System.getProperty("compat.gradle.version")) val gradleVersion = System.getProperty("compat.gradle.version")
?.let(GradleVersion::version)
?: GradleVersion.current()
val GRADLE_4_5 = GradleVersion.version("4.5") val GRADLE_4_5 = GradleVersion.version("4.5")
fun GRADLE_MIN(version: String) = object : TransformingAnnotation() {
override fun <F> transform(node: Node<F>): Node<F> =
if (gradleVersion < GradleVersion.version(version)) SKIP.transform(node) else node
}
private fun File.initscript() = resolve("init.gradle").also { private fun File.initscript() = resolve("init.gradle").also {
it.writer().use { out -> it.writer().use { out ->
val classpath = DefaultClassPath.of(PluginUnderTestMetadataReading.readImplementationClasspath()) val classpath = DefaultClassPath.of(PluginUnderTestMetadataReading.readImplementationClasspath())
.asFiles.joinToString { n -> "'$n'" } .asFiles.joinToString { n -> "'$n'" }
out.appendln(""" out.append("""
initscript { initscript {
dependencies { dependencies {
classpath files($classpath) classpath files($classpath)
@@ -40,6 +48,7 @@ private fun File.initscript() = resolve("init.gradle").also {
} }
apply plugin: org.nixos.gradle2nix.Gradle2NixPlugin apply plugin: org.nixos.gradle2nix.Gradle2NixPlugin
""".trimIndent()) """.trimIndent())
} }
} }
@@ -78,6 +87,9 @@ private fun File.build(
System.err.print(log) System.err.print(log)
throw error throw error
} }
print(log)
return resolve("build/nix/model.json").run { return resolve("build/nix/model.json").run {
println(readText()) println(readText())
source().buffer().use { src -> source().buffer().use { src ->
@@ -89,43 +101,93 @@ private fun File.build(
val <T : Iterable<Artifact>> Assertion.Builder<T>.ids: Assertion.Builder<Iterable<String>> val <T : Iterable<Artifact>> Assertion.Builder<T>.ids: Assertion.Builder<Iterable<String>>
get() = map { it.id.toString() } get() = map { it.id.toString() }
@MinutestFixture private fun File.parents() = generateSequence(parentFile) { it.parentFile }
class Fixture(val testRoots: List<Path>)
@MinutestFixture @MinutestFixture
class ProjectFixture(val testRoot: Path) { class RepositoryFixture(private val server: Javalin) : Closeable {
override fun close() {
server.stop()
}
}
@MinutestFixture
class TestFixture(val name: String, val source: File) : Closeable {
val dest: File
init {
require(source.exists() && source.isDirectory) {
"$name: Test fixture not found: $source}"
}
dest = createTempDir(prefix = name, suffix = "")
}
override fun close() {
dest.deleteRecursively()
}
}
@MinutestFixture
class ProjectFixture(private val parent: TestFixture, private val source: File) : Closeable {
private val dest: File
init {
require(source.exists() && source.isDirectory && parent.source in source.parents()) {
"${parent.name}: Test project not found: $source"
}
val rel = source.toRelativeString(parent.source)
dest = parent.dest.resolve(rel)
}
fun copy() {
source.copyRecursively(dest, true)
}
fun build( fun build(
configurations: List<String> = emptyList(), configurations: List<String> = emptyList(),
subprojects: List<String> = emptyList() subprojects: List<String> = emptyList()
) = testRoot.toFile().build(configurations, subprojects) ) = dest.build(configurations, subprojects)
override fun close() {
dest.deleteRecursively()
}
} }
fun ContextBuilder<Fixture>.withFixture( fun ContextBuilder<*>.withRepository(
name: String, name: String,
block: TestContextBuilder<Fixture, ProjectFixture>.() -> Unit block: TestContextBuilder<*, RepositoryFixture>.() -> Unit
) = context(name) { ) = derivedContext<RepositoryFixture>("with repository: ${name}") {
closeableFixture {
RepositoryFixture(Javalin.create { config ->
config.addStaticFiles("/repositories/$name")
}.start(9999))
}
block()
}
fun ContextBuilder<*>.withFixture(
name: String,
block: TestContextBuilder<*, ProjectFixture>.() -> Unit
) = derivedContext<TestFixture>(name) {
val url = checkNotNull(Thread.currentThread().contextClassLoader.getResource(name)?.toURI()) { val url = checkNotNull(Thread.currentThread().contextClassLoader.getResource(name)?.toURI()) {
"$name: No test fixture found" "$name: No test fixture found"
} }
val fixtureRoot = Paths.get(url) val fixtureRoot = Paths.get(url).toFile().absoluteFile
val dest = createTempDir("gradle2nix").toPath()
val src = checkNotNull(fixtureRoot.takeIf(Files::exists)) {
"$name: Test fixture not found: $fixtureRoot}"
}
src.toFile().copyRecursively(dest.toFile())
val testRoots = Files.list(dest).filter { Files.isDirectory(it) }.toList()
fixture { deriveFixture {
Fixture(testRoots) TestFixture(name, fixtureRoot)
} }
afterAll { val testRoots = fixtureRoot.listFiles()!!
dest.toFile().deleteRecursively() .filter { it.isDirectory }
} .map { it.absoluteFile }
.toList()
testRoots.forEach { testRoot -> testRoots.forEach { testRoot ->
derivedContext<ProjectFixture>(testRoot.fileName.toString()) { derivedContext<ProjectFixture>(testRoot.name) {
deriveFixture { ProjectFixture(testRoot) } deriveFixture { ProjectFixture(this, testRoot) }
before { copy() }
after { close() }
block() block()
} }
} }

View File

@@ -0,0 +1,15 @@
package org.nixos.gradle2nix;
import org.gradle.api.artifacts.Dependency;
import org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency;
import javax.annotation.Nullable;
/**
* Workarounds for APIs improperly marked with @NonNullApi.
*/
interface ApiHack {
static Dependency defaultExternalModuleDependency(String group, String name, @Nullable String version) {
return new DefaultExternalModuleDependency(group, name, version);
}
}

View File

@@ -6,6 +6,7 @@ import org.apache.ivy.plugins.parser.m2.PomReader
import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser
import org.apache.ivy.plugins.repository.url.URLResource import org.apache.ivy.plugins.repository.url.URLResource
import org.apache.ivy.plugins.resolver.ChainResolver import org.apache.ivy.plugins.resolver.ChainResolver
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ModuleIdentifier import org.gradle.api.artifacts.ModuleIdentifier
import org.gradle.api.artifacts.ResolvedArtifact import org.gradle.api.artifacts.ResolvedArtifact
@@ -23,12 +24,24 @@ import org.gradle.kotlin.dsl.withArtifacts
import org.gradle.maven.MavenModule import org.gradle.maven.MavenModule
import org.gradle.maven.MavenPomArtifact import org.gradle.maven.MavenPomArtifact
import org.gradle.util.GradleVersion import org.gradle.util.GradleVersion
import java.io.File
internal class ConfigurationResolverFactory(repositories: RepositoryHandler) { enum class ConfigurationScope {
BUILDSCRIPT,
PLUGIN,
PROJECT,
SETTINGS
}
internal class ConfigurationResolverFactory(
project: Project,
scope: ConfigurationScope,
repositories: RepositoryHandler
) {
private val ivySettings = IvySettings().apply { private val ivySettings = IvySettings().apply {
defaultInit() defaultInit()
setDefaultRepositoryCacheBasedir(createTempDir("gradle2nix-cache").apply(File::deleteOnExit).absolutePath) // This doesn't appear to be used, but it's better to define it explicitly than to introduce
// impurities into artifact resolution.
setDefaultRepositoryCacheBasedir(project.buildDir.resolve("tmp/gradle2nix/_cache").absolutePath)
setDictatorResolver(ChainResolver().also { chain -> setDictatorResolver(ChainResolver().also { chain ->
chain.settings = this@apply chain.settings = this@apply
for (resolver in resolvers) chain.add(resolver) for (resolver in resolvers) chain.add(resolver)
@@ -38,7 +51,7 @@ internal class ConfigurationResolverFactory(repositories: RepositoryHandler) {
private val resolvers = repositories private val resolvers = repositories
.filterIsInstance<ResolutionAwareRepository>() .filterIsInstance<ResolutionAwareRepository>()
.filterNot { it.createResolver().isLocal } .filterNot { it.createResolver().isLocal }
.mapNotNull { it.repositoryResolver(ivySettings) } .mapNotNull { it.repositoryResolver(project, scope, ivySettings) }
fun create(dependencies: DependencyHandler): ConfigurationResolver = fun create(dependencies: DependencyHandler): ConfigurationResolver =
ConfigurationResolver(ivySettings, resolvers, dependencies) ConfigurationResolver(ivySettings, resolvers, dependencies)
@@ -49,15 +62,27 @@ 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 ivy = Ivy.newInstance(ivySettings) private val ivy = Ivy.newInstance(ivySettings)
val unresolved: List<ArtifactIdentifier> = failed.toList()
fun resolve(configuration: Configuration): List<DefaultArtifact> { fun resolve(configuration: Configuration): List<DefaultArtifact> {
val resolved = configuration.resolvedConfiguration val resolved = configuration.resolvedConfiguration.lenientConfiguration
failed.addAll(resolved.unresolvedModuleDependencies.map {
DefaultArtifactIdentifier(
group = it.selector.group,
name = it.selector.name,
version = it.selector.version ?: "",
type = "module"
)
})
val topLevelMetadata = resolved.firstLevelModuleDependencies val topLevelMetadata = resolved.firstLevelModuleDependencies
.flatMap { resolveMetadata(it.moduleGroup, it.moduleName, it.moduleVersion) } .flatMap { resolveMetadata(it.moduleGroup, it.moduleName, it.moduleVersion) }
val allArtifacts = resolved.resolvedArtifacts val allArtifacts = resolved.artifacts
.filter { it.id.componentIdentifier is ModuleComponentIdentifier } .filter { it.id.componentIdentifier is ModuleComponentIdentifier }
.flatMap(::resolve) .flatMap(::resolve)
@@ -76,8 +101,9 @@ internal class ConfigurationResolver(
classifier = resolvedArtifact.classifier classifier = resolvedArtifact.classifier
) )
val sha256 = resolvedArtifact.file.sha256() val sha256 = resolvedArtifact.computeHash()
val artifacts = resolvers.mapNotNull { it.resolve(artifactId, sha256) }.merge() val artifacts = resolvers.mapNotNull { it.resolve(artifactId, sha256) }.merge()
if (artifacts.isEmpty()) failed.add(artifactId)
return artifacts + componentId.run { resolveMetadata(group, module, version) } return artifacts + componentId.run { resolveMetadata(group, module, version) }
} }
@@ -112,8 +138,10 @@ internal class ConfigurationResolver(
version = componentId.version, version = componentId.version,
type = "pom" type = "pom"
) )
val sha256 = resolvedPom.file.sha256() // Intentionally not computing hash from the cached result; see ResolvedArtifact.computeHash() below.
resolvers.mapNotNull { it.resolve(artifactId, sha256) }.merge() val artifacts = resolvers.mapNotNull { it.resolve(artifactId) }.merge()
if (artifacts.isEmpty()) failed.add(artifactId)
artifacts
} }
} }
@@ -139,8 +167,10 @@ internal class ConfigurationResolver(
type = "ivy", type = "ivy",
extension = "xml" extension = "xml"
) )
val sha256 = resolvedDesc.file.sha256() // Intentionally not computing hash from the cached result; see ResolvedArtifact.computeHash() below.
resolvers.mapNotNull { it.resolve(artifactId, sha256) }.merge() val artifacts = resolvers.mapNotNull { it.resolve(artifactId) }.merge()
if (artifacts.isEmpty()) failed.add(artifactId)
artifacts
} }
} }
@@ -155,7 +185,9 @@ internal class ConfigurationResolver(
version = version, version = version,
type = "module" type = "module"
) )
return resolvers.mapNotNull { it.resolve(artifactId) }.merge() val artifacts = resolvers.mapNotNull { it.resolve(artifactId) }.merge()
if (artifacts.isEmpty()) failed.add(artifactId)
return artifacts
} }
private fun ResolvedArtifactResult.parentPom(): ResolvedArtifactResult? { private fun ResolvedArtifactResult.parentPom(): ResolvedArtifactResult? {
@@ -205,7 +237,7 @@ internal class ConfigurationResolver(
val seen = mutableSetOf<ComponentArtifactIdentifier>() val seen = mutableSetOf<ComponentArtifactIdentifier>()
return generateSequence(listOf(this)) { descs -> return generateSequence(listOf(this)) { descs ->
val parents = descs.flatMap { it.parentDescriptors(seen) } val parents = descs.flatMap { it.parentDescriptors(seen) }
seen.addAll(parents.map(ResolvedArtifactResult::id)) seen.addAll(parents.map(ResolvedArtifactResult::getId))
parents.takeUnless { it.isEmpty() } parents.takeUnless { it.isEmpty() }
}.flatten().distinct().toList() }.flatten().distinct().toList()
} }
@@ -255,3 +287,18 @@ private fun List<DefaultArtifact>.merge(): List<DefaultArtifact> {
.reduce { _, dest, next -> dest.copy(urls = dest.urls + next.urls) } .reduce { _, dest, next -> dest.copy(urls = dest.urls + next.urls) }
.values.toList() .values.toList()
} }
private fun ResolvedArtifact.computeHash(): String? {
// Hack: Some POM files are served with CRLF line endings, e.g. javax.servlet:javax.servlet-api:3.1.0.
// Gradle stores these normalized with LF line endings, which will not match the eventual hash
// of the fixed-output derivation which produces the POM artifact.
//
// A similar issue can exist for Apache Ivy; see https://issues.apache.org/jira/browse/IVY-1156.
//
// Ignore these artifacts, and defer hash calculation to RepositoryResolver.
if (type == "pom" || type == "ivy") {
return null
}
return file.sha256()
}

View File

@@ -6,6 +6,7 @@ import org.gradle.api.Project
import org.gradle.api.Task 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.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
@@ -18,7 +19,7 @@ import org.gradle.tooling.provider.model.ToolingModelBuilder
import org.gradle.tooling.provider.model.ToolingModelBuilderRegistry import org.gradle.tooling.provider.model.ToolingModelBuilderRegistry
import org.gradle.util.GradleVersion import org.gradle.util.GradleVersion
import java.net.URL import java.net.URL
import java.util.Locale import java.util.*
@Suppress("unused") @Suppress("unused")
open class Gradle2NixPlugin : Plugin<Gradle> { open class Gradle2NixPlugin : Plugin<Gradle> {
@@ -85,6 +86,7 @@ private fun Project.buildModel(
modelProperties: ModelProperties, modelProperties: ModelProperties,
pluginRequests: List<PluginRequest> pluginRequests: List<PluginRequest>
): DefaultBuild { ): DefaultBuild {
val settingsDependencies = settingsDependencies()
val plugins = buildPlugins(pluginRequests) val plugins = buildPlugins(pluginRequests)
val subprojects = if (modelProperties.subprojects.isEmpty()) { val subprojects = if (modelProperties.subprojects.isEmpty()) {
@@ -99,6 +101,7 @@ private fun Project.buildModel(
return DefaultBuild( return DefaultBuild(
gradle = buildGradle(), gradle = buildGradle(),
settingsDependencies = settingsDependencies,
pluginDependencies = plugins, pluginDependencies = plugins,
rootProject = buildProject(modelProperties.configurations, subprojects, plugins), rootProject = buildProject(modelProperties.configurations, subprojects, plugins),
includedBuilds = includedBuilds() includedBuilds = includedBuilds()
@@ -126,8 +129,33 @@ private fun Project.buildGradle(): DefaultGradle =
) )
} }
private fun Project.settingsDependencies(): List<DefaultArtifact> {
val buildscript = (gradle as GradleInternal).settings.buildscript
val resolverFactory = ConfigurationResolverFactory(this, ConfigurationScope.SETTINGS, buildscript.repositories)
val resolver = resolverFactory.create(buildscript.dependencies)
logger.lifecycle(" Settings script")
val dependencies = buildscript.configurations
.flatMap(resolver::resolve)
.distinct()
.sorted()
if (resolver.unresolved.isNotEmpty()) {
logger.warn(buildString {
append(" Failed to resolve settings script dependencies:\n")
for (id in resolver.unresolved) {
append(" - $id\n")
}
})
}
return dependencies
}
private fun Project.buildPlugins(pluginRequests: List<PluginRequest>): List<DefaultArtifact> { private fun Project.buildPlugins(pluginRequests: List<PluginRequest>): List<DefaultArtifact> {
return objects.newInstance<PluginResolver>().resolve(pluginRequests).distinct().sorted() return objects.newInstance<PluginResolver>(this).resolve(pluginRequests).distinct().sorted()
} }
private fun Project.includedBuilds(): List<DefaultIncludedBuild> = private fun Project.includedBuilds(): List<DefaultIncludedBuild> =
@@ -141,37 +169,64 @@ private fun Project.buildProject(
pluginArtifacts: List<DefaultArtifact> pluginArtifacts: List<DefaultArtifact>
): DefaultProject { ): DefaultProject {
logger.lifecycle(" Subproject: $path") logger.lifecycle(" Subproject: $path")
val (buildscriptDependencies, buildscriptUnresolved) = buildscriptDependencies(pluginArtifacts)
if (buildscriptUnresolved.isNotEmpty()) {
logger.warn(buildString {
append(" Failed to resolve buildscript dependencies:\n")
for (id in buildscriptUnresolved) {
append(" - $id\n")
}
})
}
val (projectDependencies, projectUnresolved) = projectDependencies(explicitConfigurations)
if (projectUnresolved.isNotEmpty()) {
logger.warn(buildString {
append(" Failed to resolve project dependencies:\n")
for (id in projectUnresolved) {
append(" - $id\n")
}
})
}
return DefaultProject( return DefaultProject(
name = name, name = name,
version = version.toString(), version = version.toString(),
path = path, path = path,
projectDir = projectDir.toRelativeString(rootProject.projectDir), projectDir = projectDir.toRelativeString(rootProject.projectDir),
buildscriptDependencies = buildscriptDependencies(pluginArtifacts), buildscriptDependencies = buildscriptDependencies,
projectDependencies = projectDependencies(explicitConfigurations), projectDependencies = projectDependencies,
children = explicitSubprojects.map { children = explicitSubprojects.map {
it.buildProject(explicitConfigurations, emptyList(), pluginArtifacts) it.buildProject(explicitConfigurations, emptyList(), pluginArtifacts)
} }
) )
} }
private fun Project.buildscriptDependencies(pluginArtifacts: List<DefaultArtifact>): List<DefaultArtifact> { private fun Project.buildscriptDependencies(
val resolverFactory = ConfigurationResolverFactory(buildscript.repositories) pluginArtifacts: List<DefaultArtifact>
): Pair<List<DefaultArtifact>, List<ArtifactIdentifier>> {
val resolverFactory = ConfigurationResolverFactory(this, ConfigurationScope.BUILDSCRIPT, buildscript.repositories)
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
.flatMap(resolver::resolve) .flatMap(resolver::resolve)
.distinct() .distinct()
.filter { it.id !in pluginIds } .filter { it.id !in pluginIds }
.sorted() .sorted() to resolver.unresolved
} }
private fun Project.projectDependencies(explicitConfigurations: List<String>): List<DefaultArtifact> { private fun Project.projectDependencies(
val resolverFactory = ConfigurationResolverFactory(repositories) explicitConfigurations: List<String>
): Pair<List<DefaultArtifact>, List<ArtifactIdentifier>> {
val resolverFactory = ConfigurationResolverFactory(this, ConfigurationScope.PROJECT, repositories)
val resolver = resolverFactory.create(dependencies) val resolver = resolverFactory.create(dependencies)
return collectConfigurations(explicitConfigurations) return collectConfigurations(explicitConfigurations)
.flatMap(resolver::resolve) .flatMap(resolver::resolve)
.distinct() .distinct()
.sorted() .sorted() to resolver.unresolved
} }
private fun Project.dependentSubprojects(explicitConfigurations: List<String>): Set<Project> { private fun Project.dependentSubprojects(explicitConfigurations: List<String>): Set<Project> {
@@ -200,7 +255,7 @@ private fun fetchDistSha256(url: String): String {
} }
} }
private val nativePlatformJarRegex = Regex("""native-platform-([\d.]+)\.jar""") private val nativePlatformJarRegex = Regex("""native-platform-([\d.]+(-(alpha|beta|milestone)-\d+)?)\.jar""")
private val Wrapper.sha256: String private val Wrapper.sha256: String
get() { get() {

Some files were not shown because too many files have changed in this diff Show More