summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Main.hs3
-rw-r--r--build.gradle.kts25
-rw-r--r--src/Lib.hs2
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")
+
+}
diff --git a/src/Lib.hs b/src/Lib.hs
index d36ff27..0d887ac 100644
--- a/src/Lib.hs
+++ b/src/Lib.hs
@@ -3,4 +3,4 @@ module Lib
) where
someFunc :: IO ()
-someFunc = putStrLn "someFunc"
+someFunc = putStrLn "someFunc was called and says Hello World!"