-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.gradle
More file actions
59 lines (54 loc) · 1.83 KB
/
build.gradle
File metadata and controls
59 lines (54 loc) · 1.83 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
project.version = '1.0.0'
addTimestampToVersion();
apply plugin: 'java'
def gradleProjects() {
return subprojects.findAll { new File(it.projectDir, 'build.gradle').exists() }
}
configure(gradleProjects()) {
project.version = rootProject.version
apply plugin: 'application'
repositories {
mavenCentral()
maven {
url 'http://repo.incapturesolutions.com/public/repository'
}
}
dependencies {
compile "com.rapture:RaptureAPI:2.0.+"
}
startScripts {
// add etc folder to the classpath to pick up cfg files
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
classpath = project.files(['%APP_HOME%\\etc'])
} else {
classpath = project.files(['$APP_HOME/lib/*', '$APP_HOME/etc'])
}
doLast {
// gradle always puts extra classpaths relative to the lib folder, so we have to replace
windowsScript.text = windowsScript.text.replace('%APP_HOME%\\lib\\etc', '%APP_HOME%\\lib\\*;%APP_HOME%\\etc')
unixScript.text = unixScript.text.replace('$APP_HOME/lib/etc', '$APP_HOME/etc')
}
}
}
void addTimestampToVersion() {
File timestamp = new File('timestamp.txt');
if (timestamp.exists() && project.hasProperty('tag') && project.tag.equals('true')) {
project.ext.timestamp = timestamp.text.trim()
println "Using timestamp from file: [${project.ext.timestamp}]"
project.version += ".${project.ext.timestamp}"
}
else {
project.version += '.99999999999999'
}
}
task zipAll(type: Zip) {
dependsOn gradleProjects().installDist
from '.'
into 'RaptureTutorials'
baseName 'RaptureTutorials'
exclude '**/*.zip'
exclude '**/.gradle'
exclude '**/.classpath'
exclude '**/.project'
exclude '**/.settings'
}