summaryrefslogtreecommitdiff
path: root/build.gradle.kts
blob: 52f4f2549a5d77d3e6c5fd25f294c76385efecf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 // 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 taskStackInstall = tasks.create("stack-install") {

   	description = "download and un-tar haskell-stack"
	group= "Haskell"

	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")
	}

}

val taskStackVersion = tasks.create<Exec>("stack-version") {

    dependsOn(taskStackInstall)

    description = "show haskell-stack version"
    group = "Haskell"
	
    setCommandLine(stackBinary,"--version")

}