forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
163 lines (132 loc) · 4.48 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
plugins {
id 'base'
id 'java'
id 'pmd'
id 'com.diffplug.spotless' version '5.3.0'
// id 'de.aaschmid.cpd' version '3.1'
}
repositories {
mavenCentral()
}
Properties env = new Properties()
rootProject.file('.env').withInputStream { env.load(it) }
if (!env.containsKey('VERSION')) {
throw new Exception('Version not specified in .env file...')
}
allprojects {
group = "io.airbyte.${rootProject.name}"
version = env.VERSION
}
def createLicenseWith = { licence ->
def tmp = File.createTempFile('tmp', '.tmp')
tmp.withWriter {
def w = it
w.writeLine("/*")
licence.eachLine {
w << " * "
w.writeLine(it)
}
w.writeLine(" */")
w.writeLine("")
}
return tmp
}
spotless {
java {
target '**/*.java'
targetExclude "**/build/**/*"
importOrder()
eclipse('4.16.0').configFile(rootProject.file('tools/gradle/codestyle/java-google-style.xml'))
licenseHeaderFile createLicenseWith(rootProject.file('LICENSE'))
removeUnusedImports()
trimTrailingWhitespace()
}
groovyGradle {
target '**/*.gradle'
targetExclude "**/build/**/*"
}
sql {
target '**/*.sql'
targetExclude "**/build/**/*"
dbeaver().configFile(rootProject.file('tools/gradle/codestyle/sql-dbeaver.properties'))
}
format 'styling', {
target '**/*.json', '**/*.yaml'
targetExclude "**/build/**/*", "**/node_modules/**/*"
prettier()
}
}
check.dependsOn 'spotlessApply'
// Disabled because it generate an obnoxious warning
// TODO: https://github.com/airbytehq/airbyte/issues/225
//
// cpdCheck {
// ignoreFailures = true
// reports {
// text.enabled = true
// }
// }
allprojects {
apply plugin: 'base'
afterEvaluate { project ->
composeBuild.dependsOn(project.tasks.assemble)
}
}
// Java projects common configurations
subprojects {
if (project.name == 'airbyte-webapp') {
return
}
apply plugin: 'java'
repositories {
mavenCentral()
}
pmd {
consoleOutput = true
rulePriority = 5
ruleSets = []
ruleSetFiles = files(rootProject.file('tools/gradle/pmd/rules.xml'))
}
test {
useJUnitPlatform()
testLogging() {
events 'failed'
exceptionFormat 'full'
// showStandardStreams = true
}
}
dependencies {
if (project.name != 'airbyte-commons') {
implementation project(':airbyte-commons')
}
implementation(platform("com.fasterxml.jackson:jackson-bom:2.10.4"))
implementation(platform("org.glassfish.jersey:jersey-bom:2.31"))
// version is handled by "com.fasterxml.jackson:jackson-bom:2.10.4", so we do not explicitly set it here.
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'com.fasterxml.jackson.core:jackson-annotations'
implementation group: 'com.google.guava', name: 'guava', version: '29.0-jre'
implementation group: 'commons-io', name: 'commons-io', version: '2.7'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
// SLF4J as a facade over Log4j2 required dependencies
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.0'
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.11.0'
// Bridges from other logging implementations to SLF4J
implementation group: 'org.slf4j', name: 'jul-to-slf4j', version: '1.7.30' // JUL bridge
implementation group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.7.30' //JCL bridge
implementation group: 'org.slf4j', name: 'log4j-over-slf4j', version: '1.7.30' // log4j1.2 bridge
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.4.2'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.4.6'
}
}
task composeBuild {
doFirst {
exec {
workingDir rootDir
commandLine 'docker-compose', '-f', 'docker-compose.build.yaml', 'build', '--parallel', '--quiet'
}
}
}
build.dependsOn(composeBuild)