forked from jeakfrw/jeak-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
distribution.gradle
88 lines (78 loc) · 2.83 KB
/
distribution.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
import org.apache.tools.ant.taskdefs.condition.Os
task zipDistribution(type: Zip) {
dependsOn 'jar'
from("${buildDir}/libs") {
include(jar.archiveFileName.get())
rename(jar.archiveFileName.get().toString(), "jeakbot.jar")
}
from 'src/deploy/scripts'
into('libraries') {
from configurations.runtime
exclude { dep -> !dep.file.name.endsWith('.jar') }
}
into('libraries/licenses') {
from 'src/deploy/licenses'
exclude { lic -> !lic.file.name.endsWith('.txt') }
}
into('utils') {
from 'src/deploy/utils'
fileMode = 0755
exclude { f -> f.file.name.endsWith('.jks') || f.file.name.endsWith('.pem') || f.file.name.endsWith('.der') }
}
into('plugins') {
from 'run/.gitkeep'
}
}
task tarDistribution(type: Tar) {
dependsOn 'jar'
from("${buildDir}/libs") {
include(jar.archiveFileName.get())
rename(jar.archiveFileName.get(), "jeakbot.jar")
}
from 'src/deploy/scripts'
into('libraries') {
from configurations.runtime
exclude { dep -> !dep.file.name.endsWith('.jar') }
}
into('libraries/licenses') {
from 'src/deploy/licenses'
exclude { lic -> !lic.file.name.endsWith('.txt') }
}
into('utils') {
from 'src/deploy/utils'
fileMode = 0755
exclude { f -> f.file.name.endsWith('.jks') || f.file.name.endsWith('.pem') || f.file.name.endsWith('.der') }
}
into('plugins') {
from 'run/.gitkeep'
}
extension 'tar.gz'
compression = Compression.GZIP
}
if (Os.isFamily(Os.FAMILY_MAC) || Os.isFamily(Os.FAMILY_UNIX)) {
def distributionRepo = "https://nexus.fearnixx.de/repository/jeakbot-dist"
task uploadZipDistribution(type: Exec) {
def file = zipDistribution.archivePath.getCanonicalPath()
def repoPath = "${distributionRepo}/${zipDistribution.archiveName}"
println "Distribution: ${file} => ${repoPath}"
commandLine 'sh', '-c', "./upload_archive.sh '${file}' '${repoPath}'"
environment = [
"DIST_NEXUS_USER": project.findProperty('fngNexusUser'),
"DIST_NEXUS_PASS": project.findProperty('fngNexusPass')
]
dependsOn zipDistribution
}
task uploadTarDistribution(type: Exec) {
def file = tarDistribution.archivePath.getCanonicalPath()
def repoPath = "${distributionRepo}/${tarDistribution.archiveName}"
println "Distribution: ${file} => ${repoPath}"
commandLine 'sh', '-c', "./upload_archive.sh '${file}' '${repoPath}'"
environment = [
"DIST_USER": project.findProperty('fngNexusUser'),
"DIST_PASS": project.findProperty('fngNexusPass')
]
dependsOn tarDistribution
}
} else {
println "Not registering upload tasks - not a UNIX environment."
}