mirror of
https://github.com/tadfisher/gradle2nix.git
synced 2026-01-11 15:30:38 -05:00
Remove gradle-wrapper arg
It is the default behavior to use the project's Gradle wrapper if available.
This commit is contained in:
@@ -35,6 +35,13 @@ application {
|
||||
}
|
||||
|
||||
tasks {
|
||||
(run) {
|
||||
dependsOn(installDist)
|
||||
doFirst {
|
||||
jvmArgs = listOf("-Dorg.nixos.gradle2nix.share=${installDist.get().destinationDir.resolve("share")}")
|
||||
}
|
||||
}
|
||||
|
||||
startScripts {
|
||||
doLast {
|
||||
unixScript.writeText(unixScript.readText().replace("@APP_HOME@", "\$APP_HOME"))
|
||||
|
||||
@@ -6,9 +6,7 @@ import org.gradle.tooling.ProjectConnection
|
||||
fun connect(config: Config): ProjectConnection =
|
||||
GradleConnector.newConnector()
|
||||
.apply {
|
||||
if (config.wrapper) {
|
||||
useBuildDistribution()
|
||||
} else if (config.gradleVersion != null) {
|
||||
if (config.gradleVersion != null) {
|
||||
useGradleVersion(config.gradleVersion)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.io.File
|
||||
val shareDir: String = System.getProperty("org.nixos.gradle2nix.share")
|
||||
|
||||
data class Config(
|
||||
val wrapper: Boolean,
|
||||
val gradleVersion: String?,
|
||||
val configurations: List<String>,
|
||||
val projectDir: File,
|
||||
@@ -33,10 +32,6 @@ data class Config(
|
||||
class Main : CliktCommand(
|
||||
name = "gradle2nix"
|
||||
) {
|
||||
private val wrapper: Boolean by option("--gradle-wrapper", "-w",
|
||||
help = "Use the project's gradle wrapper for building")
|
||||
.flag()
|
||||
|
||||
private val gradleVersion: String? by option("--gradle-version", "-g",
|
||||
metavar = "VERSION",
|
||||
help = "Use a specific Gradle version")
|
||||
@@ -87,7 +82,7 @@ class Main : CliktCommand(
|
||||
}
|
||||
|
||||
override fun run() {
|
||||
val config = Config(wrapper, gradleVersion, configurations, projectDir, includes, buildSrc, quiet)
|
||||
val config = Config(gradleVersion, configurations, projectDir, includes, buildSrc, quiet)
|
||||
val (log, _, _) = Logger(verbose = !config.quiet)
|
||||
|
||||
val paths = resolveProjects(config).map { p ->
|
||||
@@ -95,9 +90,9 @@ class Main : CliktCommand(
|
||||
}
|
||||
|
||||
val models = connect(config).use { connection ->
|
||||
paths.associate { project ->
|
||||
paths.associateWith { project ->
|
||||
log("Resolving project model: ${project.takeIf { it.isNotEmpty() } ?: "root project"}...")
|
||||
project to connection.getBuildModel(config, project)
|
||||
connection.getBuildModel(config, project)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user