forked from pinterest/ktlint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
70 lines (58 loc) · 1.6 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
plugins {
id 'org.jetbrains.kotlin.jvm'
id 'java-library'
id 'maven'
}
group = 'com.github.username'
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 project(':ktlint-core')
testImplementation project(':ktlint-core')
testImplementation project(':ktlint-test')
testImplementation deps.assertj
testImplementation('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'
}
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.1.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.0'
ktlint project(':ktlint')
}
test {
useJUnitPlatform()
}
task ktlint(type: JavaExec, dependsOn: classes) {
main = 'com.pinterest.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'
}
}
}
}
}