forked from mockito/mockito
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
116 lines (91 loc) · 2.4 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
version = '1.9.8' //TODO duplicated with file
group = 'org.mockito'
description = 'Core API and implementation.'
allprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
repositories {
mavenCentral()
}
}
sourceCompatibility = 1.5
configurations {
provided
testUtil //TODO move to separate project
}
sourceSets {
main {
java.srcDir 'src'
compileClasspath = compileClasspath + configurations.provided
}
test {
java.srcDir 'test'
compileClasspath = compileClasspath + configurations.provided
}
}
test.include "**/*Test.class"
tasks.withType(Compile) {
options.warnings = false
}
dependencies {
provided fileTree('lib/compile')
compile fileTree('lib/run') { exclude '*.txt' }, fileTree('lib/repackaged') { exclude '*.txt'}
testCompile fileTree("lib/test")
testRuntime fileTree("lib/compile")
testUtil sourceSets.test.output
}
// Configure VCS in generated IPR file
idea.project.ipr {
withXml { provider ->
provider.node.component.find { it.@name == 'VcsDirectoryMappings' }.mapping.@vcs = 'Git'
}
}
idea.module.scopes.PROVIDED.plus += configurations.provided
eclipse.classpath.plusConfigurations += configurations.provided
def commonJarContent = copySpec {
//source
from(sourceSets.main.allSource)
//mockito license
from(".") { include 'LICENSE', 'NOTICE' }
//repackaged license
from("lib/repackaged") { exclude '**/*.jar' }
//repackaged classes
from(zipTree("lib/repackaged/cglib-and-asm-1.0.jar")) {
exclude 'META-INF/MANIFEST.MF'
}
}
jar {
baseName = 'mockito-core'
with commonJarContent
}
task allJar(type: Jar) {
baseName = 'mockito-all'
with commonJarContent
//classes
from(sourceSets.main.output)
//3rd party library classes
from(zipTree("lib/run/com.springsource.org.objenesis-1.0.0.jar")) { exclude "META-INF/maven/**" }
from(zipTree("lib/run/com.springsource.org.hamcrest.core-1.1.0.jar")) { exclude "LICENSE.txt" }
//3rd party license files
from("lib/run") { exclude '**/*.jar' }
}
tasks.withType(Jar) { task ->
doLast {
project.exec {
commandLine 'ant', '-f', 'build-ant.xml', "osgify.$task.baseName"
}
}
}
artifacts {
archives allJar
}
/*
repositories {
mavenCentral()
}
apply plugin: 'pmd'
pmd {
ruleSetFiles = files('conf/pmd-rules.xml')
}
*/