forked from airbytehq/airbyte-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
131 lines (117 loc) · 5.57 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
// The buildscript block defines dependencies in order for .gradle file evaluation.
// This is separate from application dependencies.
// See https://stackoverflow.com/questions/17773817/purpose-of-buildscript-block-in-gradle.
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
// classpath 'com.bmuschko:gradle-docker-plugin:8.0.0'
// // 6.x version of OpenApi generator is only compatible with jackson-core 2.13.x onwards.
// // This conflicts with the jackson depencneis the bmuschko plugin is pulling in.
// // Since api generation is only used in the airbyte-api module and the base gradle files
// // are loaded in first, Gradle is not able to intelligently resolve this before loading in
// // the bmuschko plugin and thus placing an older jackson version on the class path.
// // The alternative is to import the openapi plugin for all modules.
// // This might need to be updated when we change openapi plugin versions.
// classpath 'com.fasterxml.jackson.core:jackson-core:2.13.0'
//
classpath 'org.codehaus.groovy:groovy-yaml:3.0.3'
}
}
plugins {
id "base"
id "com.dorongold.task-tree" version "2.1.1"
id "io.airbyte.gradle.jvm" version "0.32.0" apply false
id "io.airbyte.gradle.jvm.app" version "0.32.0" apply false
id "io.airbyte.gradle.jvm.lib" version "0.32.0" apply false
id "io.airbyte.gradle.docker" version "0.32.0" apply false
id "io.airbyte.gradle.publish" version "0.32.0" apply false
// uncomment for testing plugin locally
// id "io.airbyte.gradle.jvm" version "local-test" apply false
// id "io.airbyte.gradle.jvm.app" version "local-test" apply false
// id "io.airbyte.gradle.jvm.lib" version "local-test" apply false
// id "io.airbyte.gradle.docker" version "local-test" apply false
// id "io.airbyte.gradle.publish" version "local-test" apply false
}
repositories {
mavenCentral()
maven {
url 'https://airbyte.mycloudrepo.io/public/repositories/airbyte-public-jars/'
}
maven {
name = 'cloudrepo'
url = 'https://airbyte.mycloudrepo.io/repositories/airbyte-public-jars'
credentials {
username System.getenv('CLOUDREPO_USER')
password System.getenv('CLOUDREPO_PASSWORD')
}
}
}
if (System.getProperty("ciMode", "false") == "true") {
gradle.startParameter.logLevel = LogLevel.QUIET
def logFile = new FileOutputStream('gradle.log', true)
gradle.services.get(LoggingManager).addStandardOutputListener(logFile)
gradle.services.get(LoggingManager).addStandardErrorListener(logFile)
allprojects {
tasks.withType(JavaCompile) {
options.deprecation = false
options.warnings = false
}
}
}
Properties env = new Properties()
rootProject.file('.env.dev').withInputStream { env.load(it) }
if (!env.containsKey('VERSION')) {
throw new Exception('Version not specified in .env file...')
}
// `version` is used as the application build version for artifacts like jars
// `image_tag` is used as the docker tag applied to built images.
// These values are the same for building an specific Airbyte release or branch via the 'VERSION' environment variable.
// For local development builds, the 'VERSION' environment variable is unset, and built images are tagged with 'dev'.
ext {
version = System.getenv("VERSION") ?: env.VERSION
image_tag = System.getenv("VERSION") ?: 'dev'
}
allprojects {
// by default gradle uses directory as the project name. That works very well in a single project environment but
// projects clobber each other in an environments with subprojects when projects are in directories named identically.
def sub = rootDir.relativePath(projectDir.parentFile).replace('/', '.')
group = "io.airbyte${sub.isEmpty() ? '' : ".$sub"}"
version = rootProject.ext.version
}
tasks.register('archiveReports', Tar) {
dependsOn subprojects.collect { it.getTasksByName('checkstyleMain', true) }
dependsOn subprojects.collect { it.getTasksByName('checkstyleTest', true) }
dependsOn subprojects.collect { it.getTasksByName('jacocoTestReport', true) }
dependsOn subprojects.collect { it.getTasksByName('pmdMain', true) }
dependsOn subprojects.collect { it.getTasksByName('pmdTest', true) }
dependsOn subprojects.collect { it.getTasksByName('spotbugsMain', true) }
dependsOn subprojects.collect { it.getTasksByName('spotbugsTest', true) }
dependsOn subprojects.collect { it.getTasksByName('test', true) }
dependsOn subprojects.collect { it.getTasksByName('checkstyleAcceptanceTests', true) }
dependsOn subprojects.collect { it.getTasksByName('pmdAcceptanceTests', true) }
dependsOn subprojects.collect { it.getTasksByName('spotbugsAcceptanceTests', true) }
archiveFileName = "${project.name}-reports.tar"
destinationDirectory = layout.buildDirectory.dir('dist')
// Collect reports from each subproject
subprojects.each { subproject ->
from("${subproject.buildDir}/reports") {
into("${subproject.name}/reports")
}
}
}
tasks.register('generate-docker') {
dependsOn(':airbyte-bootloader:assemble')
dependsOn(':airbyte-workers:assemble')
dependsOn(':airbyte-webapp:assemble')
dependsOn(':airbyte-server:assemble')
dependsOn(':airbyte-api-server:assemble')
dependsOn(':airbyte-db:db-lib:assemble')
dependsOn(':airbyte-config:init:assemble')
dependsOn(':airbyte-temporal:assemble')
dependsOn(':airbyte-keycloak:assemble')
dependsOn(':airbyte-keycloak-setup:assemble')
}