-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
204 lines (171 loc) · 6.07 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
plugins {
id 'java'
id "io.freefair.lombok" version "8.4"
id 'com.diffplug.spotless' version '6.13.0'
id 'com.github.johnrengelman.shadow' version '7.1.0'
id 'org.sonarqube' version '4.0.0.2929'
id 'signing'
}
spotless {
java {
googleJavaFormat()
removeUnusedImports()
}
}
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.8.8" //jacoco version
}
tasks.register('jacocoMergedReport', JacocoReport) {
for (subproject in subprojects) {
dependsOn subproject.test
sourceSets subproject.sourceSets.test
if (subproject.sourceSets.test.allSource.files.isEmpty()) {
logger.info '{} has no tests', subproject.name
} else {
logger.info 'aggregating tests from {}', subproject.name
executionData subproject.test
}
}
reports {
xml.required = true
html.required = true
}
}
tasks.register('jacocoRootReport', JacocoReport) {
description = 'Generates an aggregate report from all subprojects'
dependsOn subprojects.test, jacocoMergedReport
additionalSourceDirs.from = files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.from = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.from = files(subprojects.sourceSets.main.output)
executionData.from = files(subprojects.jacocoTestReport.executionData)
reports {
html.required = true // human readable
xml.required = true // required by sonarqube
}
}
sonar {
properties {
property "sonar.gradle.skipCompile", true
property "sonar.projectKey", "onehouseinc_hudi-metadata-extractor"
property "sonar.organization", "onehouseinc"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.scm.provider", "git"
property "sonar.token", project.getProperty("sonar_token")
if (project.hasProperty("pullrequest_key")) {
property "sonar.pullrequest.key", project.getProperty("pullrequest_key")
property "sonar.pullrequest.branch", project.getProperty("pullrequest_branch")
property "sonar.pullrequest.base", project.getProperty("pullrequest_base")
property "sonar.pullrequest.github.repository", "https://github.com/onehouseinc/LakeView"
} else {
property "sonar.branch.name", project.getProperty("branch_name")
}
property "sonar.verbose", "true"
property 'sonar.coverage.exclusions', ['**/constants/**/*', '**/models/**/*']
}
}
tasks.sonar {
group = 'Sonarqube coverage reports'
description = 'Uploads the aggregated coverage report to sonarcloud'
onlyIf { System.env.'GITHUB_ACTIONS' }
}
tasks.getByPath('sonar').setDependsOn([])
tasks.getByPath('sonar').setMustRunAfter([])
group = 'ai.onehouse'
version = project.hasProperty('version') ? project.version : '1.0-SNAPSHOT'
ext {
versions = [
hudi: '0.15.0',
hive: '2.3.4',
okhttp: '4.11.0',
mockito: '3.11.2'
]
}
repositories {
mavenCentral()
}
dependencies {
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'io.freefair.lombok'
apply plugin: 'com.diffplug.spotless'
apply plugin: "maven-publish"
compileJava {
options.compilerArgs << '-Xlint:unchecked'
options.compilerArgs << '-Xlint:-deprecation'
}
java {
withJavadocJar()
withSourcesJar()
}
// other shadow jar config
tasks.register('sourceJar', Jar) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
artifacts {
archives sourceJar
}
build.dependsOn sourceJar
publishing {
repositories {
maven {
url = layout.buildDirectory.dir('staging-deploy')
}
}
publications {
mavenJava(MavenPublication) {
groupId 'ai.onehouse'
artifactId project.name
version = project.version
from components.java
pom {
name.set("LakeView")
description.set("LakeView is a free product provided by Onehouse for the Apache Hudi community. LakeView exposes an interactive interface with pre-built metrics, charts, and alerts to help you monitor, optimize, and debug your data lakehouse tables.")
url.set("https://www.onehouse.ai/product/lakeview")
licenses {
license {
name.set("Apache-2.0")
distribution.set("repo")
url.set("https://github.com/onehouseinc/LakeView/blob/main/LICENSE.txt")
}
}
scm {
connection.set("scm:git:ssh://github.com/onehouseinc/LakeView.git")
developerConnection.set("scm:git:ssh://github.com/onehouseinc/LakeView.git")
url.set("https://github.com/onehouseinc/LakeView")
}
developers {
developer {
id = 'pkgajulapalli'
name = 'Praveen Gajulapalli'
email = 'praveeng@onehouse.ai'
}
}
}
}
}
}
generateMetadataFileForMavenJavaPublication.dependsOn sourceJar
generateMetadataFileForMavenJavaPublication.dependsOn javadocJar
signing {
// Automatically sign all publications
useInMemoryPgpKeys(System.getenv("GPG_KEY_ID"), System.getenv("GPG_SECRET_KEY"), System.getenv("GPG_PASSPHRASE"))
sign publishing.publications.mavenJava
}
}
// Configure Shadow plugin
configure([project(':lakeview'), project(':lakeview-glue'), project(':lakeview-sync-tool')]) {
apply plugin: 'com.github.johnrengelman.shadow'
shadowJar {
setProperty("zip64", true)
}
}