forked from CIRDLES/Squid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.gradle
93 lines (75 loc) · 2.3 KB
/
common.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
//
// This file is to be applied to every subproject.
//
apply plugin: 'java'
apply plugin: 'maven'
String mavenGroupId = 'org.cirdles'
String mavenVersion = '1.1.8'
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
repositories {
mavenCentral();
// You may define additional repositories, or even remove "mavenCentral()".
// Read more about repositories here:
// http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories
}
dependencies {
// Adding dependencies here will add the dependencies to each subproject.
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.0'
compile group: 'gov.nist.math', name: 'jama', version: '1.0.3'
testCompile "junit:junit:4.12"
testCompile "org.assertj:assertj-core:3.5.1"
}
String mavenArtifactId = name
group = mavenGroupId
version = mavenVersion
task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') {
classifier = 'sources'
from sourceSets.main.allSource
}
task packageJavadoc(type: Jar, dependsOn: 'javadoc') {
from javadoc.destinationDir
classifier = 'javadoc'
}
artifacts {
archives jar
archives sourcesJar
// Uncomment next line to produce javadocs
// archives packageJavadoc
}
configure(install.repositories.mavenInstaller) {
pom.project {
groupId = mavenGroupId
artifactId = mavenArtifactId
version = mavenVersion
}
}
task createFolders(description: 'Creates the source folders if they do not exist.') doLast {
sourceSets*.allSource*.srcDirs*.each { File srcDir ->
if (!srcDir.isDirectory()) {
println "Creating source folder: ${srcDir}"
srcDir.mkdirs()
}
}
}
tasks.withType(JavaCompile) {
configure(options) {
options.compilerArgs << '-Xlint:deprecation' << '-Xlint:unchecked'
}
println 'Compiler args: ' + options.compilerArgs
}
javadoc {
options.tags = [
'pre:a:Precondition:',
'post:a:Postcondition:',
'imports:a:Imports libraries:',
'author:a:Author:'
]
}
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}