24 Commits

Author SHA1 Message Date
Tad Fisher
7f7d6a888b gradle-env.nix: Support fetchers per URL scheme 2021-02-03 17:19:04 -08:00
Tad Fisher
56c4bb435d gradle-env.nix: Use dependencyResolutionManagement in 6.8+ 2021-02-03 16:05:02 -08:00
Tad Fisher
9c705b5f1b plugin: Support repositories in dependencyResolutionManagement block 2021-02-03 10:24:18 -08:00
Tad Fisher
80b8a7d52e plugin: Support S3 repositories 2021-02-02 16:44:23 -08:00
Tad Fisher
55b3b60535 Update build dependencies 2021-02-01 14:58:38 -08:00
Tad Fisher
13958d35bf Merge pull request #31 from tadfisher/flake
flake: init
2021-01-04 20:38:11 -08:00
Tad Fisher
716f137343 flake: init 2020-12-09 17:54:04 -08:00
Tad Fisher
f047221f5f Fix artifact hashes 2020-12-09 13:26:13 -08:00
Tad Fisher
6faed26b31 Merge pull request #29 from tadfisher/extraInit
Add extraInit and buildJdk args
2020-12-02 00:59:11 -08:00
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
Tad Fisher
c3c4079566 Version 1.0.0-rc2 2020-02-20 10:14:01 -08:00
Tad Fisher
baa58da5a1 Exclude local repositories from dependency resolution
Fixes https://github.com/tadfisher/gradle2nix/issues/8
2020-02-19 12:57:29 -08:00
Tad Fisher
b1b0ba14db Update README and add copyright license 2020-01-23 15:38:12 -08:00
Tad Fisher
823e43d592 Merge pull request #7 from tadfisher/custom-resolver
Custom dependency resolution
2020-01-23 10:27:57 -08:00
131 changed files with 12335 additions and 2504 deletions

20
COPYING Normal file
View File

@@ -0,0 +1,20 @@
Copyright © Tad Fisher and the gradle2nix contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,12 +1,166 @@
* gradle2nix
#+STARTUP: inlineimages
Application and Gradle plugin to generate Nix build scripts for Gradle-based
projects.
[[./assets/gradle2nix.png]]
Generate [[https://nixos.org/nix/][Nix]] expressions which build [[https://gradle.org/][Gradle]]-based projects.
** Why?
Nix is an OS-agnostic package manager, a language-agnostic build
system, and a bespoke programming language. One of its unique features
is that it is purely functional; a "package" is a function which
accepts inputs (source code, configuration, etc) and produces an
output (binaries, a Java JAR, documentation, really anything).
One benefit of a functional build system is [[https://reproducible-builds.org/][reproducibility]]. If you
specify your inputs precisely, and take care not to introduce
impurities—such as files retrieved over a network without tracking
their content—you will receive, byte-for-byte, the exact output as
someone else running the same function over the same inputs.
Gradle is not a functional build system. Most Gradle-based projects
will produce highly variable outputs depending on a host of impure
inputs, including:
- The JVM hosting the build
- The Gradle installation running the build
- Any usage of dynamic version constraints for dependencies
- SNAPSHOT dependencies
- Environment variables and command-line options
- Artifacts cached on the system hosting the build
=gradle2nix= helps to solve this problem by leveraging Nix to control
the most common inputs to a Gradle build. When run on a project, it
will record all dependencies for both the build environment (including
=plugins= and =buildscript= blocks) and the project, and provide a Nix
expression to run the build given these dependencies. The build itself
is then run in a sandbox, where only content-tracked network requests
are allowed to fetch dependencies, and a local Maven repository is
created on-the-fly to host the dependency artifacts somewhere Gradle
can resolve them without a network.
This tool is useful for both development and packaging. You can use
=gradle2nix= to:
- Create isolated and reproducible development environments that work
anywhere Nix itself can run;
- Reduce or eliminate flakiness and maintenance headaches from CI/CD
pipelines
- Distribute a recipe which can reliably build a Gradle project in
repositories such as the [[https://nixos.org/nixpkgs/][Nix Package Collection]].
** Installation
A [[./default.nix][Nix expression]] (generated by =gradle2nix= itself) is provided for
convenience. The following expression will fetch and build the latest
version of this package:
#+begin_src nix
import (fetchTarball "https://github.com/tadfisher/gradle2nix/archive/master.tar.gz") {}
#+end_src
If this expression is in, say, =gradle2nix.nix=, =gradle2nix= can be
built and placed in =.//result= with the following:
#+begin_example
nix build -f gradle2nix.nix
#+end_example
You can also use the following one-liners to build or install
=gradle2nix= in your user profile:
#+begin_example
# Build and place in ./result/
nix build -f "https://github.com/tadfisher/gradle2nix/archive/master.tar.gz"
# Build and install in the user profile
nix-env -if "https://github.com/tadfisher/gradle2nix/archive/master.tar.gz"
#+end_example
=gradle2nix= is not yet packaged in =nixpkgs= itself, but work is
[[https://github.com/NixOS/nixpkgs/pull/77422][in progress]].
*** Flake (experimental)
A [[./flake.nix][flake.nix]] is provided for those using [[https://nixos.wiki/wiki/Flakes][Nix flakes]]. For example, the
following will build and run =gradle2nix= with the arguments provided
after =--=:
#+begin_example
nix run github:tadfisher/gradle2nix -- --help
#+end_example
** Usage
#+begin_example
Usage: gradle2nix [OPTIONS] [PROJECT-DIR]
Options:
-g, --gradle-version VERSION Use a specific Gradle version
-a, --gradle-args ARGS Extra arguments to pass to Gradle
-c, --configuration NAME Add a configuration to resolve (default:
all configurations)
-i, --include DIR Add an additional project to include
-p, --project PATH Only resolve these subproject paths, e.g.
':', or ':sub:project' (default: all
projects)
-o, --out-dir DIR Path to write generated files (default:
PROJECT-DIR)
-e, --env FILENAME Prefix for environment files (.json and
.nix) (default: gradle-env)
-b, --build-src / -nb, --no-build-src
Include buildSrc project (default: true)
-q, --quiet Disable logging
-h, --help Show this message and exit
Arguments:
PROJECT-DIR Path to the project root (default: .)
#+end_example
Simply running =gradle2nix= in the root directory of a project should
be enough for most projects. This will produce two files, by default
called =gradle-env.json= and =gradle-env.nix=, which contain the
pinned dependencies for the project and a standard build expression
which can be imported or called by other Nix expressions. An example
of such an expression can be found in this project's [[./default.nix][default.nix]].
*** Specifying the Gradle version
By default, if the project has configured the Gradle wrapper, that
version will be detected and pinned; otherwise, the version of Gradle
installed on your system will be pinned. You can override this with
the =--gradle-version= argument, which also avoids the need to have
Gradle installed.
#+begin_example
gradle2nix -g 6.1
#+end_example
*** Multi-project builds
If you want to resolve only a subset of projects in a [[https://docs.gradle.org/current/userguide/intro_multi_project_builds.html][multi-project
build]], add the =--project= option for each project. For example, in a
project where you only want to build the subprojects =:app= and
=:widget=:
#+begin_example
gradle2nix -p :app -p :widget
#+end_example
Any [[https://docs.gradle.org/current/userguide/declaring_dependencies.html#sub:project_dependencies][project dependencies]] will be also be included when pinning
dependency artifacts.
** Contributing
Bug reports and feature requests are encouraged.
[[https://github.com/tadfisher/gradle2nix/issues/new][Create an issue]]
Code contributions are also encouraged. Please review the test cases
in the [[./fixtures][fixtures]] directory and create a new one to reproduce any fixes
or test new features. See the [[./plugin/src/compatTest/kotlin/org/nixos/gradle2nix][existing compatibility tests]] for
examples of testing with these fixtures.
** License
=gradle2nix= is licensed under the [[./COPYING][MIT License]].

View File

@@ -8,7 +8,6 @@ plugins {
dependencies {
implementation(project(":model"))
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
implementation("org.gradle:gradle-tooling-api:${gradle.gradleVersion}")
implementation("com.github.ajalt:clikt:latest.release")
@@ -18,23 +17,36 @@ dependencies {
implementation("com.squareup.moshi:moshi-kotlin:latest.release")
kapt("com.squareup.moshi:moshi-kotlin-codegen: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 {
mainClassName = "org.nixos.gradle2nix.MainKt"
mainClass.set("org.nixos.gradle2nix.MainKt")
applicationName = "gradle2nix"
applicationDefaultJvmArgs += "-Dorg.nixos.gradle2nix.share=@APP_HOME@/share"
applicationDistribution
.from(tasks.getByPath(":plugin:shadowJar"))
.from(tasks.getByPath(":plugin:shadowJar"), "$rootDir/gradle-env.nix")
.into("share")
.rename("plugin.*\\.jar", "plugin.jar")
}
sourceSets {
test {
resources {
srcDir("$rootDir/fixtures")
}
}
}
tasks {
(run) {
dependsOn(installDist)
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 +57,23 @@ 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> {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn")
}
}
}

38
app/gradle.lockfile Normal file
View File

@@ -0,0 +1,38 @@
# 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:3.0.0-alpha.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
io.github.classgraph:classgraph:4.8.37=testRuntimeClasspath
io.strikt:strikt-core:0.28.2=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.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-reflect:1.4.20=compileClasspath,runtimeClasspath,testCompileClasspath
org.jetbrains.kotlin:kotlin-reflect:1.4.21-2=testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20=compileClasspath,runtimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.21-2=testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.20=compileClasspath,runtimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.21-2=testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.20=compileClasspath,runtimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21-2=testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib:1.4.20=compileClasspath,runtimeClasspath
org.jetbrains.kotlin:kotlin-stdlib:1.4.21-2=testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.3=testRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.2=testRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2=testRuntimeClasspath
org.jetbrains:annotations:13.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.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.15=testCompileClasspath,testRuntimeClasspath
org.spekframework.spek2:spek-runner-junit5:2.0.15=testRuntimeClasspath
org.spekframework.spek2:spek-runtime-jvm:2.0.15=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

@@ -19,6 +19,7 @@ fun buildEnv(builds: Map<String, DefaultBuild>): Map<String, NixGradleEnv> =
path = path,
gradle = build.gradle,
dependencies = mapOf(
"settings" to build.settingsDependencies,
"plugin" to build.pluginDependencies,
"buildscript" to build.rootProject.collectDependencies(DefaultProject::buildscriptDependencies),
"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 (path.isNotEmpty()) addArguments("--project-dir=$path")
if (!config.quiet) {
setColorOutput(true)
setStandardOutput(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.multiple
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.types.file
import com.squareup.moshi.Moshi
@@ -55,7 +54,7 @@ class Main : CliktCommand(
private val includes: List<File> by option("--include", "-i",
metavar = "DIR",
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()
.validate { files ->
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",
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",
help = "Prefix for environment files (.json and .nix)")
.default("gradle-env")
@@ -105,8 +104,11 @@ class Main : CliktCommand(
}
}
// Visible for testing
lateinit var config: Config
override fun run() {
val config = Config(
config = Config(
gradleVersion,
gradleArgs,
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,60 @@
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
import kotlin.io.path.ExperimentalPathApi
import kotlin.io.path.createTempDirectory
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!!
}
}
@OptIn(ExperimentalPathApi::class)
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 = createTempDirectory("gradle2nix")
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()
}
)
}

BIN
assets/gradle2nix.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

680
assets/gradle2nix.svg Normal file
View File

@@ -0,0 +1,680 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="1280"
height="640"
viewBox="0 0 338.66666 169.33334"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="gradle2nix.svg">
<defs
id="defs2">
<linearGradient
gradientTransform="matrix(0.52333152,0,0,0.52333152,25.176839,183.12552)"
id="linear-gradient"
x1="1.5"
y1="29.09"
x2="88.3"
y2="38.21"
gradientUnits="userSpaceOnUse">
<stop
offset="0"
stop-color="#06a0ce"
id="stop4734" />
<stop
offset="1"
stop-color="#51cbbf"
id="stop4736" />
</linearGradient>
<style
id="style4930">.Graphic-Style-2{fill:url(#linear-gradient);}</style>
<linearGradient
gradientUnits="userSpaceOnUse"
y2="38.21"
x2="88.3"
y1="29.09"
x1="1.5"
id="linear-gradient-5"
gradientTransform="matrix(0.52333152,0,0,0.52333152,25.176839,183.12552)">
<stop
id="stop4932"
stop-color="#06a0ce"
offset="0" />
<stop
id="stop4934"
stop-color="#51cbbf"
offset="1" />
</linearGradient>
<linearGradient
id="linearGradient5562"
inkscape:collect="always">
<stop
id="stop5564"
offset="0"
style="stop-color:#699ad7;stop-opacity:1" />
<stop
style="stop-color:#7eb1dd;stop-opacity:1"
offset="0.24345198"
id="stop5566" />
<stop
id="stop5568"
offset="1"
style="stop-color:#7ebae4;stop-opacity:1" />
</linearGradient>
<linearGradient
id="linearGradient5053"
inkscape:collect="always">
<stop
id="stop5055"
offset="0"
style="stop-color:#415e9a;stop-opacity:1" />
<stop
style="stop-color:#4a6baf;stop-opacity:1"
offset="0.23168644"
id="stop5057" />
<stop
id="stop5059"
offset="1"
style="stop-color:#5277c3;stop-opacity:1" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient5960">
<stop
style="stop-color:#637ddf;stop-opacity:1"
offset="0"
id="stop5962" />
<stop
id="stop5964"
offset="0.23168644"
style="stop-color:#649afa;stop-opacity:1" />
<stop
style="stop-color:#719efa;stop-opacity:1"
offset="1"
id="stop5966" />
</linearGradient>
<linearGradient
id="linearGradient5867"
inkscape:collect="always">
<stop
id="stop5869"
offset="0"
style="stop-color:#7363df;stop-opacity:1" />
<stop
style="stop-color:#6478fa;stop-opacity:1"
offset="0.23168644"
id="stop5871" />
<stop
id="stop5873"
offset="1"
style="stop-color:#719efa;stop-opacity:1" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5960"
id="linearGradient5855"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(983.36076,601.38885)"
x1="213.95642"
y1="338.62445"
x2="282.26105"
y2="515.97058" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5867"
id="linearGradient5855-8"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(-197.75174,-337.1451)"
x1="213.95642"
y1="338.62445"
x2="282.26105"
y2="515.97058" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5960"
id="linearGradient4544"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(983.36076,601.38885)"
x1="-775.20807"
y1="102.74675"
x2="-702.75317"
y2="247.58188" />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath4501">
<circle
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#adadad;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="circle4503"
cx="335.13995"
cy="686.09473"
r="241.06563" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath5410">
<circle
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="circle5412"
cx="335.98114"
cy="340.98975"
r="241.13741" />
</clipPath>
<linearGradient
y2="937.71399"
x2="-496.29703"
y1="782.33563"
x1="-584.19934"
gradientTransform="translate(864.55062,-2197.497)"
gradientUnits="userSpaceOnUse"
id="linearGradient5137"
xlink:href="#linearGradient5053"
inkscape:collect="always" />
<linearGradient
y2="506.18814"
x2="290.08701"
y1="351.41116"
x1="200.59668"
gradientTransform="translate(70.505061,-1761.3076)"
gradientUnits="userSpaceOnUse"
id="linearGradient5162"
xlink:href="#linearGradient5562"
inkscape:collect="always" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5562"
id="linearGradient3917"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(70.650339,-1055.1511)"
x1="200.59668"
y1="351.41116"
x2="290.08701"
y2="506.18814" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5053"
id="linearGradient3919"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(864.69589,-1491.3405)"
x1="-584.19934"
y1="782.33563"
x2="-496.29703"
y2="937.71399" />
<linearGradient
inkscape:collect="always"
xlink:href="#linear-gradient-5"
id="linearGradient4732"
x1="418.76779"
y1="264.43814"
x2="652.08905"
y2="296.6008"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5867"
id="linearGradient4745"
x1="421.11343"
y1="273.91626"
x2="524.12122"
y2="273.91626"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linear-gradient-5"
id="linearGradient4763"
gradientUnits="userSpaceOnUse"
x1="418.76779"
y1="264.43814"
x2="652.08905"
y2="296.6008" />
<linearGradient
inkscape:collect="always"
xlink:href="#linear-gradient-5"
id="linearGradient4765"
gradientUnits="userSpaceOnUse"
x1="418.76779"
y1="264.43814"
x2="652.08905"
y2="296.6008" />
<linearGradient
inkscape:collect="always"
xlink:href="#linear-gradient-5"
id="linearGradient4767"
gradientUnits="userSpaceOnUse"
x1="418.76779"
y1="264.43814"
x2="652.08905"
y2="296.6008" />
<linearGradient
inkscape:collect="always"
xlink:href="#linear-gradient-5"
id="linearGradient4769"
gradientUnits="userSpaceOnUse"
x1="418.76779"
y1="264.43814"
x2="652.08905"
y2="296.6008" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5867"
id="linearGradient4771"
gradientUnits="userSpaceOnUse"
x1="421.11343"
y1="273.91626"
x2="524.12122"
y2="273.91626" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5867"
id="linearGradient4773"
gradientUnits="userSpaceOnUse"
x1="421.11343"
y1="273.91626"
x2="524.12122"
y2="273.91626" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient5867"
id="linearGradient4775"
gradientUnits="userSpaceOnUse"
x1="421.11343"
y1="273.91626"
x2="524.12122"
y2="273.91626" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.38515625"
inkscape:cx="791.08312"
inkscape:cy="364.77075"
inkscape:document-units="px"
inkscape:current-layer="g4759"
showgrid="false"
units="px"
showguides="false"
inkscape:guide-bbox="true"
inkscape:window-width="1660"
inkscape:window-height="1011"
inkscape:window-x="260"
inkscape:window-y="30"
inkscape:window-maximized="0">
<sodipodi:guide
position="0,148.16667"
orientation="0,1"
id="guide4518"
inkscape:locked="false"
inkscape:label=""
inkscape:color="rgb(0,0,255)" />
<sodipodi:guide
position="0,21.166667"
orientation="0,1"
id="guide4793"
inkscape:locked="false"
inkscape:label=""
inkscape:color="rgb(0,0,255)" />
<sodipodi:guide
position="21.166667,0"
orientation="1,0"
id="guide4795"
inkscape:locked="false"
inkscape:label=""
inkscape:color="rgb(0,0,255)" />
<sodipodi:guide
position="317.5,0"
orientation="1,0"
id="guide4797"
inkscape:locked="false"
inkscape:label=""
inkscape:color="rgb(0,0,255)" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-127.66665)">
<g
id="g3833"
transform="matrix(1.087741,0,0,1.0877425,-6.2376695,-19.285721)">
<path
style="fill:url(#linear-gradient-5);stroke-width:0.52333152"
inkscape:connector-curvature="0"
class="Graphic-Style-2"
d="m 69.717638,185.31305 a 7.4679407,7.4679407 0 0 0 -10.37771,-0.17802 0.72219753,0.72219753 0 0 0 0,1.04667 l 0.900124,0.92105 a 0.71173086,0.71173086 0 0 0 0.931533,0.0627 4.2808518,4.2808518 0 0 1 5.610133,6.45792 c -5.929373,5.92412 -13.842146,-10.68643 -31.802883,-2.12473 a 2.4334915,2.4334915 0 0 0 -1.04665,3.4226 l 3.082411,5.32227 a 2.4282583,2.4282583 0 0 0 3.296998,0.90536 l 0.07318,-0.0419 -0.05756,0.0419 1.350185,-0.75359 a 31.551656,31.551656 0 0 0 4.301795,-3.20804 0.75359739,0.75359739 0 0 1 0.978628,-0.0314 v 0 a 0.70126424,0.70126424 0 0 1 0.03145,1.04667 32.242454,32.242454 0 0 1 -4.542531,3.41735 h -0.04707 l -1.365891,0.76407 a 3.8412533,3.8412533 0 0 1 -1.889235,0.49194 3.8988198,3.8988198 0 0 1 -3.385946,-1.94158 l -2.914958,-5.0292 c -5.573487,3.96685 -8.996077,11.58655 -7.143483,21.23679 a 0.71173086,0.71173086 0 0 0 0.696033,0.58089 h 3.286533 a 0.71173086,0.71173086 0 0 0 0.72743,-0.64893 4.8617496,4.8617496 0 0 1 9.639776,0 0.70649755,0.70649755 0 0 0 0.70126,0.62278 h 3.213252 a 0.71173086,0.71173086 0 0 0 0.701262,-0.62278 4.8617496,4.8617496 0 0 1 9.639776,0 0.71173086,0.71173086 0 0 0 0.70126,0.62278 h 3.192327 a 0.71173086,0.71173086 0 0 0 0.711723,-0.70128 c 0.07318,-4.50064 1.287386,-9.67117 4.746628,-12.26165 11.98433,-8.96468 8.83387,-16.64718 6.06022,-19.42083 z m -12.21985,13.53858 -2.286941,-1.1461 v 0 a 1.4339283,1.4339283 0 1 1 2.286941,1.15134 z"
id="path4941" />
<g
transform="matrix(0.08170627,0,0,0.08170627,58.715285,207.19198)"
id="g5193">
<g
id="layer7"
inkscape:label="bg"
style="display:none"
transform="translate(-23.75651,-24.84972)">
<rect
transform="translate(-132.5822,958.04022)"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect5389"
width="1543.4283"
height="483.7439"
x="132.5822"
y="-957.77832" />
</g>
<g
id="layer6"
inkscape:label="logo-guide"
style="display:none"
transform="translate(-156.33871,933.1905)">
<rect
y="-958.02759"
x="132.65129"
height="484.30399"
width="550.41602"
id="rect5379"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5c201e;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
inkscape:export-filename="/home/tim/dev/nix/homepage/logo/nix-wiki.png"
inkscape:export-xdpi="22.07"
inkscape:export-ydpi="22.07" />
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#c24a46;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect5372"
width="501.94415"
height="434.30405"
x="156.12303"
y="-933.02759"
inkscape:export-filename="/home/tim/dev/nix/homepage/logo/nixos-logo-only-hires-print.png"
inkscape:export-xdpi="212.2"
inkscape:export-ydpi="212.2" />
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#d98d8a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect5381"
width="24.939611"
height="24.939611"
x="658.02826"
y="-958.04022" />
</g>
<g
inkscape:label="print-logo"
id="layer1-6"
style="display:inline"
transform="translate(-156.33871,933.1905)">
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5277c3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 309.40365,-710.2521 122.19683,211.6751 -56.15706,0.5268 -32.6236,-56.8692 -32.85645,56.5653 -27.90237,-0.011 -14.29086,-24.6896 46.81047,-80.4902 -33.22946,-57.8256 z"
id="path4861"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccc" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#7ebae4;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 353.50926,-797.4433 -122.21756,211.6631 -28.53477,-48.37 32.93839,-56.6875 -65.41521,-0.1719 -13.9414,-24.1698 14.23637,-24.721 93.11177,0.2939 33.46371,-57.6903 z"
id="use4863"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccc" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#7ebae4;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 362.88537,-628.243 244.41439,0.012 -27.62229,48.8968 -65.56199,-0.1817 32.55876,56.7371 -13.96098,24.1585 -28.52722,0.032 -46.3013,-80.7841 -66.69317,-0.1353 z"
id="use4865"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccc" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#7ebae4;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 505.14318,-720.9886 -122.19683,-211.6751 56.15706,-0.5268 32.6236,56.8692 32.85645,-56.5653 27.90237,0.011 14.29086,24.6896 -46.81047,80.4902 33.22946,57.8256 z"
id="use4867"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccc" />
<path
sodipodi:nodetypes="cccccccccc"
inkscape:connector-curvature="0"
id="path4873"
d="m 309.40365,-710.2521 122.19683,211.6751 -56.15706,0.5268 -32.6236,-56.8692 -32.85645,56.5653 -27.90237,-0.011 -14.29086,-24.6896 46.81047,-80.4902 -33.22946,-57.8256 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5277c3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
sodipodi:nodetypes="cccccccccc"
inkscape:connector-curvature="0"
id="use4875"
d="m 451.3364,-803.53264 -244.4144,-0.012 27.62229,-48.89685 65.56199,0.18175 -32.55875,-56.73717 13.96097,-24.15851 28.52722,-0.0315 46.3013,80.78414 66.69317,0.13524 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5277c3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
sodipodi:nodetypes="cccccccccc"
inkscape:connector-curvature="0"
id="use4877"
d="m 460.87178,-633.8425 122.21757,-211.66304 28.53477,48.37003 -32.93839,56.68751 65.4152,0.1718 13.9414,24.1698 -14.23636,24.7211 -93.11177,-0.294 -33.46371,57.6904 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#5277c3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<g
id="layer2"
inkscape:label="guides"
style="display:none"
transform="translate(72.039038,-1799.4476)">
<path
d="M 460.60629,594.72881 209.74183,594.7288 84.309616,377.4738 209.74185,160.21882 l 250.86446,1e-5 125.43222,217.255 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="true"
sodipodi:arg2="1.5707963"
sodipodi:arg1="1.0471976"
sodipodi:r2="217.25499"
sodipodi:r1="250.86446"
sodipodi:cy="377.47382"
sodipodi:cx="335.17407"
sodipodi:sides="6"
id="path6032"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.23600003;fill:#4e4d52;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
sodipodi:type="star" />
<path
transform="translate(0,-308.26772)"
sodipodi:type="star"
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#4e4d52;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
id="path5875"
sodipodi:sides="6"
sodipodi:cx="335.17407"
sodipodi:cy="685.74158"
sodipodi:r1="100.83495"
sodipodi:r2="87.32563"
sodipodi:arg1="1.0471976"
sodipodi:arg2="1.5707963"
inkscape:flatsided="true"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 385.59154,773.06721 -100.83495,0 -50.41747,-87.32564 50.41748,-87.32563 100.83495,10e-6 50.41748,87.32563 z" />
<path
transform="translate(0,-308.26772)"
sodipodi:nodetypes="ccccccccc"
inkscape:connector-curvature="0"
id="path5851"
d="m 1216.5591,938.53395 123.0545,228.14035 -42.6807,-1.2616 -43.4823,-79.7725 -39.6506,80.3267 -32.6875,-19.7984 53.4737,-100.2848 -37.1157,-73.88955 z"
style="fill:url(#linearGradient5855);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.41499999;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#c53a3a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect5884"
width="48.834862"
height="226.22897"
x="-34.74221"
y="446.17056"
transform="rotate(-30)" />
<path
transform="translate(0,-308.26772)"
sodipodi:type="star"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.50899999;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="path3428"
sodipodi:sides="6"
sodipodi:cx="223.93674"
sodipodi:cy="878.63831"
sodipodi:r1="28.048939"
sodipodi:r2="24.291094"
sodipodi:arg1="0"
sodipodi:arg2="0.52359878"
inkscape:flatsided="true"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 251.98568,878.63831 -14.02447,24.29109 h -28.04894 l -14.02447,-24.29109 14.02447,-24.2911 h 28.04894 z" />
<use
x="0"
y="0"
xlink:href="#rect5884"
id="use4252"
transform="rotate(60,268.29786,489.4515)"
width="100%"
height="100%" />
<rect
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:0.6507937;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
id="rect4254"
width="5.3947482"
height="115.12564"
x="545.71014"
y="467.07007"
transform="rotate(30,575.23539,-154.13386)" />
</g>
</g>
<g
id="layer3"
inkscape:label="gradient-logo"
style="display:inline;opacity:1"
transform="translate(-156.33871,933.1905)">
<path
sodipodi:nodetypes="cccccccccc"
inkscape:connector-curvature="0"
id="path3336-6"
d="m 309.54892,-710.38827 122.19683,211.67512 -56.15706,0.5268 -32.6236,-56.8692 -32.85645,56.5653 -27.90237,-0.011 -14.29086,-24.6896 46.81047,-80.4901 -33.22946,-57.8257 z"
style="opacity:1;fill:url(#linearGradient3917);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<use
height="100%"
width="100%"
transform="rotate(60,407.11155,-715.78724)"
id="use3439-6"
inkscape:transform-center-y="151.59082"
inkscape:transform-center-x="124.43045"
xlink:href="#path3336-6"
y="0"
x="0" />
<use
height="100%"
width="100%"
transform="rotate(-60,407.31177,-715.70016)"
id="use3445-0"
inkscape:transform-center-y="75.573958"
inkscape:transform-center-x="-168.20651"
xlink:href="#path3336-6"
y="0"
x="0" />
<use
height="100%"
width="100%"
transform="rotate(180,407.41868,-715.7565)"
id="use3449-5"
inkscape:transform-center-y="-139.94592"
inkscape:transform-center-x="59.669705"
xlink:href="#path3336-6"
y="0"
x="0" />
<path
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:url(#linearGradient3919);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
d="m 309.54892,-710.38827 122.19683,211.67512 -56.15706,0.5268 -32.6236,-56.8692 -32.85645,56.5653 -27.90237,-0.011 -14.29086,-24.6896 46.81047,-80.4901 -33.22946,-57.8256 z"
id="path4260-0"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccc" />
<use
height="100%"
width="100%"
transform="rotate(120,407.33916,-716.08356)"
id="use4354-5"
xlink:href="#path4260-0"
y="0"
x="0"
style="display:inline" />
<use
height="100%"
width="100%"
transform="rotate(-120,407.28823,-715.86995)"
id="use4362-2"
xlink:href="#path4260-0"
y="0"
x="0"
style="display:inline" />
</g>
</g>
</g>
<flowRoot
xml:space="preserve"
id="flowRoot6066"
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"><flowRegion
id="flowRegion6068"><rect
id="rect6070"
width="650"
height="201.42857"
x="428.57144"
y="231.42857" /></flowRegion><flowPara
id="flowPara6072" /></flowRoot> <g
id="g3895"
transform="matrix(1.087741,0,0,1.0877425,-1.5979005,-62.174062)">
<g
id="g4759"
transform="translate(0,-0.48648156)">
<flowRoot
transform="matrix(0.45162205,0,0,0.45162205,-75.796378,125.9913)"
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:96px;line-height:1.25;font-family:Vegur;-inkscape-font-specification:'Vegur, Light';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:url(#linearGradient4769);fill-opacity:1;stroke:none"
id="flowRoot3849"
xml:space="preserve"><flowRegion
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:96px;font-family:Vegur;-inkscape-font-specification:'Vegur, Light';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient4765);fill-opacity:1"
id="flowRegion3845"><rect
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:96px;font-family:Vegur;-inkscape-font-specification:'Vegur, Light';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient4763);fill-opacity:1"
y="218.57143"
x="412.85715"
height="200"
width="787.14282"
id="rect3843" /></flowRegion><flowPara
style="fill:url(#linearGradient4767);fill-opacity:1"
id="flowPara3847">gradle</flowPara></flowRoot> <flowRoot
transform="matrix(0.45162205,0,0,0.45162205,34.199761,125.86986)"
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:96px;line-height:1.25;font-family:Vegur;-inkscape-font-specification:'Vegur, Light';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ff2a2a;fill-opacity:0.68707485;stroke:none"
id="flowRoot3865"
xml:space="preserve"><flowRegion
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:96px;font-family:Vegur;-inkscape-font-specification:'Vegur, Light';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ff2a2a;fill-opacity:0.68707485"
id="flowRegion3861"><rect
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:96px;font-family:Vegur;-inkscape-font-specification:'Vegur, Light';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ff2a2a;fill-opacity:0.68707485"
y="218.57143"
x="412.85715"
height="200"
width="787.14282"
id="rect3859" /></flowRegion><flowPara
id="flowPara3863">2</flowPara></flowRoot> <flowRoot
xml:space="preserve"
id="flowRoot3873"
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:96px;line-height:1.25;font-family:Vegur;-inkscape-font-specification:'Vegur, Light';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:url(#linearGradient4745);fill-opacity:1;stroke:none"
transform="matrix(0.45162205,0,0,0.45162205,56.653631,125.86986)"><flowRegion
id="flowRegion3869"
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:96px;font-family:Vegur;-inkscape-font-specification:'Vegur, Light';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient4773);fill-opacity:1"><rect
id="rect3867"
width="787.14282"
height="200"
x="412.85715"
y="218.57143"
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:96px;font-family:Vegur;-inkscape-font-specification:'Vegur, Light';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient4771);fill-opacity:1" /></flowRegion><flowPara
style="fill:url(#linearGradient4775);fill-opacity:1"
id="flowPara3871">nix</flowPara></flowRoot> </g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -1,20 +1,11 @@
plugins {
base
idea
kotlin("jvm") version embeddedKotlinVersion apply false
kotlin("kapt") version embeddedKotlinVersion apply false
id("com.github.johnrengelman.shadow") version "5.2.0" apply false
id("org.ajoberstar.stutter") version "0.5.1" apply false
}
group = "org.nixos.gradle2nix"
version = property("VERSION") ?: "unspecified"
subprojects {
repositories {
jcenter()
maven { url = uri("https://repo.gradle.org/gradle/libs-releases") }
}
group = rootProject.group
version = rootProject.version
}
@@ -36,12 +27,11 @@ allprojects {
tasks.register("lock") {
doFirst {
assert(gradle.startParameter.isWriteDependencyLocks)
file("buildscript-gradle.lockfile").delete()
file("gradle.lockfile").delete()
}
doLast {
sourceSets.all {
configurations[compileClasspathConfigurationName].resolve()
configurations[runtimeClasspathConfigurationName].resolve()
}
configurations.matching { it.isCanBeResolved }.all { resolve() }
}
}
}
@@ -50,7 +40,7 @@ allprojects {
tasks {
wrapper {
gradleVersion = "6.1"
gradleVersion = "6.8.1"
distributionType = Wrapper.DistributionType.ALL
}
}

View File

@@ -3,17 +3,36 @@
with pkgs;
let
buildGradle = pkgs.callPackage ./gradle-env.nix {};
buildGradle = callPackage ./gradle-env.nix {};
in buildGradle {
envSpec = ./gradle-env.json;
gradle2nix = buildGradle {
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 = ''
mkdir -p $out
cp -r app/build/install/gradle2nix/* $out/
'';
}
installPhase = ''
mkdir -p $out
cp -r app/build/install/gradle2nix/* $out/
'';
passthru = {
plugin = "${gradle2nix}/share/plugin.jar";
};
};
in gradle2nix

View File

@@ -0,0 +1,30 @@
val kotlinVersion = "1.3.61"
val spekVersion = "2.0.9"
plugins {
application
kotlin("jvm") version "1.3.61"
}
dependencies {
compile(kotlin("stdlib"))
implementation("com.natpryce:konfig:1.6.10.0")
implementation("com.github.pengrad:java-telegram-bot-api:4.6.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3")
implementation("org.jetbrains.exposed:exposed-core:0.21.1")
implementation("org.jetbrains.exposed", "exposed-dao", "0.21.1")
implementation("org.jetbrains.exposed", "exposed-jdbc", "0.21.1")
implementation("org.jetbrains.exposed", "exposed-jodatime", "0.21.1")
implementation("io.javalin:javalin:3.7.0")
implementation("org.slf4j:slf4j-simple:1.8.0-beta4")
implementation(group = "org.xerial", name = "sqlite-jdbc", version = "3.30.1")
implementation("org.postgresql:postgresql:42.2.2")
implementation("com.fasterxml.jackson.core:jackson-databind:2.10.1")
testImplementation("org.spekframework.spek2:spek-dsl-jvm:$spekVersion")
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spekVersion")
testCompile("com.winterbe:expekt:0.5.0")
}
repositories {
jcenter()
}

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 {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url = uri("http://localhost:9999") }
}
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 {
mavenCentral()
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }
maven { url = uri("http://localhost:9999") }
}
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

@@ -4,7 +4,7 @@
#
# with (import <nixpkgs> {});
# let
# buildGradle = callPackage ./gradleEnv.nix {};
# buildGradle = callPackage ./gradle-env.nix {};
# in
# buildGradle {
# envSpec = ./gradle-env.json;
@@ -32,12 +32,12 @@
let
inherit (builtins)
filter sort replaceStrings attrValues match fromJSON
concatStringsSep;
attrValues concatStringsSep filter fromJSON match replaceStrings sort;
inherit (stdenv.lib)
versionOlder unique mapAttrs last concatMapStringsSep removeSuffix
optionalString groupBy' readFile hasSuffix;
assertMsg concatMapStringsSep groupBy' hasSuffix last mapAttrs
mapAttrsToList optionalString readFile removeSuffix unique versionAtLeast
versionOlder;
mkDep = depSpec: stdenv.mkDerivation {
inherit (depSpec) name;
@@ -176,10 +176,20 @@ let
paths = map mkDep deps ++ mkModuleMetadata deps ++ mkSnapshotMetadata deps;
};
mkInitScript = projectSpec:
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()
@@ -204,18 +214,35 @@ let
}
}
gradle.settingsEvaluated {
offlineRepo(it.pluginManagement.repositories, "plugin", "${repos.plugin}")
}
${optionalString (hasDependencies.settings && (versionAtLeast gradle.version "6.0")) ''
gradle.beforeSettings {
offlineRepo(it.buildscript.repositories, "settings", "${repos.settings}")
}
''}
gradle.projectsLoaded {
allprojects {
buildscript {
offlineRepo(repositories, "buildscript", "${repos.buildscript}")
}
offlineRepo(repositories, "project", "${repos.project}")
}
}
${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:
@@ -227,12 +254,14 @@ let
src = fetchurl {
inherit (gradleSpec) url sha256;
};
} // {
inherit (gradleSpec) version;
};
mkProjectEnv = projectSpec: {
inherit (projectSpec) name version;
initScript = mkInitScript projectSpec;
mkProjectEnv = projectSpec: rec {
inherit (projectSpec) name path version;
gradle = args.gradlePackage or mkGradle projectSpec.gradle;
initScript = mkInitScript projectSpec gradle;
};
gradleEnv = mapAttrs
@@ -243,6 +272,23 @@ let
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;
@@ -254,14 +300,15 @@ in stdenv.mkDerivation (args // {
(
set -x
env \
"GRADLE_USER_HOME=$(mktemp -d)" \
gradle --offline --no-daemon --no-build-cache \
--info --full-stacktrace --warning-mode=all \
${optionalString enableParallelBuilding "--parallel"} \
${optionalString enableDebug "-Dorg.gradle.debug=true"} \
--init-script ${projectEnv.initScript} \
${concatStringsSep " " gradleFlags}
# 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

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,176 @@
<?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 @@
07e9957e505eb062485e8ba52d14620e38baf45d

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 @@
88e79ca0e696263e63bc9dc759a2e9c0d66e36d9

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<metadata>
<groupId>org.apache</groupId>
<artifactId>test</artifactId>
<version>1.0.0</version>
</metadata>

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,17 @@
plugins {
id('java')
}
repositories {
maven {
url "s3://repositories/m2"
credentials(AwsCredentials) {
accessKey "foo"
secretKey "bar"
}
}
}
dependencies {
implementation("org.apache:test-SNAPSHOT1:2.0.0-SNAPSHOT")
}

View File

@@ -0,0 +1,17 @@
plugins {
java
}
repositories {
maven {
url = uri("s3://repositories/m2")
credentials(AwsCredentials::class) {
accessKey = "foo"
secretKey = "bar"
}
}
}
dependencies {
implementation("org.apache:test-SNAPSHOT1:2.0.0-SNAPSHOT")
}

View File

@@ -0,0 +1,17 @@
plugins {
id('java')
}
repositories {
maven {
url "s3://repositories/m2"
credentials(AwsCredentials) {
accessKey "foo"
secretKey "bar"
}
}
}
dependencies {
implementation("org.apache:test:1.0.0")
}

View File

View File

@@ -0,0 +1,17 @@
plugins {
java
}
repositories {
maven {
url = uri("s3://repositories/m2")
credentials(AwsCredentials::class) {
accessKey = "foo"
secretKey = "bar"
}
}
}
dependencies {
implementation("org.apache:test:1.0.0")
}

View File

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

View File

@@ -0,0 +1,7 @@
plugins {
java
}
dependencies {
implementation("org.apache:test:1.0.0")
}

View File

@@ -0,0 +1,6 @@
dependencyResolutionManagement {
repositories {
maven { url = uri("http://localhost:9999") }
}
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
}

43
flake.lock generated Normal file
View File

@@ -0,0 +1,43 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1605370193,
"narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5021eac20303a61fafe17224c087f5519baed54d",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1607536117,
"narHash": "sha256-q3xr1fz93VNMnZjpqLN3VyphED2UxO6pd8jR8B4S+lo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b8936e55235bb4a970514d4bb9fbd77a2c16b806",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable-small",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

25
flake.nix Normal file
View File

@@ -0,0 +1,25 @@
{
description = "Wrap Gradle builds with Nix";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
rec {
packages.gradle2nix = import ./default.nix { inherit pkgs; };
defaultPackage = packages.gradle2nix;
apps.gradle2nix = {
type = "app";
program = "${packages.gradle2nix}/bin/gradle2nix";
};
defaultApp = apps.gradle2nix;
}
);
}

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
#
# with (import <nixpkgs> {});
# let
# buildGradle = callPackage ./gradleEnv.nix {};
# buildGradle = callPackage ./gradle-env.nix {};
# in
# buildGradle {
# envSpec = ./gradle-env.json;
@@ -19,38 +19,95 @@
# '';
# }
{ stdenv, buildEnv, fetchurl, gradleGen, writeText, writeTextDir }:
{ lib
, stdenv
, buildEnv
, fetchs3
, fetchurl
, gradleGen
, writeText
, writeTextDir
}:
{ envSpec
{
# Path to the environment spec generated by gradle2nix (e.g. gradle-env.json).
envSpec
, pname ? null
, version ? null
, enableParallelBuilding ? true
# Arguments to Gradle used to build the project in buildPhase.
, gradleFlags ? [ "build" ]
# Gradle package to use instead of the one generated by gradle2nix.
, gradlePackage ? null
# Enable debugging for the Gradle build; this will cause Gradle to run a debug server
# and wait for a JVM debugging client to attach.
, enableDebug ? false
# Additional code to run in the Gradle init script (init.gradle).
, extraInit ? ""
# Override the default JDK used to run Gradle itself.
, buildJdk ? null
# Override functions which fetch dependency artifacts.
# Keys in this set are URL schemes such as "https" or "s3".
# Values are functions which take a dependency in the form
# `{ urls, sha256 }` and fetch into the Nix store. For example:
#
# {
# s3 = { urls, sha256 }: fetchs3 {
# s3url = builtins.head urls;
# inherit sha256;
# region = "us-west-2";
# credentials = {
# access_key_id = "foo";
# secret_access_key = "bar";
# };
# };
# }
, fetchers ? { }
, ... } @ args:
let
inherit (builtins)
filter sort replaceStrings attrValues match fromJSON
concatStringsSep;
attrValues concatStringsSep filter fromJSON getAttr head match
replaceStrings sort;
inherit (stdenv.lib)
versionOlder unique mapAttrs last concatMapStringsSep removeSuffix
optionalString groupBy' readFile hasSuffix;
inherit (lib)
assertMsg concatMapStringsSep groupBy' hasSuffix hasPrefix last mapAttrs
mapAttrsToList optionalString readFile removeSuffix unique versionAtLeast
versionOlder;
mkDep = depSpec: stdenv.mkDerivation {
inherit (depSpec) name;
fetchers' = {
http = fetchurl;
https = fetchurl;
s3 = { urls, sha256 }: fetchs3 {
s3url = head urls;
inherit sha256;
};
} // fetchers;
src = fetchurl {
inherit (depSpec) urls sha256;
# Fetch urls using the scheme for the first entry only; there isn't a
# straightforward way to tell Nix to try multiple fetchers in turn
# and short-circuit on the first successful fetch.
fetch = { urls, sha256 }:
let
first = head urls;
scheme = head (builtins.match "([a-z0-9+.-]+)://.*" first);
fetch' = getAttr scheme fetchers';
urls' = filter (hasPrefix scheme) urls;
in
fetch' { urls = urls'; inherit sha256; };
mkDep = { name, path, urls, sha256, ... }: stdenv.mkDerivation {
inherit name;
src = fetch {
inherit urls sha256;
};
phases = "installPhase";
installPhase = ''
mkdir -p $out/${depSpec.path}
ln -s $src $out/${depSpec.path}/${depSpec.name}
mkdir -p $out/${path}
ln -s $src $out/${path}/${name}
'';
};
@@ -176,10 +233,33 @@ let
paths = map mkDep deps ++ mkModuleMetadata deps ++ mkSnapshotMetadata deps;
};
mkInitScript = projectSpec:
mkInitScript = projectSpec: gradle:
let
repos = mapAttrs (mkRepo projectSpec.name) projectSpec.dependencies;
hasDependencies = mapAttrs (type: deps: deps != []) projectSpec.dependencies;
inSettings = pred: script:
optionalString pred (
if versionAtLeast gradle.version "6.0" then ''
gradle.beforeSettings {
${script}
}
'' else ''
gradle.settingsEvaluated {
${script}
}
''
);
in
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()
@@ -204,18 +284,44 @@ let
}
}
gradle.settingsEvaluated {
offlineRepo(it.pluginManagement.repositories, "plugin", "${repos.plugin}")
}
${inSettings (hasDependencies.settings && (versionAtLeast gradle.version "6.0")) ''
offlineRepo(it.buildscript.repositories, "settings", "${repos.settings}")
''}
gradle.projectsLoaded {
allprojects {
buildscript {
offlineRepo(repositories, "buildscript", "${repos.buildscript}")
${inSettings (hasDependencies.plugin) ''
offlineRepo(it.pluginManagement.repositories, "plugin", "${repos.plugin}")
''}
${optionalString (hasDependencies.buildscript) ''
gradle.projectsLoaded {
allprojects {
buildscript {
offlineRepo(repositories, "buildscript", "${repos.buildscript}")
}
}
}
''}
${optionalString (hasDependencies.project) (
if versionAtLeast gradle.version "6.8"
then ''
gradle.beforeSettings {
it.dependencyResolutionManagement {
offlineRepo(repositories, "project", "${repos.project}")
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
}
offlineRepo(repositories, "project", "${repos.project}")
}
}
''
else ''
gradle.projectsLoaded {
allprojects {
offlineRepo(repositories, "project", "${repos.project}")
}
}
''
)}
${extraInit}
'';
mkGradle = gradleSpec:
@@ -227,12 +333,14 @@ let
src = fetchurl {
inherit (gradleSpec) url sha256;
};
} // {
inherit (gradleSpec) version;
};
mkProjectEnv = projectSpec: {
inherit (projectSpec) name version;
initScript = mkInitScript projectSpec;
mkProjectEnv = projectSpec: rec {
inherit (projectSpec) name path version;
gradle = args.gradlePackage or mkGradle projectSpec.gradle;
initScript = mkInitScript projectSpec gradle;
};
gradleEnv = mapAttrs
@@ -243,6 +351,26 @@ let
pname = args.pname or projectEnv.name;
version = args.version or projectEnv.version;
buildProject = env: flags: ''
cp ${env.initScript} "$GRADLE_USER_HOME/init.d"
gradle --offline --no-daemon --no-build-cache \
--info --full-stacktrace --warning-mode=all \
${optionalString enableParallelBuilding "--parallel"} \
${optionalString enableDebug "-Dorg.gradle.debug=true"} \
${optionalString (buildJdk != null) "-Dorg.gradle.java.home=${buildJdk.home}"} \
--init-script ${env.initScript} \
${optionalString (env.path != "") ''-p "${env.path}"''} \
${concatStringsSep " " flags}
'';
buildIncludedProjects =
concatStringsSep "\n" (mapAttrsToList
(_: env: buildProject env [ "build" ])
(removeAttrs gradleEnv [ "" ]));
buildRootProject = buildProject projectEnv gradleFlags;
in stdenv.mkDerivation (args // {
inherit pname version;
@@ -253,15 +381,15 @@ in stdenv.mkDerivation (args // {
runHook preBuild
(
set -x
env \
"GRADLE_USER_HOME=$(mktemp -d)" \
gradle --offline --no-daemon --no-build-cache \
--info --full-stacktrace --warning-mode=all \
${optionalString enableParallelBuilding "--parallel"} \
${optionalString enableDebug "-Dorg.gradle.debug=true"} \
--init-script ${projectEnv.initScript} \
${concatStringsSep " " gradleFlags}
set -eux
# Work around https://github.com/gradle/gradle/issues/1055
TMPHOME="$(mktemp -d)"
mkdir -p "$TMPHOME/init.d"
export GRADLE_USER_HOME="$TMPHOME"
${buildIncludedProjects}
${buildRootProject}
)
runHook postBuild

View File

@@ -1,3 +1,6 @@
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
VERSION=1.0.0-rc1
VERSION=1.0.0-rc2
shadowVersion=6.1.0
stutterVersion=0.6.0

View File

@@ -0,0 +1,52 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.fasterxml.jackson.core:jackson-annotations:2.12.1
com.fasterxml.jackson.core:jackson-core:2.12.1
com.fasterxml.jackson.core:jackson-databind:2.12.1
com.fasterxml.jackson:jackson-bom:2.12.1
com.github.gundy:semver4j:0.16.4
com.github.jengelman.gradle.plugins:shadow:6.1.0
com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:6.1.0
com.google.code.gson:gson:2.8.6
commons-io:commons-io:2.6
de.undercouch:gradle-download-task:4.0.2
org.ajoberstar.stutter:org.ajoberstar.stutter.gradle.plugin:0.6.0
org.ajoberstar:gradle-stutter:0.6.0
org.antlr:antlr4-runtime:4.5.2-1
org.apache.ant:ant-launcher:1.9.7
org.apache.ant:ant:1.9.7
org.apache.logging.log4j:log4j-api:2.13.3
org.apache.logging.log4j:log4j-core:2.13.3
org.codehaus.plexus:plexus-utils:3.0.24
org.jdom:jdom2:2.0.6
org.jetbrains.intellij.deps:trove4j:1.0.20181211
org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.4.20
org.jetbrains.kotlin.kapt:org.jetbrains.kotlin.kapt.gradle.plugin:1.4.20
org.jetbrains.kotlin:kotlin-android-extensions:1.4.20
org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.4.20
org.jetbrains.kotlin:kotlin-build-common:1.4.20
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.20
org.jetbrains.kotlin:kotlin-compiler-runner:1.4.20
org.jetbrains.kotlin:kotlin-daemon-client:1.4.20
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.4.20
org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.4.20
org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.4.20
org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20
org.jetbrains.kotlin:kotlin-reflect:1.4.20
org.jetbrains.kotlin:kotlin-script-runtime:1.4.20
org.jetbrains.kotlin:kotlin-scripting-common:1.4.20
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.4.20
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.4.20
org.jetbrains.kotlin:kotlin-scripting-jvm:1.4.20
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20
org.jetbrains.kotlin:kotlin-stdlib:1.4.20
org.jetbrains.kotlin:kotlin-util-io:1.4.20
org.jetbrains.kotlin:kotlin-util-klib:1.4.20
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7
org.jetbrains:annotations:13.0
org.ow2.asm:asm-analysis:9.0
org.ow2.asm:asm-commons:9.0
org.ow2.asm:asm-tree:9.0
org.ow2.asm:asm:9.0
org.vafer:jdependency:2.1.1

Binary file not shown.

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

2
gradlew vendored
View File

@@ -82,6 +82,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# 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_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.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute
echo.
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_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -61,28 +64,14 @@ echo location of your Java installation.
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
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@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
@rem End local scope for the variables with windows NT shell

24
ivy/build.gradle.kts Normal file
View File

@@ -0,0 +1,24 @@
plugins {
kotlin("jvm")
}
dependencies {
api("org.apache.ivy:ivy:latest.release")
api("com.amazonaws:aws-java-sdk-s3:latest.release")
testImplementation("com.adobe.testing:s3mock-junit5:latest.release")
testImplementation("io.strikt:strikt-core:latest.release")
testImplementation("org.junit.jupiter:junit-jupiter-api:latest.release")
testImplementation("org.junit.jupiter:junit-jupiter-params:latest.release")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:latest.release")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:latest.release")
}
tasks {
test {
useJUnitPlatform {
includeEngines("junit-jupiter")
}
systemProperty("fixtures", "$rootDir/fixtures")
}
}

123
ivy/gradle.lockfile Normal file
View File

@@ -0,0 +1,123 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
ch.qos.logback:logback-classic:1.2.3=testCompileClasspath,testRuntimeClasspath
ch.qos.logback:logback-core:1.2.3=testCompileClasspath,testRuntimeClasspath
com.adobe.testing:s3mock-junit5:2.1.28=testCompileClasspath,testRuntimeClasspath
com.adobe.testing:s3mock-testsupport-common:2.1.28=testCompileClasspath,testRuntimeClasspath
com.adobe.testing:s3mock:2.1.28=testCompileClasspath,testRuntimeClasspath
com.amazonaws:aws-java-sdk-core:1.11.946=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.amazonaws:aws-java-sdk-kms:1.11.946=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.amazonaws:aws-java-sdk-s3:1.11.946=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.amazonaws:jmespath-java:1.11.946=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.christophsturm:filepeek:0.1.2=testRuntimeClasspath
com.fasterxml.jackson.core:jackson-annotations:2.6.0=compileClasspath,runtimeClasspath
com.fasterxml.jackson.core:jackson-annotations:2.9.0=testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-core:2.6.7=compileClasspath,runtimeClasspath
com.fasterxml.jackson.core:jackson-core:2.9.9=testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-databind:2.6.7.4=compileClasspath,runtimeClasspath
com.fasterxml.jackson.core:jackson-databind:2.9.9.3=testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.7=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.9=testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.9=testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.9=testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.9.9=testCompileClasspath,testRuntimeClasspath
com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.9=testCompileClasspath,testRuntimeClasspath
com.fasterxml.woodstox:woodstox-core:5.1.0=testCompileClasspath,testRuntimeClasspath
com.fasterxml:classmate:1.3.4=testCompileClasspath,testRuntimeClasspath
com.typesafe.netty:netty-reactive-streams-http:2.0.0=testRuntimeClasspath
com.typesafe.netty:netty-reactive-streams:2.0.0=testRuntimeClasspath
commons-codec:commons-codec:1.11=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
commons-io:commons-io:2.6=testCompileClasspath,testRuntimeClasspath
commons-logging:commons-logging:1.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
io.netty:netty-buffer:4.1.33.Final=testRuntimeClasspath
io.netty:netty-codec-http2:4.1.33.Final=testRuntimeClasspath
io.netty:netty-codec-http:4.1.33.Final=testRuntimeClasspath
io.netty:netty-codec:4.1.33.Final=testRuntimeClasspath
io.netty:netty-common:4.1.33.Final=testRuntimeClasspath
io.netty:netty-handler:4.1.33.Final=testRuntimeClasspath
io.netty:netty-resolver:4.1.33.Final=testRuntimeClasspath
io.netty:netty-transport-native-epoll:4.1.33.Final=testRuntimeClasspath
io.netty:netty-transport-native-unix-common:4.1.33.Final=testRuntimeClasspath
io.netty:netty-transport:4.1.33.Final=testRuntimeClasspath
io.strikt:strikt-core:0.28.2=testCompileClasspath,testRuntimeClasspath
javax.annotation:javax.annotation-api:1.3.2=testCompileClasspath,testRuntimeClasspath
javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath
javax.validation:validation-api:2.0.1.Final=testCompileClasspath,testRuntimeClasspath
joda-time:joda-time:2.8.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.commons:commons-lang3:3.8.1=testCompileClasspath,testRuntimeClasspath
org.apache.httpcomponents:httpclient:4.5.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.httpcomponents:httpcore:4.4.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.ivy:ivy:2.5.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.logging.log4j:log4j-api:2.11.2=testCompileClasspath,testRuntimeClasspath
org.apache.logging.log4j:log4j-to-slf4j:2.11.2=testCompileClasspath,testRuntimeClasspath
org.apiguardian:apiguardian-api:1.1.0=testCompileClasspath,testRuntimeClasspath
org.codehaus.woodstox:stax2-api:4.1=testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-continuation:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-http:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-io:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-security:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-server:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-servlet:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-servlets:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-util:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-webapp:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-xml:9.4.19.v20190610=testCompileClasspath,testRuntimeClasspath
org.hibernate.validator:hibernate-validator:6.0.17.Final=testCompileClasspath,testRuntimeClasspath
org.jboss.logging:jboss-logging:3.3.2.Final=testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-reflect:1.4.21-2=testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20=compileClasspath,runtimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.21-2=testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.21-2=testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21-2=testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib:1.4.20=compileClasspath,runtimeClasspath
org.jetbrains.kotlin:kotlin-stdlib:1.4.21-2=testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.2=testRuntimeClasspath
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2=testRuntimeClasspath
org.jetbrains:annotations:13.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.junit.jupiter:junit-jupiter-api:5.7.0=testCompileClasspath,testRuntimeClasspath
org.junit.jupiter:junit-jupiter-engine:5.7.0=testRuntimeClasspath
org.junit.jupiter:junit-jupiter-params:5.7.0=testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-commons:1.7.0=testCompileClasspath,testRuntimeClasspath
org.junit.platform:junit-platform-engine:1.7.0=testRuntimeClasspath
org.junit.platform:junit-platform-launcher:1.7.0=testRuntimeClasspath
org.junit:junit-bom:5.7.0=testCompileClasspath,testRuntimeClasspath
org.mortbay.jasper:apache-el:8.5.40=testCompileClasspath,testRuntimeClasspath
org.opentest4j:opentest4j:1.2.0=testCompileClasspath,testRuntimeClasspath
org.reactivestreams:reactive-streams:1.0.2=testCompileClasspath,testRuntimeClasspath
org.slf4j:jul-to-slf4j:1.7.28=testCompileClasspath,testRuntimeClasspath
org.slf4j:slf4j-api:1.7.28=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-autoconfigure:2.1.9.RELEASE=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-jetty:2.1.9.RELEASE=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-json:2.1.9.RELEASE=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-logging:2.1.9.RELEASE=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter-web:2.1.9.RELEASE=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot-starter:2.1.9.RELEASE=testCompileClasspath,testRuntimeClasspath
org.springframework.boot:spring-boot:2.1.9.RELEASE=testCompileClasspath,testRuntimeClasspath
org.springframework:spring-aop:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
org.springframework:spring-beans:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
org.springframework:spring-context:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
org.springframework:spring-core:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
org.springframework:spring-expression:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
org.springframework:spring-jcl:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
org.springframework:spring-web:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
org.springframework:spring-webmvc:5.1.10.RELEASE=testCompileClasspath,testRuntimeClasspath
org.yaml:snakeyaml:1.23=testRuntimeClasspath
software.amazon.awssdk:annotations:2.7.19=testCompileClasspath,testRuntimeClasspath
software.amazon.awssdk:apache-client:2.7.19=testRuntimeClasspath
software.amazon.awssdk:auth:2.7.19=testCompileClasspath,testRuntimeClasspath
software.amazon.awssdk:aws-core:2.7.19=testCompileClasspath,testRuntimeClasspath
software.amazon.awssdk:aws-query-protocol:2.7.19=testCompileClasspath,testRuntimeClasspath
software.amazon.awssdk:aws-xml-protocol:2.7.19=testCompileClasspath,testRuntimeClasspath
software.amazon.awssdk:http-client-spi:2.7.19=testCompileClasspath,testRuntimeClasspath
software.amazon.awssdk:netty-nio-client:2.7.19=testRuntimeClasspath
software.amazon.awssdk:profiles:2.7.19=testCompileClasspath,testRuntimeClasspath
software.amazon.awssdk:protocol-core:2.7.19=testCompileClasspath,testRuntimeClasspath
software.amazon.awssdk:regions:2.7.19=testCompileClasspath,testRuntimeClasspath
software.amazon.awssdk:s3:2.7.19=testCompileClasspath,testRuntimeClasspath
software.amazon.awssdk:sdk-core:2.7.19=testCompileClasspath,testRuntimeClasspath
software.amazon.awssdk:url-connection-client:2.7.19=testCompileClasspath,testRuntimeClasspath
software.amazon.awssdk:utils:2.7.19=testCompileClasspath,testRuntimeClasspath
software.amazon.eventstream:eventstream:1.0.1=testCompileClasspath,testRuntimeClasspath
software.amazon.ion:ion-java:1.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
empty=

View File

@@ -0,0 +1,294 @@
package org.nixos.gradle2nix
import com.amazonaws.AmazonServiceException
import com.amazonaws.ClientConfiguration
import com.amazonaws.auth.AWSCredentials
import com.amazonaws.auth.AWSStaticCredentialsProvider
import com.amazonaws.client.builder.AwsClientBuilder
import com.amazonaws.regions.Region
import com.amazonaws.regions.RegionUtils
import com.amazonaws.regions.Regions
import com.amazonaws.services.s3.AmazonS3
import com.amazonaws.services.s3.AmazonS3ClientBuilder
import com.amazonaws.services.s3.model.GetObjectRequest
import com.amazonaws.services.s3.model.ListObjectsRequest
import com.amazonaws.services.s3.model.ObjectMetadata
import com.amazonaws.services.s3.model.S3Object
import com.amazonaws.services.s3.model.S3ObjectInputStream
import com.amazonaws.util.AwsHostNameUtils
import org.apache.http.conn.ssl.NoopHostnameVerifier
import org.apache.http.conn.ssl.SSLConnectionSocketFactory
import org.apache.ivy.core.settings.TimeoutConstraint
import org.apache.ivy.plugins.repository.AbstractRepository
import org.apache.ivy.plugins.repository.RepositoryCopyProgressListener
import org.apache.ivy.plugins.repository.Resource
import org.apache.ivy.plugins.repository.TransferEvent
import org.apache.ivy.util.FileUtil
import java.io.File
import java.io.FileOutputStream
import java.io.IOException
import java.io.InputStream
import java.net.Socket
import java.net.URI
import java.security.KeyManagementException
import java.security.NoSuchAlgorithmException
import java.security.SecureRandom
import java.security.cert.X509Certificate
import javax.net.ssl.SSLContext
import javax.net.ssl.SSLEngine
import javax.net.ssl.TrustManager
import javax.net.ssl.X509ExtendedTrustManager
class S3Repository(
private val client: AmazonS3,
timeoutConstraint: TimeoutConstraint? = null
) : AbstractRepository(timeoutConstraint) {
constructor(
credentials: AWSCredentials?,
endpoint: URI?,
timeoutConstraint: TimeoutConstraint?
) : this(
AmazonS3ClientBuilder.standard().apply {
credentials?.let { setCredentials(AWSStaticCredentialsProvider(it)) }
if (endpoint != null) {
setEndpointConfiguration(
AwsClientBuilder.EndpointConfiguration(
endpoint.toString(),
AwsHostNameUtils.parseRegion(endpoint.host, null) ?: Regions.US_EAST_1.name
)
)
isChunkedEncodingDisabled = true
isPathStyleAccessEnabled = true
} else {
region = Regions.US_EAST_1.name
}
if (System.getProperty("org.nixos.gradle2nix.s3test") != null) {
clientConfiguration = ClientConfiguration().apply {
apacheHttpClientConfig.sslSocketFactory = SSLConnectionSocketFactory(
createBlindlyTrustingSslContext(),
NoopHostnameVerifier.INSTANCE
)
}
}
}.build(),
timeoutConstraint
)
private val cache = mutableMapOf<String, S3Resource>()
private val progress = RepositoryCopyProgressListener(this)
override fun getResource(source: String): Resource =
cache.getOrPut(source) { S3Resource(this, URI(source)) }
override fun get(source: String, destination: File) {
fireTransferInitiated(getResource(source), TransferEvent.REQUEST_GET)
try {
val res = getResource(source)
val totalLength = res.contentLength
if (totalLength > 0) {
progress.totalLength = totalLength
}
destination.parentFile?.mkdirs()
FileUtil.copy(
res.openStream(),
FileOutputStream(destination),
progress,
true
)
fireTransferCompleted(res.contentLength)
} catch (e: Exception) {
fireTransferError(e)
throw e
} finally {
progress.totalLength = null
}
}
override fun list(parent: String): List<String> =
S3Resource(this, URI(parent))
.let { resource ->
generateSequence({
try {
withClient(resource) {
listObjects(
ListObjectsRequest()
.withBucketName(resource.bucket)
.withPrefix(resource.key)
.withDelimiter("/")
)
}
} catch (e: AmazonServiceException) {
throw S3RepositoryException(e)
}
}) { prev ->
if (!prev.isTruncated) {
null
} else {
try {
withClient(resource) {
listNextBatchOfObjects(prev)
}
} catch (e: AmazonServiceException) {
throw S3RepositoryException(e)
}
}
}
}
.flatMap { listing ->
listing.commonPrefixes.asSequence() +
listing.objectSummaries.asSequence().map { it.key }
}
.toList()
internal fun <T> withClient(
resource: S3Resource,
block: AmazonS3.() -> T
): T = client.apply {
resource.region?.let { setRegion(it) }
}.block()
}
class S3Resource(
private val repository: S3Repository,
private val url: URI
) : Resource {
private val source: Source by lazy {
REGIONAL_ENDPOINT_PATTERN.find(url.normalize().toString())
?.let {
val (bucket, region, _, key) = it.destructured
Source(
bucket = bucket,
key = key,
region = when (region) {
"external-1" -> Region.getRegion(Regions.US_EAST_1)
else -> RegionUtils.getRegion(region)
}
)
}
?: Source(
bucket = url.bucket(),
key = url.key(),
region = null
)
}
private val metadata: Metadata by lazy {
try {
getMetadata()
} catch (e: AmazonServiceException) {
null
}?.let { meta ->
Metadata(
exists = true,
contentLength = meta.contentLength,
lastModified = meta.lastModified.time
)
} ?: Metadata(
exists = false,
contentLength = 0,
lastModified = 0
)
}
val bucket: String get() = source.bucket
val key: String get() = source.key
val region: Region? get() = source.region
override fun getName(): String = url.toString()
override fun getLastModified(): Long = metadata.lastModified
override fun getContentLength(): Long = metadata.contentLength
override fun exists(): Boolean = metadata.exists
override fun isLocal(): Boolean = false
override fun clone(cloneName: String): Resource = S3Resource(repository, URI(cloneName))
override fun openStream(): InputStream =
try { getContent() }
catch (e: AmazonServiceException) { throw S3RepositoryException(e) }
?: throw S3RepositoryException()
private fun getMetadata(): ObjectMetadata? =
getObject(withContent = false)?.objectMetadata
private fun getContent(): S3ObjectInputStream? =
getObject(withContent = true)?.objectContent
private fun getObject(withContent: Boolean = true): S3Object? {
val request = GetObjectRequest(bucket, key)
if (!withContent) {
request.setRange(0, 0)
}
return try {
repository.withClient(this) { getObject(request) }
} catch (e: AmazonServiceException) {
val errorCode = e.errorCode
if (errorCode != null && "NoSuchKey".compareTo(errorCode, ignoreCase = true) == 0) {
null
} else {
e.printStackTrace()
throw e
}
}
}
private data class Source(
val bucket: String,
val key: String,
val region: Region?
)
private data class Metadata(
val exists: Boolean,
val contentLength: Long,
val lastModified: Long
)
companion object {
private val REGIONAL_ENDPOINT_PATTERN =
Regex("""^s3://(.+)?\.s3[.-]([a-z0-9-]+)\.amazonaws\.com(\.[a-z]+)?/(.+)""")
}
}
class S3RepositoryException : RuntimeException {
constructor() : super()
constructor(throwable: Throwable) : super(throwable)
}
private fun URI.bucket(): String = normalize().host
private fun URI.key(): String = normalize().path.removePrefix("/")
// Used for testing.
private fun createBlindlyTrustingSslContext(): SSLContext? {
return try {
SSLContext.getInstance("TLS").apply {
init(null, arrayOf<TrustManager>(object : X509ExtendedTrustManager() {
override fun getAcceptedIssuers(): Array<X509Certificate>? = null
override fun checkClientTrusted(arg0: Array<X509Certificate?>?, arg1: String?, arg2: Socket?) {}
override fun checkClientTrusted(arg0: Array<X509Certificate?>?, arg1: String?, arg2: SSLEngine?) {}
override fun checkClientTrusted(certs: Array<X509Certificate?>?, authType: String?) {}
override fun checkServerTrusted(certs: Array<X509Certificate?>?, authType: String?) {}
override fun checkServerTrusted(arg0: Array<X509Certificate?>?, arg1: String?, arg2: Socket?) {}
override fun checkServerTrusted(arg0: Array<X509Certificate?>?, arg1: String?, arg2: SSLEngine?) {}
}), SecureRandom())
}
} catch (e: NoSuchAlgorithmException) {
throw RuntimeException("Unexpected exception", e)
} catch (e: KeyManagementException) {
throw RuntimeException("Unexpected exception", e)
}
}

View File

@@ -0,0 +1,113 @@
package org.nixos.gradle2nix
import com.adobe.testing.s3mock.junit5.S3MockExtension
import com.amazonaws.services.s3.AmazonS3
import org.apache.ivy.ant.IvyDependencyArtifact
import org.apache.ivy.core.module.descriptor.Artifact
import org.apache.ivy.core.module.descriptor.DefaultArtifact
import org.apache.ivy.core.module.id.ArtifactRevisionId
import org.apache.ivy.core.module.id.ModuleRevisionId
import org.apache.ivy.core.settings.IvySettings
import org.apache.ivy.plugins.repository.Resource
import org.apache.ivy.plugins.resolver.IBiblioResolver
import org.apache.ivy.plugins.resolver.URLResolver
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import org.junit.jupiter.api.extension.RegisterExtension
import strikt.api.expectThat
import strikt.assertions.containsExactly
import strikt.assertions.isEmpty
import strikt.assertions.isEqualTo
import strikt.assertions.isFalse
import strikt.assertions.isNotEqualTo
import strikt.assertions.isNotNull
import strikt.assertions.isTrue
import java.io.File
import java.net.URI
import kotlin.io.path.ExperimentalPathApi
import kotlin.io.path.createTempDirectory
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class S3Test {
companion object {
const val bucket = "repositories"
val fixtureRoot = File(System.getProperty("fixtures")).resolve(bucket)
@JvmField
@RegisterExtension
val s3mock: S3MockExtension = S3MockExtension.builder().withInitialBuckets(bucket).build()
}
@BeforeAll
fun populateBucket(client: AmazonS3) {
fixtureRoot.walkTopDown()
.filter { it.isFile }
.forEach { file ->
val key = file.toRelativeString(fixtureRoot)
client.putObject(bucket, key, file)
}
}
@Test
fun listsContents(client: AmazonS3) {
val repository = S3Repository(client)
expectThat(repository.list("s3://repositories/m2/org/apache/test/1.0.0/")).containsExactly(
"m2/org/apache/test/1.0.0/test-1.0.0.jar",
"m2/org/apache/test/1.0.0/test-1.0.0.pom",
)
}
@Test
fun findsResourceMetadata(client: AmazonS3) {
val repository = S3Repository(client)
val resource: Resource = S3Resource(repository, URI("s3://repositories/m2/org/apache/test/1.0.0/test-1.0.0.pom"))
expectThat(resource).and {
get { exists() }.isTrue()
get { contentLength }.isNotEqualTo(-1L)
get { lastModified }.isNotEqualTo(-1L)
}
}
@Test
fun downloadsResource(client: AmazonS3) {
val repository = S3Repository(client)
val resource: Resource = S3Resource(repository, URI("s3://repositories/m2/org/apache/test/1.0.0/test-1.0.0.pom"))
val source = fixtureRoot.resolve("m2/org/apache/test/1.0.0/test-1.0.0.pom").readText()
expectThat(resource.openStream().bufferedReader().readText()).isEqualTo(source)
}
@ExperimentalPathApi
@Test
fun locatesArtifact(client: AmazonS3) {
val resolver = IBiblioResolver().apply {
name = "s3"
root = "s3://repositories/m2/"
isM2compatible = true
settings = IvySettings().apply {
defaultInit()
setDefaultRepositoryCacheBasedir(createTempDirectory().toString())
}
repository = S3Repository(client)
}
val origin = resolver.locate(DefaultArtifact(
ArtifactRevisionId.newInstance(
ModuleRevisionId.newInstance("org.apache", "test", "1.0.0"),
"test",
"jar",
"jar"
),
null,
null,
false
))
expectThat(origin).isNotNull().and {
get { isExists }.isTrue()
get { isLocal }.isFalse()
get { location }.isEqualTo("s3://repositories/m2/org/apache/test/1.0.0/test-1.0.0.jar")
}
}
}

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.20=compileClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20=compileClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.20=compileClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.20=compileClasspath,testCompileClasspath,testRuntimeClasspath
org.jetbrains.kotlin:kotlin-stdlib:1.4.20=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

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