-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
165 lines (125 loc) · 5.23 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
import com.github.davidmc24.gradle.plugin.avro.GenerateAvroJavaTask
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
plugins {
id 'java'
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version '1.6.10'
id "com.github.davidmc24.gradle.plugin.avro-base" version "1.0.0"
}
apply plugin: 'kotlin-kapt'
group 'com.fretron.vehicleManager'
version '1.0'
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext {
kotlin_version = "1.6.10"
jerseyVersion = "2.32"
daggerVersion = '2.40.5'
}
repositories {
mavenCentral()
}
dependencies {
// ######################### All Development Dependencies #########################
// Kotlin stdlib
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
// Jersey
implementation group: 'org.glassfish', name: 'javax.json', version: '1.1.4'
implementation group: 'org.glassfish.jersey.core', name: 'jersey-server', version: jerseyVersion
// Jersey Grizzly Server
implementation group: 'org.glassfish.jersey.containers', name: 'jersey-container-grizzly2-http', version: jerseyVersion
// https://mvnrepository.com/artifact/org.glassfish.jersey.inject/jersey-hk2
implementation group: 'org.glassfish.jersey.inject', name: 'jersey-hk2', version: jerseyVersion
// Apache Avro
implementation group: 'org.apache.avro', name: 'avro', version: '1.10.0'
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
implementation group: 'com.sun.jersey', name: 'jersey-json', version: '1.19.4'
// https://mvnrepository.com/artifact/org.json/json
implementation group: 'org.json', name: 'json', version: '20190722'
implementation 'com.google.code.gson:gson:2.9.0'
// https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple
implementation group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
// https://mvnrepository.com/artifact/org.glassfish.jersey.media/jersey-media-json-jackson
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-avro:2.13.1'
// https://mvnrepository.com/artifact/com.google.dagger/dagger
implementation group: 'com.google.dagger', name: 'dagger', version: daggerVersion
implementation 'com.google.dagger:dagger-compiler:2.40.5'
// https://mvnrepository.com/artifact/org.mongodb/mongodb-driver
implementation group: 'org.mongodb', name: 'mongodb-driver', version: '3.12.7'
// kapt
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
// MongoDB
implementation group: 'org.mongodb', name: 'mongo-java-driver', version: '3.12.7'
// ######################### All Test Dependencies #########################
// Junit 4
implementation 'junit:junit:4.13.2'
// Mockito - Kotlin
testImplementation group: 'com.nhaarman', name: 'mockito-kotlin', version: '1.6.0'
testImplementation 'org.mockito:mockito-inline:4.3.1'
// Jersey Test
testImplementation group: 'org.glassfish.jersey.test-framework', name: 'jersey-test-framework-core', version: jerseyVersion
testImplementation group: 'org.glassfish.jersey.test-framework.providers', name: 'jersey-test-framework-provider-grizzly2', version: jerseyVersion
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.7.1'
// kapt Test
kaptTest "com.google.dagger:dagger-compiler:$daggerVersion"
// EmbeddedMongoDB
testImplementation group: "de.flapdoodle.embed", name: "de.flapdoodle.embed.mongo", version: "2.0.3"
// Logging
implementation 'org.slf4j:slf4j-simple:1.7.36'
implementation 'org.apache.logging.log4j:log4j-core:2.17.0'
implementation 'org.apache.logging.log4j:log4j-api:2.17.0'
implementation('com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.1')
implementation('com.fasterxml.jackson.core:jackson-databind:2.13.1')
}
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Common',
'Implementation-Version': archiveVersion,
'Main-Class': 'integrationTests.CommonRunner'
}
archivesBaseName = project.name + '-all'
from sourceSets.test.output
//collect all dependencies
from { configurations.testRuntime.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
exclude('META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA')
}
task renewAvro {
doLast {
delete "src/main/java/com.fretron.vehicleManager/model"
copy {
from "build/avro/com.fretron.vehicleManager/model"
into "src/main/java/com.fretron.vehicleManager/model"
}
}
}
task generateAvro(type: GenerateAvroJavaTask) {
source("src/main/avro")
include("**/**/*.avsc")
outputDir = file("src/main/java")
}
renewAvro.dependsOn generateAvro
build.dependsOn renewAvro
avro {
fieldVisibility = "PRIVATE"
}
kapt.includeCompileClasspath = false
test {
useJUnitPlatform()
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}