-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
187 lines (165 loc) · 5.99 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'io.github.swagger2markup:swagger2markup-gradle-plugin:1.3.3'
}
}
plugins {
id "org.sonarqube" version "2.6"
id 'org.hidetake.swagger.generator' version '2.9.0'
id 'jacoco'
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'io.github.swagger2markup'
ext {
swagger_annotations_version = "1.5.13"
jackson_version = "2.7.5"
spring_version = "4.1.4.RELEASE"
springboot_version = "2.1.0.RELEASE"
junit_version = "4.12"
oltu_version = "1.0.1"
orika_version = "1.5.1"
querydsl_version = "4.2.1"
}
repositories {
mavenCentral()
}
dependencies {
swaggerCodegen 'io.swagger:swagger-codegen-cli:2.3.1'
}
// Task to generate sources in build output directory
convertSwagger2markup {
swaggerInput file("swagger_schemas/swagger/json/crestdb_full.json").getAbsolutePath()
outputDir file("build/asciidoc")
config = ['swagger2markup.markupLanguage' : 'MARKDOWN',
'swagger2markup.pathsGroupedBy' : 'TAGS',
'swagger2markup.interDocumentCrossReferencesEnabled' : true]
}
swaggerSources {
crestdb {
inputFile = file('swagger_schemas/swagger/json/crestdb_full.json')
code {
language = 'jaxrs'
templateDir = file('./templates/java/JavaJaxRs')
configFile = file('swagger_schemas/swagger/json/crestdb-config.json')
}
}
crestdb_client {
inputFile = file('swagger_schemas/swagger/json/crestdb.json')
code {
language = 'python'
//templateDir = file('./templates/2.3.0/python-client/model')
configFile = file('swagger_schemas/swagger/json/crestdb-pyclient-config.json')
}
}
}
configurations.compile.each {
println "compile: $it"
}
allprojects {
apply plugin: 'maven'
apply plugin: 'jacoco'
apply plugin: 'java'
group = 'hep.crest'
version = '2.0-SNAPSHOT'
repositories {
mavenCentral()
}
jacoco {
//toolVersion = '0.8.4'
reportsDir = file("$buildDir/reports/jacoco")
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.destination file("${buildDir}/jacocoHtml")
}
}
}
// An example for sonarqube configuration: to run the code on a local sonarqube instance you should
// use commands like : ./gradlew sonarqube -Dsonar.host.url=http://localhost:9000 -Dsonar.login=180fe2ea3c768359eb5fa680f7bbe6667ceeb238
sonarqube {
properties {
property "sonar.host.url", "http://localhost:9000"
property "sonar.login", "d7bef5b1a70c8f5812a14c196d9920c65ecbc28c"
property "sonar.projectKey", "crest"
property "sonar.projectName", "crest"
property "sonar.junit.reportPaths", "build/test-results/test"
property 'sonar.coverage.exclusions', "**/hep/crest/swagger/model/*"
property "sonar.exclusions", "**/hep/crest/swagger/model/*,**/hep/crest/server/swagger/api/*,**/hep/crest/data/dialect/*"
}
}
subprojects {
sourceCompatibility = 11
targetCompatibility = 11
ext {
swagger_annotations_version = "1.5.13"
jackson_version = "2.10.5"
springboot_version = "2.3.1.RELEASE"
junit_version = "4.12"
oltu_version = "1.0.1"
orika_version = "1.5.1"
jersey2_version = "2.22.2"
swagger_core_version = "1.5.13"
querydsl_version = "4.4.0"
server = "undertow"
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://repo.spring.io/milestone" }
maven { url "https://jcenter.bintray.com/" }
maven { url "https://hibernate-sqlite.googlecode.com/svn/trunk/mavenrepo" }
maven { url "https://repo.maven.apache.org/maven2" }
}
configurations {
compile.exclude module: "tomcat-jdbc"
}
dependencies {
// JAX-B dependencies for JDK 9+
implementation "jakarta.xml.bind:jakarta.xml.bind-api:2.3.2"
implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2"
// javassist for JDK 9+
implementation "org.javassist:javassist:3.23.1-GA"
// swagger
implementation "io.swagger:swagger-annotations:$swagger_annotations_version"
implementation "io.swagger:swagger-core:$swagger_core_version"
implementation "io.swagger:swagger-jersey2-jaxrs:$swagger_core_version"
implementation group: 'ma.glasnost.orika', name: 'orika-core', version: orika_version
implementation "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version"
// DATABASES
//implementation group: 'com.oracle', name: 'ojdbc7', version:'12.1.0.2'
implementation files("${project.rootDir}/jarlib/ojdbc8-12.2.0.1.jar")
// https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc
implementation group: 'org.xerial', name: 'sqlite-jdbc', version: '3.25.2'
implementation group: 'org.postgresql', name: 'postgresql', version: '42.2.8'
implementation group: 'mysql', name: 'mysql-connector-java', version: '5.1.13'
implementation("com.h2database:h2")
implementation("commons-io:commons-io:2.6")
implementation group: 'commons-codec', name: 'commons-codec', version: '1.11'
}
task wrapper(type: Wrapper) {
gradleVersion = '6.4' //version required
}
// Clean files and directories used for unit testing
task purgedb(type: Delete) {
delete fileTree('/tmp') {
include 'crest*.db'
include 'crest*sqlite*'
include 'tagtar*'
}
delete '/tmp/cdms'
}
test.dependsOn purgedb
}