forked from geogebra/geogebra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
106 lines (87 loc) · 2.97 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
project.description = 'GeoGebra'
apply from: 'gradle-scripts/repositories.gradle'
apply from: 'gradle-scripts/versions.gradle'
subprojects {
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'idea'
eclipse.project {
natures 'org.springsource.ide.eclipse.gradle.core.nature'
}
// add auto formatter to every project
task eclipseJdtPrepare(type: Copy) {
description 'Copies Eclipse jdt.core preference file.'
from rootProject.file('eclipse/org.eclipse.jdt.core.prefs')
into project.file('.settings/')
outputs.upToDateWhen { false }
}
task eclipseJdtUi(type: Copy) {
description 'Copies Eclipse jdt.ui preference file.'
from rootProject.file('eclipse/org.eclipse.jdt.ui.prefs')
into project.file('.settings/')
outputs.upToDateWhen { false }
}
task cleanEclipseJdtUi(type: Delete) {
description 'Cleans Eclipse jdt.ui preference file.'
delete project.file('.settings/org.eclipse.jdt.ui.prefs')
}
tasks['eclipseJdt'].dependsOn(eclipseJdtPrepare)
tasks['cleanEclipse'].dependsOn(cleanEclipseJdtUi)
tasks['eclipse'].dependsOn(eclipseJdtPrepare, eclipseJdtUi, cleanEclipse)
afterEvaluate {
// forward command line properties to every test JVM
tasks.withType(Test.class).each { task ->
project.properties.each { prop, val ->
if (val instanceof String) {
task.systemProperty prop.trim(), val
}
}
}
}
}
wrapper {
gradleVersion = gradleVersionGGB
}
task checkPmd(dependsOn: [':common:pmdMain', ':common-jre:pmdMain', ':web:pmdMain',
':editor-base:pmdMain', ':editor-web:pmdMain',
':keyboard-web:pmdMain', ':keyboard-base:pmdMain']){
description "run PMD for all subprojects with pmd conf"
}
task checkAllStyles(dependsOn: [':common:checkstyleMain', ':common-jre:checkstyleMain', ':web:checkstyleMain',
':editor-base:checkstyleMain', ':editor-web:checkstyleMain',
':keyboard-web:checkstyleMain', ':keyboard-base:checkstyleMain', ':keyboard-scientific:checkstyleMain',
':desktop:checkstyleTest', ':common-jre:checkstyleTest']){
description "run checkstyle for all subprojects with checkstyle conf"
}
// eclipse related tasks
project(':editor-base') {
cleanEclipse.dependsOn('cleanJavacc')
eclipseClasspath.dependsOn('compileJavacc')
eclipse.project {
natures 'sf.eclipse.javacc.javaccnature'
}
}
project(':common') {
cleanEclipse.dependsOn('cleanJavacc')
eclipseClasspath.dependsOn('compileJavacc')
eclipse.project {
natures 'sf.eclipse.javacc.javaccnature'
}
}
project(':web') {
// exclude from the eclipse classpath the java files in the resources dir
eclipse.classpath.file {
whenMerged { classpath ->
classpath.entries.find { entry -> entry.kind == 'src' && entry.path == 'src/main/resources' }.excludes = ['**/*.java']
}
}
}
// https://gist.github.com/mashimom/891a55878eda510d316e
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('tag', 'example:X')
}
}
}