-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
111 lines (86 loc) · 2.41 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
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'idea'
apply plugin: 'com.google.protobuf'
apply plugin: 'org.akhikhl.gretty'
buildscript {
repositories {
//jcenter()
mavenCentral()
}
dependencies {
classpath 'org.akhikhl.gretty:gretty:2.0.0'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'
}
}
war {
from( "src/main/proto" ) {
into 'resources'
}
}
defaultTasks 'clean','build','appRunWar'
gretty {
httpPort = 8081
contextPath = 'spring-protobuf'
servletContainer = 'jetty9'
integrationTestTask = 'integrationTest'
}
// JDK 8
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
}
sourceSets {
integTest {
java.srcDir file('src/integrationTests/java')
resources.srcDir file('src/integrationTests/resources')
}
}
task integrationTest(type: Test) {
testClassesDir = sourceSets.integTest.output.classesDir
classpath = sourceSets.integTest.runtimeClasspath
}
build.dependsOn integrationTest
configurations.all {
exclude group: "commons-logging", module: "commons-logging"
}
dependencies {
compile (
'ch.qos.logback:logback-classic:1.1.3',
'org.springframework:spring-webmvc:4.3.11.RELEASE',
'org.slf4j:slf4j-api:1.7.24',
'org.slf4j:jcl-over-slf4j:1.7.24',
'com.fasterxml.jackson.core:jackson-databind:2.7.5',
'com.google.protobuf:protobuf-java:3.4.0',
'com.googlecode.protobuf-java-format:protobuf-java-format:1.4'
)
testCompile (
'junit:junit:4.11',
'com.google.code.gson:gson:2.8.1',
'org.apache.httpcomponents:httpclient:+',
'org.hamcrest:hamcrest-library',
// 'org.springframework:spring-test:4.3.11.RELEASE',
'com.jayway.jsonpath:json-path:2.3.0',
'com.jayway.jsonpath:json-path-assert:2.3.0'
)
providedCompile 'javax.servlet:javax.servlet-api:3.0.1'
integTestCompile (
sourceSets.main.output,
configurations.testCompile,
sourceSets.test.output
)
integTestRuntime configurations.testRuntime
}
protobuf {
protoc {
// Download from repository, or you can use locally available compuler if you wish so
artifact = 'com.google.protobuf:protoc:3.4.0'
}
}
idea {
module {
sourceDirs += file("${buildDir}/generated/source/proto/main/java");
}
}