This repository has been archived by the owner on Oct 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
107 lines (89 loc) · 2.75 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
// PColor build file
def packageVendor = 'Fraunhofer IGD'
def packageDescription = 'PColor is a library for perceptual color calculation.';
def packageVersion = '1.4.1';
def sourceEncoding = 'utf-8';
def javaSourceVersion = '1.8';
subprojects {
apply plugin: 'java'
repositories {
mavenCentral()
}
compileJava.options.encoding = sourceEncoding
javadoc.options.encoding = sourceEncoding
sourceCompatibility = javaSourceVersion
version = packageVersion
jar {
manifest {
// support the eclipse manifest-first style
from file('META-INF/MANIFEST.MF')
attributes['Bundle-Vendor'] = packageVendor
attributes['Bundle-Description'] = packageDescription
attributes['Bundle-Version'] = project.version
}
}
sourceSets {
main {
java {
srcDir 'src'
}
}
}
// single build dir - nice but perhaps dangerous.
// buildDir = project(':').file('build')
task diag << {
sourceSets.all {
println "classesDir of " + it.name
println it.output.classesDir
println "srcDirs: " + it.allSource.srcDirs
println "allJava: " + it.allJava*.toString()
}
}
}
project(':de.fhg.igd.pcolor') {
task packageJavadoc(type: Jar, dependsOn: 'javadoc') {
from javadoc.destinationDir
classifier = 'javadoc'
}
task packageSources(type: Jar, dependsOn: assemble) {
from sourceSets.main.allSource
classifier = 'sources'
manifest {
attributes['Bundle-Vendor'] = packageVendor
attributes['Bundle-Description'] = packageDescription
attributes['Eclipse-SourceBundle'] = project.name + ';version="' + project.version + '";roots:="."'
attributes['Bundle-SymbolicName'] = project.name + ".source"
attributes['Bundle-Version'] = project.version
}
}
// include doc and source in build
tasks.build.dependsOn += [packageSources, packageJavadoc]
}
project(':de.fhg.igd.pcolor.test') {
// quick fix for java 8
test.scanForTestClasses = false;
// this is cumulative, i.e. compiled twice but
// this way we don't need to adapt the test task.
sourceSets {
test {
//from sourceSets.main
java {
srcDir 'src'
}
}
}
dependencies {
compile project(':de.fhg.igd.pcolor')
compile 'junit:junit:4+'
}
}
project(':de.fhg.igd.pcolor.examples') {
dependencies {
compile project(':de.fhg.igd.pcolor')
}
}
// last build task (depending on all the subprojects' build tasks)
task build (dependsOn: subprojects*.build) << {
println "Build complete."
println "The dist files are now in " + project(':de.fhg.igd.pcolor').libsDir
}