diff options
| author | Miguel <m.i@gmx.at> | 2018-07-19 21:23:14 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-07-19 21:23:14 +0200 |
| commit | e17def151428b81d4005f58c902f5e8b66fdd31e (patch) | |
| tree | c4caf13b716d2813ee21bd589a3cae91261fc96c /build.gradle.kts | |
| parent | 12ea46ea888d119784ddb06f1da10a6422262958 (diff) | |
working on gradle build script
Diffstat (limited to 'build.gradle.kts')
| -rw-r--r-- | build.gradle.kts | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 52f4f25..88698fc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,6 @@ // Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/ -val stackBinary="./stack-1.7.1-linux-x86_64/stack" +val stackBinary="./stack-bin/stack" val taskStackInstall = tasks.create("stack-install") { @@ -9,18 +9,20 @@ val taskStackInstall = tasks.create("stack-install") { doLast{ - if( !File("linux-x86_64.tar.gz").exists() ) { + if( !File(stackBinary).exists() ) { exec{ - setCommandLine("ls","-l") - } - exec{ setCommandLine("wget","https://get.haskellstack.org/stable/linux-x86_64.tar.gz") } + exec{ setCommandLine("tar","-xvf","linux-x86_64.tar.gz") } + exec{ + setCommandLine("mv","stack-*-linux-x86_64","stack-bin") + } + } else println("This taks seems up to date") } @@ -29,11 +31,20 @@ val taskStackInstall = tasks.create("stack-install") { val taskStackVersion = tasks.create<Exec>("stack-version") { - dependsOn(taskStackInstall) - description = "show haskell-stack version" group = "Haskell" + dependsOn(taskStackInstall) setCommandLine(stackBinary,"--version") } + +val taskStackInit = tasks.create<Exec>("stack-init") { + + description = "initialize stack from the package.yaml" + group = "Haskell" + + dependsOn(taskStackInstall) + setCommandLine(stackBinary,"init") + +} |
