-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
97 lines (73 loc) · 2.41 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
def distribution = 'distribution'
def currentVersion = '0.1.5-SNAPSHOT'
apply plugin: 'java'
subprojects {
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'java'
version = currentVersion
group = 'gex.marathon'
sourceCompatibility = '1.8'
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.9'
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
}
def deploymentRepo = version.endsWith("-SNAPSHOT") ? "http://nexus.plataforma.virginia.exp.mx/nexus/content/repositories/snapshots/" :
"http://nexus.plataforma.virginia.exp.mx/nexus/content/repositories/releases/"
def username
def password
if (project.hasProperty('nexusUsername') && project.hasProperty('nexusPassword')) {
username = project['nexusUsername']
password = project['nexusPassword']
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: deploymentRepo) {
authentication(userName: username, password: password)
}
pom.version = project.version
pom.artifactId = project.name
pom.groupId = project.group
}
}
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
name "expansion"
url "http://nexus.plataforma.virginia.exp.mx/nexus/content/repositories/releases/"
}
}
}
task prepareDist(dependsOn: [':cli:shadowJar']) {
// Creating file tree
def distributionDir = new File(buildDir, distribution)
def bin = new File(buildDir, "${distribution}/bin")
def libs = new File(buildDir, "${distribution}/libs")
distributionDir.mkdirs()
bin.mkdirs()
libs.mkdirs()
doLast {
// Copy fat jar to lib
def file = new File("${projectDir}", "cli/build/libs/cli-${currentVersion}-all.jar");
File dir = new File("${buildDir}/${distribution}/libs");
file.renameTo(new File(dir, file.getName()));
// Generates bash file from template
def marathonFile = new File("${projectDir}", 'marathon')
def x = marathonFile.text.replace('${version}', "${currentVersion}")
def marathon = new File("${buildDir}/${distribution}/bin/", "marathon")
marathon.withWriter { it << x }
marathon.setReadable(true);
marathon.setReadable(true);
marathon.setExecutable(true, false);
}
}
task buildZip(type: Zip, dependsOn: ['prepareDist']) {
from "${buildDir}/${distribution}"
archiveName "${buildDir}/marathon.zip"
}
uploadArchives.dependsOn ':core:uploadArchives'