-
Notifications
You must be signed in to change notification settings - Fork 5
/
java.gradle
125 lines (105 loc) · 2.58 KB
/
java.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
apply plugin: 'java'
sourceCompatibility = '1.7'
apply plugin: 'eclipse'
eclipse {
classpath {
defaultOutputDir = file('classes')
}
}
apply plugin: 'jdepend'
apply plugin: 'codenarc'
codenarc {
toolVersion = codeNarcVersion
sourceSets = []
}
task codenarc(type: CodeNarc) {
mustRunAfter 'clean'
configFile = project.rootProject.file('java/conf/codenarc.groovy')
ignoreFailures = false
reports {
xml {
destination = project.file('build/results/codenarc.xml')
enabled = true
}
html {
destination = project.file('build/reports/codenarc.html')
enabled = true
}
}
source = project.fileTree(project.projectDir) {
include '**/*.gradle'
include '**/*.groovy'
}
}
check.dependsOn 'codenarc'
apply plugin: 'checkstyle'
checkstyle.toolVersion = '6.4'
checkstyle.sourceSets = subprojects.collectMany { it.sourceSets }
apply plugin: 'pmd'
pmd {
toolVersion = '5.1.1'
ignoreFailures = false
ruleSetFiles = project.rootProject.files('java/conf/pmd.xml')
}
task pmd(type: Pmd) {
mustRunAfter 'clean'
}
apply from: project.rootProject.file('jacoco.gradle')
jacoco {
toolVersion = jacocoVersion
}
apply plugin: 'maven'
def archiveBase = "radl-$project.name"
jar {
baseName archiveBase
}
if (!project.hasProperty('alternateDistribution')) {
task javadocJar(type: Jar) {
baseName archiveBase
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
baseName archiveBase
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
task createPom << {
pom {
project {
groupId 'radl'
artifactId archiveBase
version project.version
inceptionYear '2015'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
}
whenConfigured { pom ->
pom.dependencies.findAll { it.groupId == 'RADL.java' }.each { dep ->
dep.groupId = 'radl'
dep.artifactId = "radl-$dep.artifactId"
}
}
}.writeTo("$buildDir/libs/${archiveBase}-${project.version}.pom")
}
assemble.dependsOn createPom, javadocJar, sourcesJar
}
repositories {
jcenter {
url 'http://jcenter.bintray.com'
}
}
dependencies {
compile "com.google.guava:guava:$guavaVersion"
testCompile "org.powermock:powermock-api-mockito:$powermockVersion",
"org.powermock:powermock-module-junit4:$powermockVersion"
}
check.dependsOn 'assemble'