forked from pinterest/ktlint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
87 lines (72 loc) · 2.28 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
75
76
77
78
79
80
81
82
83
84
85
86
87
buildscript {
ext.kotlin_version = '1.2.41'
repositories {
mavenCentral()
maven { url 'http://repo.spring.io/plugins-release' }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0'
}
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'propdeps'
apply plugin: 'propdeps-maven'
apply plugin: 'kotlin'
apply plugin: 'org.junit.platform.gradle.plugin'
group = 'com.github.username'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
configurations {
ktlint
}
dependencies {
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
provided 'com.github.shyiko.ktlint:ktlint-core:0.23.1'
testCompile 'org.assertj:assertj-core:3.5.2'
testCompile 'com.github.shyiko.ktlint:ktlint-test:0.23.1'
testCompile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
testCompile('org.jetbrains.spek:spek-junit-platform-engine:1.1.5') {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib'
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-reflect'
}
ktlint 'com.github.shyiko:ktlint:0.23.1'
}
task ktlint(type: JavaExec, dependsOn: classes) {
main = 'com.github.shyiko.ktlint.Main'
// adding compiled classes to the classpath so that ktlint would validate project's sources
// using its own ruleset (in other words to dogfood)
classpath = configurations.ktlint + sourceSets.main.output
args '--debug', 'src/**/*.kt'
}
check.dependsOn ktlint
install {
repositories.mavenInstaller {
pom.project {
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
}
}
}