-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle
58 lines (46 loc) · 1.44 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
plugins {
id 'java'
id 'com.github.ben-manes.versions' version '0.52.0'
}
group 'ovh.akio'
version '1.5.0'
repositories {
mavenCentral()
}
jar {
manifest {
attributes "Main-Class": "ovh.akio.hmu.Application"
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
dependencies {
implementation group: 'info.picocli', name: 'picocli', version: '4.7.6'
implementation group: 'me.tongfei', name: 'progressbar', version: '0.10.1'
implementation group: 'net.sf.sevenzipjbinding', name: 'sevenzipjbinding', version: '16.02-2.01'
implementation group: 'net.sf.sevenzipjbinding', name: 'sevenzipjbinding-all-platforms', version: '16.02-2.01'
}
static def isNonStable(String version) {
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
dependencyUpdates {
rejectVersionIf {
isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)
}
}
tasks.register('bundle', Zip) {
group = 'build'
description = 'Deploy all files required to execute this program into a single archive'
dependsOn build
var name = project.name + '-' + version.toString()
archiveFileName = name + '.zip'
from('./build/libs/' + name + '.jar') {
into ''
}
from('wrappers') {
into 'wrappers'
}
}