forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle
200 lines (183 loc) · 7.26 KB
/
settings.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
188
189
190
191
192
193
194
195
196
197
198
199
200
import com.gradle.scan.plugin.PublishedBuildScan
pluginManagement {
repositories {
// # Gradle looks for dependency artifacts in repositories listed in 'repositories' blocks in descending order.
// ## Prefer repos controlled by Airbyte.
// TODO: add airbyte-controlled proxy repos here
// ## Look into other, public repos.
// Gradle plugin portal.
gradlePluginPortal()
// Maven Central has most of everything.
mavenCentral()
}
}
// Configure the gradle enterprise plugin to enable build scans. Enabling the plugin at the top of the settings file allows the build scan to record
// as much information as possible.
plugins {
id "com.gradle.enterprise" version "3.15.1"
id 'com.github.burrunan.s3-build-cache' version "1.8.1"
}
final boolean isCI = System.getenv().containsKey("CI") || System.getenv().containsKey("RUN_IN_AIRBYTE_CI")
dependencyResolutionManagement {
// Set FAIL_ON_PROJECT_REPOS to ensure there are no more `repositories { ... }` blocks than necessary.
repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
repositories {
// # Gradle looks for dependency artifacts in repositories listed in 'repositories' blocks in descending order.
// ## Prefer repos controlled by Airbyte.
maven {
// This repo hosts our public artifacts and can be referenced by anyone.
name 'airbyte-public-jars'
url 'https://airbyte.mycloudrepo.io/public/repositories/airbyte-public-jars/'
content {
// Whitelist artifacts served by this repo because it's slow.
includeGroup 'io.airbyte'
includeGroupByRegex 'io\\.airbyte\\..*'
includeGroup 'com.hadoop.gplcompression'
includeGroup 'com.therealvan'
}
}
// TODO: add airbyte-controlled proxy repos here
// ## Look into other, public repos.
// Maven Central has most of everything.
mavenCentral()
// Jitpack is used to pull dependencies directly from github.
maven {
name 'jitpack'
url 'https://jitpack.io'
content {
includeGroupByRegex 'com\\.github\\..*'
includeGroup 'net.jimblackler.jsonschemafriend'
}
}
// Elastic Search repo.
maven {
name 'elastic-search-snapshots'
url 'https://snapshots.elastic.co/maven/'
content {
includeGroup 'co.elastic.clients'
}
}
// Redshift repo.
maven {
name 'redshift'
url 'https://s3.amazonaws.com/redshift-maven-repository/release'
content {
includeGroup 'com.amazon.redshift'
}
}
// Rockset repo.
maven {
name 'rockset'
url 'https://mvnrepository.com/artifact/com.rockset/rockset-java'
content {
includeGroup 'com.rockset'
}
}
// Awaitility repo.
maven {
name 'awaitility'
url 'https://mvnrepository.com/artifact/org.awaitility/awaitility'
content {
includeGroup 'org.awaitility'
}
}
// Confluent repo.
maven {
name 'confluent'
url "https://packages.confluent.io/maven"
content {
includeGroup 'io.confluent'
includeGroup 'org.apache.kafka'
}
}
}
}
gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
uploadInBackground = !isCI // Disable in CI or scan URLs may not work.
buildScanPublished { PublishedBuildScan scan ->
file("scan-journal.log") << "${new Date()} - ${scan.buildScanId} - ${scan.buildScanUri}\n"
}
}
}
if (isCI) {
buildCache {
local {
// Local build cache is dangerous as it might produce inconsistent results
// in case developer modifies files while the build is running
enabled = true
push = true
}
remote(com.github.burrunan.s3cache.AwsS3BuildCache) {
enabled = !System.getenv().getOrDefault("S3_BUILD_CACHE_ACCESS_KEY_ID", "").isEmpty()
push = true
// The 'us-west-2' region was chosen because it was close to our v0.6 dagger runners
// we used to maintain in AWS, prior to migrating to v0.9 and to github runners.
// This may in fact no longer be the best choice, who knows? It's not terrible, at least.
region = 'us-west-2'
bucket = 'ab-ci-cache'
prefix = "${System.getProperty('s3BuildCachePrefix', 'connectors')}-ci-cache/"
}
}
}
rootProject.name = 'airbyte'
// Include all java CDK modules.
def cdkPath = rootDir.toPath().resolve('airbyte-cdk/java/airbyte-cdk')
if (cdkPath.toFile().exists()) {
cdkPath.eachDir { dir ->
def buildFiles = file(dir).list { file, name -> name.matches("build\\.gradle(?:\\.kts)?") }
if (buildFiles.length == 1) {
def path = ":airbyte-cdk:java:airbyte-cdk:${dir.getFileName()}"
include path
project(path).name = "airbyte-cdk-${dir.getFileName()}"
}
}
}
def bulkCdkCorePath = rootDir.toPath().resolve('airbyte-cdk/bulk/core')
if (bulkCdkCorePath.toFile().exists()) {
bulkCdkCorePath.eachDir { dir ->
def buildFiles = file(dir).list { file, name -> name.matches("build\\.gradle(?:\\.kts)?") }
if (buildFiles.length == 1) {
def path = ":airbyte-cdk:bulk:core:${dir.getFileName()}"
include path
project(path).name = "bulk-cdk-core-${dir.getFileName()}"
}
}
}
def bulkCdkToolkitPath = rootDir.toPath().resolve('airbyte-cdk/bulk/toolkits')
if (bulkCdkToolkitPath.toFile().exists()) {
bulkCdkToolkitPath.eachDir { dir ->
def buildFiles = file(dir).list { file, name -> name.matches("build\\.gradle(?:\\.kts)?") }
if (buildFiles.length == 1) {
def path = ":airbyte-cdk:bulk:toolkits:${dir.getFileName()}"
include path
project(path).name = "bulk-cdk-toolkit-${dir.getFileName()}"
}
}
}
// Include all java connector projects.
def integrationsPath = rootDir.toPath().resolve('airbyte-integrations/connectors')
integrationsPath.eachDir { dir ->
def buildFiles = file(dir).list { file, name -> name.matches("build\\.gradle(?:\\.kts)?") }
if (buildFiles.length != 1) {
// Ignore python and other non-gradle connectors.
return
}
File metadataFile = dir.resolve("metadata.yaml").toFile()
if (!metadataFile.exists()) {
// Don't support connectors without metadata.
return
}
String metadataYaml = metadataFile.getText("UTF-8")
if (metadataYaml =~ /(?m)^\s+supportLevel:\s*["']?archived["']?\s*$/) {
// Ignore archived connectors.
return
}
include ":airbyte-integrations:connectors:${dir.getFileName()}"
}
// Include miscellaneous modules.
include ':airbyte-integrations:connector-templates:generator'
include ':airbyte-integrations:connectors-performance:source-harness'
include ':airbyte-integrations:connectors-performance:destination-harness'