This repository was archived by the owner on May 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild-common.gradle
More file actions
95 lines (83 loc) · 1.94 KB
/
build-common.gradle
File metadata and controls
95 lines (83 loc) · 1.94 KB
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
/*
* Global build file used by all OpenSHA subprojects.
* Declares common fields and tasks.
*/
apply plugin: 'java'
sourceCompatibility = 1.8
sourceSets {
main {
java {
srcDirs = ['src']
exclude 'resources/'
}
resources {
srcDirs = ['src']
exclude '**/*.java'
exclude 'resources/data/ngaWest'
exclude 'resources/data/site/'
exclude 'resources/data/site/Wills2000'
exclude 'scratch/UCERF3/data/scratch'
exclude 'scratch/ned'
exclude 'org/opensha/sha/earthquake/rupForecastImpl/NSHMP_CEUS08'
}
}
test {
java {
srcDirs = ['test']
}
resources {
srcDirs = ['test']
exclude '**/*.java'
}
}
}
repositories {
jcenter()
}
configurations {
compileAndResource {
description 'will be compiled, and included in all built jars'
transitive = true
}
compile {
description 'compile classpath'
transitive = true
extendsFrom compileAndResource
}
}
task fatJar(type: Jar) {
baseName = project.name + '-all'
from { configurations.compileAndResource.collect {
it.isDirectory() ? it : zipTree(it).matching {
exclude { it.path.contains('META-INF') }
}
}}
duplicatesStrategy = 'exclude'
from sourceSets.main.allJava
with jar
}
test {
filter {
includeTestsMatching "*Suite*"
}
}
task testOperational (type: Test) {
filter {
includeTestsMatching "*Operational*"
}
}
ext.getDate = {
new Date().format('yyyy_MM_dd')
}
ext.getGitHash = { ->
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
} catch (Exception e) {
return ""
}
}