-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
100 lines (87 loc) · 2.55 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
88
89
90
91
92
93
94
95
96
97
98
99
100
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'maven-publish'
description = pluginDescription
version = pluginVersion
group = pluginGroup
repositories {
mavenLocal()
mavenCentral()
}
task createClassPathManifest {
ext.outputDir = file("$projectDir/src-gen/test/resources")
inputs.files sourceSets.main.runtimeClasspath
outputs.dir outputDir
doLast {
outputDir.mkdirs()
file("$outputDir/plugin-classpath.txt").text = sourceSets.main.runtimeClasspath.join("\n")
}
}
clean {
delete createClassPathManifest.outputDir
}
sourceSets {
test {
resources.srcDir files(createClassPathManifest.outputs).singleFile
}
}
processTestResources.dependsOn createClassPathManifest
dependencies {
compile gradleApi()
compile localGroovy()
compile group: 'org.openclover', name: 'clover', version: cloverVersion
compile group: 'com.google.guava', name: 'guava', version: '19.0'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
testCompile gradleTestKit()
}
test {
testLogging {
exceptionFormat = "full"
}
if (System.getProperty("debug.gradle.runner") != null) {
// needed mostly for CI when GradleRunner will fail if not run in forked process
// GradleRunner.setDebug(true) doesn't spawn new process
jvmArgs(["-Ddebug.gradle.runner=${System.getProperty("debug.gradle.runner")}"])
}
jvmArgs(["-DGRADLE_USER_HOME=${gradle.gradleUserHomeDir}"])
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task docsJar(type: Jar) {
from groovydoc.outputs
classifier = 'javadoc'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact docsJar {
classifier "javadoc"
}
}
}
repositories {
maven {
// put target repository here
}
mavenLocal()
}
}
task install() {
description = 'Installs artifacts to local Maven, calls for publishToMavenLocal task'
dependsOn test, publishToMavenLocal
}
task publishSnapshot() {
description = "Publish snapshot artifacts to snapshot repository"
dependsOn test //, should depend on a publish snapshot task
}
task publishRelease() {
description = "Publish release artifacts to repository"
dependsOn test //, should deped on publish release task
}