-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
72 lines (58 loc) · 1.48 KB
/
build.gradle
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
apply plugin: 'java'
apply plugin: 'kotlin'
buildscript {
ext.kotlin_version = '1.1-M03'
repositories {
mavenCentral()
maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.1" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
sourceSets {
main {
kotlin {
srcDir 'src/main/kotlin'
}
resources {
srcDir 'src/main/resources'
}
}
}
jar {
manifest {
attributes 'Main-Class': 'wtf.log.xmas2016.MainKt'
}
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
}
def binaryFile = new File(buildDir, "libs/$name-binary.jar")
task binaryJar << {
def jarFile = jar.archivePath
binaryFile.getParentFile().mkdirs()
binaryFile << "#!/bin/sh\n\nexec java -jar \$0 \"\$@\"\n\n"
jarFile.withInputStream { binaryFile.append it }
binaryFile.setExecutable true, false
}
binaryJar.dependsOn(jar)
task copyBinary(type: Copy, dependsOn: 'binaryJar') {
from(binaryFile)
into buildDir
rename(".*", project.name)
}
tasks.getByName('assemble').dependsOn('copyBinary')
repositories {
mavenCentral()
jcenter()
maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.1" }
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'com.squareup.okio:okio:1.11.0'
compile "de.weltraumschaf.commons:jcommander:2.1.0"
compile 'io.reactivex:rxjava:1.2.3'
compile 'org.funktionale:funktionale:0.9.7'
compile 'com.google.guava:guava:20.0'
}