forked from kgyrtkirk/hive-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
121 lines (95 loc) · 3.63 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
plugins {
id 'com.palantir.git-version' version '0.12.2'
id 'nebula.ospackage-base' version '7.1.0'
id 'groovy'
id 'eclipse'
id 'application'
id "com.github.breadmoirai.github-release" version "2.2.9"
}
version = gitVersion()
mainClassName = 'hu.rxd.toolbox.Toolbox'
task createAllStartScripts() {
ext.outputDir=new File(project.buildDir, 'scripts')
}
def scripts = [
'applicator': 'hu.rxd.toolbox.Applicator',
'toolbox': 'hu.rxd.toolbox.Toolbox',
'sw2': 'hu.rxd.toolbox.HiveDevBoxSwitcher',
]
scripts.each() { scriptName, className ->
def t = tasks.create(name: scriptName+'StartScript', type: CreateStartScripts) {
mainClassName = className
applicationName = scriptName
outputDir = createAllStartScripts.outputDir
classpath = jar.outputs.files + project.configurations.runtime
}
applicationDistribution.into("bin") {
from(t)
fileMode = 0755
}
createAllStartScripts.dependsOn(t)
}
repositories { mavenCentral() }
dependencies{
compile 'org.codehaus.groovy:groovy-all:2.4.+'
// almost raw - old adjust_patch
compile('org.codehaus.groovy.modules.http-builder:http-builder:0.7')
compile('oauth.signpost:signpost-core:1.2.1.2')
compile('oauth.signpost:signpost-commonshttp4:1.2.1.2')
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.0'
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.0'
testCompile 'junit:junit:4.12'
compile 'com.google.guava:guava:23.0'
compile('net.rcarz:jira-client:0.5') {
exclude group: 'junit'
}
compile 'com.offbytwo.jenkins:jenkins-client:0.3.7'
// compile group: 'org.apache.commons', name: 'commons-vfs', version: '1.+'
// https://mvnrepository.com/artifact/org.apache.commons/commons-vfs2
compile group: 'org.apache.commons', name: 'commons-vfs2', version: '2.4.1'
compile group: 'org.apache.commons', name: 'commons-compress', version: '1.19'
compile group: 'commons-cli', name: 'commons-cli', version: '1.4'
compile group: 'commons-codec', name: 'commons-codec', version: '1.13'
compile group: 'commons-net', name: 'commons-net', version: '3.6'
compile 'com.jcraft:jsch:0.1.53'
compile 'de.schlichtherle.truezip:truezip-file:7.7.10'
compile 'de.schlichtherle.truezip:truezip-path:7.7.10'
compile 'de.schlichtherle.truezip:truezip-driver-tar:7.7.10'
compile 'de.schlichtherle.truezip:truezip-driver-http:7.7.10'
compile 'de.schlichtherle.truezip:truezip:7.7.10'
compile 'de.schlichtherle.truezip:truezip-kernel:7.7.10'
compile 'org.slf4j:slf4j-simple:1.7.25'
compile 'hu.rxd:lexirex:+'
// https://mvnrepository.com/artifact/org.eclipse.jgit/org.eclipse.jgit
compile group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '5.6.1.202002131546-r'
compile 'org.rauschig:jarchivelib:0.7.1'
// https://mvnrepository.com/artifact/org.codehaus.plexus/plexus-utils
compile group: 'org.codehaus.plexus', name: 'plexus-utils', version: '3.2.1'
}
task toolboxDeb(type: Deb) {
def targetDir='/usr/local/hive-toolbox/'
from(installDist.outputs) {
into targetDir
}
from('src/main/scripts') {
into "/usr/bin"
}
scripts.each { name,clazz ->
link("/bin/${name}","${targetDir}/bin/${name}")
}
}
if(System.getenv('GITHUB_REPO_TOKEN')==null) {
logger.warn('You dont have GITHUB_REPO_TOKEN set => release disabled')
}else{
githubRelease {
token System.getenv('GITHUB_REPO_TOKEN')
owner "kgyrtkirk"
tagName project.version
releaseAssets toolboxDeb.outputs
}
}
tasks.githubRelease.doFirst {
if(project.version.contains("dirty") || project.version.contains('-')) {
throw new RuntimeException("Please don't do dirty/intermediate releases " + project.version);
}
}