-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.gradle
107 lines (90 loc) · 2.86 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
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'nebula.ospackage-base'
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE"
classpath 'com.netflix.nebula:gradle-ospackage-plugin:3.1.0'
}
}
jar {
baseName = 'restapp'
version = '0.1.0'
}
springBoot {
// Allows us to run the jar directly from the command line, e.g. ./springboot-0.0.1.jar
executable = true
// Excludes the devtools package from production builds
excludeDevtools = true
// Set values for variable placeholders
// in the default launch script.
embeddedLaunchScriptProperties =
[useStartStopDaemon: 'false']
}
repositories {
mavenCentral()
jcenter()
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
dependencies {
compile("org.springframework.boot:spring-boot-starter-web"){
exclude module: "spring-boot-starter-tomcat"
}
compile 'org.apache.tomcat.embed:tomcat-embed-core:7.0.59'
compile 'org.apache.tomcat.embed:tomcat-embed-el:7.0.59'
compile 'org.apache.tomcat.embed:tomcat-embed-logging-juli:7.0.59'
compile 'org.apache.tomcat.embed:tomcat-embed-websocket:7.0.59'
compile("org.springframework.boot:spring-boot-starter-actuator")
compile 'com.google.api-client:google-api-client:1.22.0'
compile 'com.google.oauth-client:google-oauth-client:1.22.0'
compile 'com.google.http-client:google-http-client-jackson2:1.22.0'
compile 'com.google.oauth-client:google-oauth-client-jetty:1.22.0'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.google.apis:google-api-services-monitoring:v3-rev10-1.22.0'
compile 'com.google.apis:google-api-services-compute:v1-rev105-1.20.0'
compile 'joda-time:joda-time:2.9.4'
compile 'com.google.code.gson:gson:2.7'
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile('com.jayway.jsonpath:json-path')
}
task fatJar(type: Jar) {
manifest {
attributes(
'Main-Class': 'hello.Application'
)
}
baseName = 'restapp' + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}
task packDeb(type: Deb, dependsOn: fatJar) {
packageName = 'restapp'
version = 1.0
requires('openjdk-7-jre-headless')
from('build/libs/.') {
into "/opt/restapp"
}
preInstall = file('pkg_scripts/preInstall.sh')
postInstall = file('pkg_scripts/postInstall.sh')
postUninstall = file('pkg_scripts/postUninstall.sh')
from(jar.outputs.files) {
into 'lib'
}
from('build/scripts') {
into 'bin'
fileMode = 0550
}
from(configurations.runtime) {
into 'lib'
}
}