-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
88 lines (74 loc) · 3.02 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
buildscript {
ext {
springBootVersion = '2.0.5.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath "com.google.cloud.tools:appengine-gradle-plugin:1.3.5"
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'war'
// apply plugin: "com.google.cloud.tools.appengine"
// see https://github.com/GoogleCloudPlatform/app-gradle-plugin/issues/125
project.pluginManager.apply com.google.cloud.tools.gradle.appengine.standard.AppEngineStandardPlugin
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'sg.edu.nus.comp.viz'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
// remove spring-boot-starter-tomcat as we are using WAR
configurations {
compile.exclude module: 'spring-boot-starter-tomcat'
compile.exclude group: 'org.apache.tomcat'
}
dependencies {
// Spring specific dependencies
compile("org.springframework.boot:spring-boot-starter-web")
// JPA Data
compile("org.springframework.boot:spring-boot-starter-data-jpa")
// Google App Engine
compile("com.google.appengine:appengine-api-1.0-sdk:1.9.+")
providedCompile("javax.servlet:javax.servlet-api:3.1.0")
// Database Access
runtime("mysql:mysql-connector-java:8.0.12")
runtime("com.google.cloud.sql:mysql-socket-factory:1.0.9")
// test dependencies
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile("com.google.appengine:appengine-api-stubs:1.9.+")
testCompile("com.google.appengine:appengine-testing:1.9.+")
testRuntime('com.h2database:h2')
// This is only for sending through SMTP using local appengine
// Local appengine does not allow sending of SMTP by default.
// Note: This can be commented out when in production as the appengine's JavaMail will be used.
compile("com.sun.mail:javax.mail")
}
appengine {
run {
port = 8080
jvmFlags = ["-Xss2m", "-Dfile.encoding=UTF-8"]
}
deploy {
String travisDeployVersion = System.getenv("TRAVIS_DEPLOY_VERSION")
String currentBranch = System.getenv("TRAVIS_BRANCH")
String appengineWebXmlPath = "${projectDir}/src/main/webapp/WEB-INF/appengine-web.xml"
Node appengineWebXml = new File(appengineWebXmlPath).exists() ? new XmlParser().parse(appengineWebXmlPath) : null
project = appengineWebXml == null ? null : appengineWebXml.application.text()
version = travisDeployVersion != null ? travisDeployVersion : (appengineWebXml == null ? null : appengineWebXml.version.text())
stopPreviousVersion = false
promote = currentBranch != null ? currentBranch == "master" : false
}
}
task appengineDeployAll {
description "Deploy an App Engine application and all its extended configurations"
group "App Engine Standard environment"
dependsOn appengineDeploy, appengineDeployCron, appengineDeployQueue
}