summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-07-19 21:08:16 +0200
committerMiguel <m.i@gmx.at>2018-07-19 21:08:16 +0200
commit7447d4f9b2734dfb85c9e3da86723e94981a634f (patch)
tree4c6fa487017a581b609f5fe2e2427506c7b76a33
parent7c3669cd255e61c2f39307a6ed21b6195b1325c9 (diff)
basic stack-haskell mini setup
-rw-r--r--app/Main.hs6
-rw-r--r--build.gradle.kts45
-rw-r--r--package.yaml27
-rw-r--r--src/Lib.hs6
4 files changed, 67 insertions, 17 deletions
diff --git a/app/Main.hs b/app/Main.hs
new file mode 100644
index 0000000..de1c1ab
--- /dev/null
+++ b/app/Main.hs
@@ -0,0 +1,6 @@
+module Main where
+
+import Lib
+
+main :: IO ()
+main = someFunc
diff --git a/build.gradle.kts b/build.gradle.kts
index 8b97109..52f4f25 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,28 +1,39 @@
-/*
- * This file was generated by the Gradle 'init' task.
- *
- * This is a general purpose Gradle build.
- * Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/
- */
+ // Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/
-tasks.create<Exec>("hello") {
+val stackBinary="./stack-1.7.1-linux-x86_64/stack"
- description = "Say hello"
- group = "Custom"
+val taskStackInstall = tasks.create("stack-install") {
- setCommandLine("wget -qO- https://get.haskellstack.org/ | sh")
+ description = "download and un-tar haskell-stack"
+ group= "Haskell"
- doLast{
- System.out.println("hello sucker")
- }
+ doLast{
+
+ if( !File("linux-x86_64.tar.gz").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")
+ }
+
+ }
+ else println("This taks seems up to date")
+ }
}
-tasks.create<Exec>("stack-version") {
+val taskStackVersion = tasks.create<Exec>("stack-version") {
- description = "show stack version"
- group = "Haskell"
+ dependsOn(taskStackInstall)
- setCommandLine("stack --version")
+ description = "show haskell-stack version"
+ group = "Haskell"
+
+ setCommandLine(stackBinary,"--version")
}
diff --git a/package.yaml b/package.yaml
new file mode 100644
index 0000000..6ee5d74
--- /dev/null
+++ b/package.yaml
@@ -0,0 +1,27 @@
+name: gradle-jenkins-haskell
+version: 0.1.0.0
+license: BSD3
+author: "Miguel"
+maintainer: "m.i@gmx.at"
+copyright: "2018 Miguel"
+
+# Metadata used when publishing your package
+# synopsis: Short description of your package
+# category: simple-test
+
+dependencies:
+- base >= 4.7 && < 5
+
+library:
+ source-dirs: src
+
+executables:
+ gradle-jenkins-haskell-exe:
+ main: Main.hs
+ source-dirs: app
+ ghc-options:
+ - -threaded
+ - -rtsopts
+ - -with-rtsopts=-N
+ dependencies:
+ - gradle-jenkins-haskell
diff --git a/src/Lib.hs b/src/Lib.hs
new file mode 100644
index 0000000..d36ff27
--- /dev/null
+++ b/src/Lib.hs
@@ -0,0 +1,6 @@
+module Lib
+ ( someFunc
+ ) where
+
+someFunc :: IO ()
+someFunc = putStrLn "someFunc"