forked from opensha/opensha-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
89 lines (80 loc) · 2.99 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
/*
* opensha-apps dependencies
*/
apply from: '../opensha-commons/build-common.gradle'
dependencies {
/* no remote repo */
compileAndResource files('lib/jpedal.jar')
compileOnly project(path: ':opensha-ucerf3', configuration: 'compileOnly')
compileAndResource project(path: ':opensha-ucerf3')
testCompile 'junit:junit:4.12'
}
task appHCJar(type: Jar) {
baseName = 'HazardCurveGUI-'+getDate()+'-'+getGitHash()
from { configurations.compileAndResource.collect {
it.isDirectory() ? it : zipTree(it).matching {
exclude { it.path.contains('META-INF') }
}
}}
from { configurations.compileOnly.collect {
it.isDirectory() ? it : zipTree(it).matching {
exclude { it.path.contains('META-INF') }
}
}}
from(project(':opensha-commons').projectDir) {
include 'build.version'
}
manifest {
attributes(
'Class-Path': configurations.compileAndResource.collect { it.getName() }.join(' '),
'Main-Class': 'org.opensha.sha.gui.HazardCurveApplication'
)
}
with jar
}
void createAppTask(String taskName, String prefix, String mainClass) {
task (taskName, type: Jar) {
baseName = prefix+'-'+getDate()+'-'+getGitHash()
from { configurations.compileAndResource.collect {
it.isDirectory() ? it : zipTree(it).matching {
exclude { it.path.contains('META-INF') }
}
}}
from { configurations.compileOnly.collect {
it.isDirectory() ? it : zipTree(it).matching {
exclude { it.path.contains('META-INF') }
}
}}
from(project(':opensha-commons').projectDir) {
include 'build.version'
}
manifest {
attributes(
'Class-Path': configurations.compileAndResource.collect { it.getName() }.join(' '),
'Main-Class': mainClass
)
}
with jar
}
}
createAppTask("appJarHC", "HazardCurveGUI", "org.opensha.sha.gui.HazardCurveApplication")
createAppTask("appJarHS", "HazardSpectrumGUI", "org.opensha.sha.gui.HazardSpectrumApplication")
createAppTask("appJarAR", "AttenuationRelationshipGUI", "org.opensha.sha.imr.attenRelImpl.gui.AttenuationRelationshipApplet")
createAppTask("appJarSM", "ShakeMapGUI", "org.opensha.sha.gui.ScenarioShakeMapApp")
createAppTask("appJarSD", "SiteDataGUI", "org.opensha.commons.data.siteData.gui.SiteDataCombinedApp")
createAppTask("appJarGMT", "GMTMapApp", "org.opensha.commons.mapping.gmt.gui.GMT_MapGeneratorApplet")
createAppTask("appJarIM", "IMEventSetAppV3", "org.opensha.sha.calc.IM_EventSet.v03.IM_EventSetCalc_v3_0_ASCII")
task appZipIM(type: Zip) {
dependsOn 'appJarIM'
from ('build/libs/') {
include 'IMEventSetAppV3-'+getDate()+'-'+getGitHash()+'.jar'
rename (('IMEventSetAppV3-'+getDate()+'-'+getGitHash()+'.jar'), 'IM_EventSetCalc_v3_0_ASCII.jar')
}
from ('src/org/opensha/sha/calc/IM_EventSet/v03/') {
include '*.txt'
}
archiveName 'IM_EventSetCalc_v3_0_ASCII.zip'
}
task appJars(type: GradleBuild) {
tasks = ['appJarHC', 'appJarHS', 'appJarAR', 'appJarSM', 'appJarSD', 'appJarGMT']
}