-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle
71 lines (64 loc) · 1.8 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
// Requires the following properties to be declared in gradle.properties:
// applicationName: The name of the application, assuming directory structure of AppNameServer and AppNameClient
// applicationServerLibrariesPath: The path to the application server's .jar files required for compilation.
//
// WAR Plugin Configuration
//
apply plugin: 'war'
webAppDirName = '${applicationName}Server/src'
buildDir = 'GradleBuild'
compileJava {
targetCompatibility = 1.6
sourceCompatibility = 1.6
}
sourceSets {
main {
java {
srcDirs = [applicationName + 'Server/src']
}
resources {
srcDirs = [applicationName + 'Server/src']
}
}
}
repositories {
mavenCentral()
}
dependencies {
//providedCompile fileTree(dir: applicationServerLibrariesPath, include: '**/*.jar')
// https://mvnrepository.com/artifact/org.apache.openejb/apache-tomee
compile group: 'org.apache.openejb', name: 'apache-tomee', version: '1.7.4'
compile 'org.glassfish.jersey.media:jersey-media-json-jackson:2.7'
}
//
// Tasks
//
war {
from(applicationName + 'Server/WebContent/') {
include '**/*.*'
exclude 'WEB-INF'
exclude 'META-INF'
}
from(applicationName + 'Server/WebContent/WEB-INF') {
include '*.xml'
into 'WEB-INF'
}
}
task gruntProd(type:Exec) {
description 'Wrapper to call \'grunt prod\' on the client.'
workingDir applicationName + 'Client'
doFirst {
println '\nRunning task gruntProd...'
commandLine 'grunt', 'prod'
}
doLast {
println '\n...gruntProd finished.'
}
}
task prod(dependsOn: ['assemble', 'gruntProd']) {
description 'Builds a .WAR archive for production.'
assemble.mustRunAfter 'gruntProd'
doLast {
println '\n...buildProd finished.'
}
}