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 | |
| parent | 12ea46ea888d119784ddb06f1da10a6422262958 (diff) | |
working on gradle build script
| -rw-r--r-- | app/Main.hs | 3 | ||||
| -rw-r--r-- | build.gradle.kts | 25 | ||||
| -rw-r--r-- | src/Lib.hs | 2 |
3 files changed, 21 insertions, 9 deletions
diff --git a/app/Main.hs b/app/Main.hs index de1c1ab..5273780 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -3,4 +3,5 @@ module Main where import Lib main :: IO () -main = someFunc +main = do putStrLn "we will call some func from Main now" + someFunc 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") + +} @@ -3,4 +3,4 @@ module Lib ) where someFunc :: IO () -someFunc = putStrLn "someFunc" +someFunc = putStrLn "someFunc was called and says Hello World!" |
