-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
executable file
·130 lines (98 loc) · 4.45 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
apply plugin: 'java'
apply plugin: 'jsonschema2pojo'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.jsonschema2pojo:jsonschema2pojo-gradle-plugin:0.4.30'
}
}
version = '0.1'
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
if (!hasProperty('mainClass')) {
ext.mainClass = ''
}
repositories {
mavenCentral()
}
ext {
jacksonVersion = '2.9.4'
logbackVersion = '1.2.3'
}
dependencies {
compile (
// json processing
"com.fasterxml.jackson.core:jackson-core:$jacksonVersion",
"com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion",
"com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
// http transactions
'com.mashape.unirest:unirest-java:1.4.9',
// guava collections
'com.google.guava:guava:24.0-jre',
'org.apache.commons:commons-lang3:3.6',
// logging
'org.slf4j:slf4j-api:1.7.25',
"ch.qos.logback:logback-core:$logbackVersion",
"ch.qos.logback:logback-classic:$logbackVersion")
testCompile group: 'junit', name: 'junit', version: '4.10'
}
jsonSchema2Pojo {
// Location of the JSON Schema file(s). This may refer to a single file or a directory of files.
source = files("${sourceSets.main.output.resourcesDir}/WhdTicket.json")
// Target directory for generated Java source files. The plugin will add this directory to the
// java source set so the compiler will find and compile the newly generated source files.
targetDirectory = file("src/main/java")
// Package name used for generated Java classes (for types where a fully qualified name has not
// been supplied in the schema using the 'javaType' property).
targetPackage = 'com.whd.autogen.ticket'
// The style of annotations to use in the generated Java types. Supported values:
// - jackson (alias of jackson2)
// - jackson2 (apply annotations from the Jackson 2.x library)
// - jackson1 (apply annotations from the Jackson 1.x library)
// - gson (apply annotations from the Gson library)
// - moshi1 (apply annotations from the Moshi 1.x library)
// - none (apply no annotations at all)
annotationStyle = 'jackson2'
// The type of input documents that will be read. Supported values:
// - jsonschema (schema documents, containing formal rules that describe the structure of json data)
// - json (documents that represent an example of the kind of json data that the generated Java types
// will be mapped to)
sourceType = 'jsonschema'
// Whether to empty the target directory before generation occurs, to clear out all source files
// that have been generated previously. <strong>Be warned</strong>, when activated this option
// will cause jsonschema2pojo to <strong>indiscriminately delete the entire contents of the target
// directory (all files and folders)</strong> before it begins generating sources.
removeOldOutput = false
// The character encoding that should be used when writing the generated Java source files
outputEncoding = 'UTF-8'
// Whether to use {@link org.joda.time.DateTime} instead of {@link java.util.Date} when adding
// date type fields to generated Java types.
useJodaDates = false
// Whether to use commons-lang 3.x imports instead of commons-lang 2.x imports when adding equals,
// hashCode and toString methods.
useCommonsLang3 = true
// Whether to initialize Set and List fields as empty collections, or leave them as null.
initializeCollections = true
// Whether to generate constructors or not.
includeConstructors = true
// **EXPERIMENTAL** Whether to make the generated types Parcelable for Android
parcelable = false
// Whether to make the generated types Serializable
serializable = true
// Whether to include getters/setters or to omit these accessor methods and create public fields instead.
includeAccessors = true
// Whether to include dynamic getters, setters, and builders or to omit these methods.
includeDynamicAccessors = false
}
tasks.withType(Test) {
scanForTestClasses = false
include "**/*Test.class" // whatever Ant pattern matches your test class files
}
// extra config just to see that the tests run in the right tasks
tasks.withType(Test) {
testLogging {
events 'started', 'passed'
}
}