-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
74 lines (63 loc) · 2.18 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
72
73
74
group 'org.gwleclerc'
version '1.0-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.1.1'
ext.jira_client_version = '4.0.0'
ext.javax_mail_version = '1.5.6'
ext.jsoup_version = '1.10.2'
ext.fugue_version = '1.1'
ext.fuel_version = '1.5.0'
ext.result_version = '1.0.5'
ext.klaxon_version = '0.27'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
repositories {
jcenter()
mavenCentral()
maven {
url "https://maven.atlassian.com/content/repositories/atlassian-public"
}
}
configurations {
ktlint
}
// Building a Jar with dependencies with Kotlin and Gradle: http://www.preslav.me/2016/06/13/kotlin-basics-create-an-executable-kotlin-jar-using-gradle/
jar {
manifest {
attributes 'Main-Class': 'org.gwleclerc.suemail.MainKt'
}
// This line of code recursively collects and copies all of a project's files
// and adds them to the JAR itself. One can extend this task, to skip certain
// files or particular types at will
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "com.atlassian.jira:jira-rest-java-client-core:$jira_client_version"
compile "com.sun.mail:javax.mail:$javax_mail_version"
compile "org.jsoup:jsoup:$jsoup_version"
compile "com.atlassian.fugue:fugue:$fugue_version"
compile "com.github.kittinunf.fuel:fuel:$fuel_version"
compile "com.github.kittinunf.fuel:fuel-android:$fuel_version"
compile "com.github.kittinunf.result:result:$result_version"
compile "com.beust:klaxon:$klaxon_version"
ktlint 'com.github.shyiko:ktlint:0.6.1'
}
// TODO Consider switching to https://github.com/JLLeitschuh/ktlint-gradle Gradle plugin instead
task ktlint(type: JavaExec) {
main = "com.github.shyiko.ktlint.Main"
classpath = configurations.ktlint
args "src/**/*.kt"
}
check.dependsOn ktlint
task ktlintFormat(type: JavaExec) {
main = "com.github.shyiko.ktlint.Main"
classpath = configurations.ktlint
args "-F", "src/**/*.kt"
}