forked from hierynomus/scalariform-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
80 lines (67 loc) · 2.13 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
plugins {
id "groovy"
id "com.github.hierynomus.license" version "0.12.1"
id "org.ajoberstar.release-opinion" version "1.4.2"
id "com.gradle.plugin-publish" version "0.9.4"
}
defaultTasks 'build'
group = 'com.hierynomus.gradle.plugins'
repositories { jcenter() }
dependencies {
compile gradleApi()
compile localGroovy()
compile "org.scala-lang:scala-library:2.12.1"
compile "com.github.machaval:scalariform_2.12:0.2.0"
testCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
}
testCompile 'com.netflix.nebula:nebula-test:3.1.0'
}
release {
grgit = org.ajoberstar.grgit.Grgit.open(project.projectDir)
}
license {
header = project.file("HEADER")
mapping {
java = 'SLASHSTAR_STYLE'
groovy = 'SLASHSTAR_STYLE'
scala = 'SLASHSTAR_STYLE'
}
}
test {
afterSuite { descriptor, result ->
def indicator = "\u001B[32m✓\u001b[0m"
if (result.failedTestCount > 0) {
indicator = "\u001B[31m✘\u001b[0m"
}
logger.lifecycle("$indicator Test ${descriptor.name}; Executed: ${result.testCount}/\u001B[32m${result.successfulTestCount}\u001B[0m/\u001B[31m${result.failedTestCount}\u001B[0m")
}
}
// This disables the pedantic doclint feature of JDK8
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts { archives sourcesJar, javadocJar }
pluginBundle {
website = "https://github.com/hierynomus/scalariform-gradle-plugin"
vcsUrl = "https://github.com/hierynomus/scalariform-gradle-plugin.git"
description = "Reformats Scala source code according to your configured conventions"
plugins {
scalariformPlugin {
id = "com.github.hierynomus.scalariform"
displayName = "Scalariform plugin for Gradle"
tags = [ "gradle", "plugin", "scalariform", "scala", "formatting" ]
}
}
}
project.tasks.release.dependsOn project.tasks.publishPlugins