forked from Heapy/awesome-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
86 lines (70 loc) · 2.61 KB
/
build.gradle.kts
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.Project
import org.gradle.api.plugins.ApplicationPluginConvention
import org.gradle.api.tasks.JavaExec
import org.gradle.api.tasks.wrapper.Wrapper
import org.gradle.script.lang.kotlin.compile
import org.gradle.script.lang.kotlin.configure
import org.gradle.script.lang.kotlin.dependencies
import org.gradle.script.lang.kotlin.repositories
import org.gradle.script.lang.kotlin.task
import org.gradle.script.lang.kotlin.testCompile
import org.jetbrains.kotlin.gradle.dsl.Coroutines
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
buildscript {
repositories {
jcenter()
maven {
setUrl("https://dl.bintray.com/kotlin/kotlin-eap-1.1/")
}
}
dependencies {
classpath("com.github.jengelman.gradle.plugins:shadow:1.2.4")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-eap-77")
}
}
apply {
plugin("kotlin")
plugin("application")
plugin("com.github.johnrengelman.shadow")
}
configure<ApplicationPluginConvention> {
mainClassName = "link.kotlin.scripts.Application"
}
configure<JavaExec>("run") {
args(System.getProperty("travis", "false"))
}
configure<ShadowJar>("shadowJar") {
mergeServiceFiles()
}
repositories {
jcenter()
maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap-1.1/") }
maven { setUrl("https://dl.bintray.com/heapy/heap") }
}
configure<KotlinProjectExtension> {
experimental.coroutines = Coroutines.ENABLE
}
dependencies {
compile("org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-eap-77")
compile("org.jetbrains.kotlin:kotlin-reflect:1.1.2-eap-77")
compile("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:0.14.1")
compile("com.fasterxml.jackson.module:jackson-module-kotlin:2.8.8")
compile("org.slf4j:slf4j-simple:1.7.25")
compile("com.rometools:rome:1.7.0")
compile("com.github.dfabulich:sitemapgen4j:1.0.6")
compile("org.jsoup:jsoup:1.10.2")
compile("by.heap.remark:remark-kotlin:1.2.0")
compile("org.jetbrains.kotlin:kotlin-script-util:1.1.2-eap-77")
compile("com.atlassian.commonmark:commonmark:0.9.0")
compile("com.atlassian.commonmark:commonmark-ext-gfm-tables:0.9.0")
compile("com.squareup.okhttp3:okhttp:3.5.0")
testCompile("junit:junit:4.12")
}
task(name = "wrapper", type = Wrapper::class) {
gradleVersion = "3.5"
distributionUrl = "http://services.gradle.org/distributions/gradle-$gradleVersion-bin.zip"
}
inline fun <reified C> Project.configure(name: String, configuration: C.() -> Unit) {
(this.tasks.getByName(name) as C).configuration()
}