-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
111 lines (88 loc) · 2.66 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.netflix.nebula:gradle-ospackage-plugin:8.3.0'
classpath 'com.netflix.nebula:nebula-release-plugin:15.0.1'
}
}
plugins {
id 'java'
id 'war'
id 'application'
}
apply plugin: 'nebula.release'
apply plugin: 'java-library'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'
java {
targetCompatibility(JavaVersion.VERSION_11)
sourceCompatibility(JavaVersion.VERSION_11)
}
compileJava.options.encoding = 'UTF-8'
group 'io.bali.ponyhub'
repositories {
jcenter()
mavenCentral()
maven { name 'restlet-repo'; url 'https://maven.restlet.talend.com' }
}
def restlet_version = '2.4.3'
dependencies {
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.0"
compile "org.restlet.jee:org.restlet:$restlet_version"
compile "org.restlet.jee:org.restlet.ext.servlet:$restlet_version"
compile "org.restlet.jee:org.restlet.ext.jackson:$restlet_version"
testCompile group: 'junit', name: 'junit', version: '4.12'
}
apply plugin: 'application'
apply plugin: 'nebula.release'
apply plugin: 'nebula.deb'
apply plugin: 'nebula.ospackage'
apply plugin: 'nebula.ospackage-base'
apply plugin: 'nebula.ospackage-daemon'
apply plugin: 'nebula.ospackage-application'
if( tasks.findByName("distZip")){
rootProject.tasks.release.dependsOn tasks.distZip
}
tasks.release.dependsOn tasks.assemble
mainClassName = 'io.bali.ponyhub.Main'
ospackage_application {
prefix = '/usr/local/lib/'
}
ospackage {
user = "pony"
postInstall file('src/main/scripts/post-install.sh')
preUninstall file('src/main/scripts/pre-uninstall.sh')
into '/usr/local/lib/' + project.name
from('bin') {
fileType = CONFIG | NOREPLACE
into 'bin'
}
from('src/main/dist/resources') {
into '/usr/local/lib/' + project.name + "/resources"
}
from(jar.outputs.files) {
into '/usr/local/lib/' + project.name + '/lib'
}
from('src/main/conf') {
fileType = CONFIG | NOREPLACE
include "*/**"
exclude "*backup*"
into '/etc/' + project.name + '/'
}
from('src/main/webapp') {
fileType = CONFIG | NOREPLACE
// Too tired to figure out how to put it into a webapp, and since I will run on
// a dedicated host, it doesn't pay off to worry about it now.
into '/var/www/html/'
}
}
task packDeb(type: Deb) {
}
buildDeb {
requires("openjdk-11-jre-headless")
link('/etc/systemd/system/' + project.name + '.service', '/usr/local/lib/' + project.name + '/bin/' + project.name + '.service')
}
assemble.dependsOn buildDeb