-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
105 lines (80 loc) · 2.94 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
/*
* opensha-oaf dependencies
*/
apply plugin: 'java-library'
ext {
parentProject = 'opensha'
}
apply from: '../opensha/build-common.gradle'
dependencies {
/* for OAF */
api 'org.mongodb:mongodb-driver-sync:4.11.0'
/* no remote repo */
implementation files('lib/ProductClient.jar')
api files('lib/wContour-1.6.1.jar')
implementation project(path: ':opensha')
testImplementation 'junit:junit:4.12'
}
// Create a task for an OAF application
void createOafAppTask(String taskName, String prefix, String mainClass) {
task (taskName, type: Jar, dependsOn: ':'+project.parentProject+':fatJar') {
archiveBaseName = prefix
from { configurations.apiResolvable.collect {
it.isDirectory() ? it : zipTree(it).matching {
exclude { it.path.contains('META-INF') }
}
}}
// include compiled source from this project
from sourceSets.main.allJava
// include upstream project fat jar
from zipTree(file('../'+project.parentProject+'/build/libs/'+project.parentProject+'-all.jar')).matching {
exclude { it.path.contains('META-INF') }
}
// include PDL jar
from zipTree(file('lib/ProductClient.jar')).matching {
exclude { it.path.contains('META-INF') }
}
// establish the startup class
manifest {
attributes(
'Main-Class': mainClass
)
}
duplicatesStrategy = 'exclude'
with jar
}
}
// make that method visible
ext {
createOafAppTask = this.&createOafAppTask
}
// Create a task for an OAF server
void createOafServerTask(String taskName, String prefix) {
task (taskName, type: Jar, dependsOn: ':'+project.parentProject+':fatJar') {
archiveBaseName = prefix
from { configurations.apiResolvable.collect {
it.isDirectory() ? it : zipTree(it).matching {
exclude { it.path.contains('META-INF') }
}
}}
// include compiled source from this project
from sourceSets.main.allJava
// include upstream project fat jar
from zipTree(file('../'+project.parentProject+'/build/libs/'+project.parentProject+'-all.jar')).matching {
exclude { it.path.contains('META-INF') }
exclude 'build.version'
}
with jar
}
}
// make that method visible
ext {
createOafServerTask = this.&createOafServerTask
}
// OAF application tasks
createOafAppTask("appOAFJar", "AftershockGUI-current", "org.opensha.oaf.rj.gui.RJGUITop")
createOafAppTask("appOAF_ETAS_Jar", 'AftershockGUI_ETAS-current-'+getDate(), "org.opensha.oaf.etas.AftershockStatsGUI_ETAS")
createOafAppTask("appETAS_GUIJar", "AftershockETAS_GUI", "org.opensha.oaf.oetas.gui.OEGUITop")
createOafAppTask("appETAS_TestJar", "AftershockETAS_Test", "org.opensha.oaf.oetas.env.OEtasTest")
// OAF server task
createOafServerTask("oafJar", project.name + '-oaf')