-
-
Save lptr/8fdd585a764efe8ad866 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/build.gradle b/build.gradle | |
index 000d73a..72a2730 100644 | |
--- a/build.gradle | |
+++ b/build.gradle | |
@@ -35,7 +35,7 @@ def schemaDir = "$buildDir/schema" | |
def rootBuild = "${rootProject.projectDir}/build" | |
def finalSandboxDir = "${rootBuild}/cabal-sandbox" | |
def rawSandboxDir = "${rootBuild}/raw-cabal-sandbox" | |
-def sandboxConfig = "${rootBuild}/cabal.sandbox.config" | |
+def sandboxConfig = "${projectDir}/cabal.sandbox.config" | |
configurations { | |
sandbox | |
@@ -63,8 +63,9 @@ task copySchema(type: Copy) { | |
} | |
task cabalInitConfig(type: Exec) { | |
- onlyIf{!file("${sandboxConfig}").exists()} | |
- commandLine "bash" , "-c", "cabal sandbox init --sandbox=$finalSandboxDir && mv cabal.sandbox.config ${rootBuild}/" | |
+ outputs.upToDateWhen{file("${sandboxConfig}").exists()} | |
+ // onlyIf | |
+ commandLine "bash" , "-c", "cabal sandbox init --sandbox=$finalSandboxDir" | |
outputs.file "${sandboxConfig}" | |
} | |
@@ -79,7 +80,7 @@ task copyCabalSandbox(type: Copy) { | |
def finalisedFile = "${rootBuild}/finalised" | |
task finaliseSandbox(type: FinaliseSandbox) { | |
- onlyIf{!file("${finalisedFile}").exists()} | |
+ outputs.upToDateWhen{file("${finalisedFile}").exists()} | |
dependsOn copyCabalSandbox | |
finalSandbox(finalSandboxDir) | |
rawSandbox(rawSandboxDir) | |
@@ -94,7 +95,7 @@ task addStuffToSandbox(type: Exec) { | |
dependsOn copySchema | |
def deps = [] | |
def copyDeps = [copySchema] | |
- onlyIf { | |
+ onlyIf{ | |
copyDeps.each { | |
it.outputs.files.each { it.eachFile { | |
def depBase = org.apache.commons.io.FilenameUtils.getBaseName("${it}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment