-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
238 lines (218 loc) · 8.14 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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
/*
Copyright 2019-present, Simon Data, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'
apply plugin: 'signing'
apply plugin: 'application'
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: "com.jfrog.artifactory"
apply plugin: "org.sonarqube"
apply plugin: "jacoco"
mainClassName = 'com.simondata.sqlextractor.ExtractorRunner'
sourceCompatibility = 1.8
targetCompatibility = 1.8
sonar {
properties {
property "sonar.projectKey", "Radico_sql-extractor_AYd25Xlaprd0TMWfsvuo"
property "sonar.host.url", "https://sonar.production.simondata.co"
property "sonar.token", System.getenv("SONAR_TOKEN")
property "sonar.java.jdkHome", "/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home"
property "sonar.coverage.jacoco.xmlReportPaths", "reports/jacoco"
}
}
jacoco {
toolVersion = "0.8.8"
reportsDirectory = layout.buildDirectory.dir('reports/jacoco')
}
jacocoTestReport {
reports {
xml.required = true
}
}
repositories {
maven {
name = "artifactory"
url "https://simondata.jfrog.io/artifactory/maven-local"
credentials {
username = System.getenv("ARTIFACTORY_USER")
password = System.getenv("ARTIFACTORY_PASSWORD")
}
metadataSources {
artifact()
}
}
mavenCentral()
maven {
url "https://s3.amazonaws.com/redshift-maven-repository/release"
}
maven {
name = 'ajoberstar-backup'
url = 'https://ajoberstar.org/bintray-backup/'
}
}
dependencies {
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.7'
implementation group: 'org.slf4j', name: 'slf4j-simple', version: '2.0.7'
implementation group: 'commons-cli', name: 'commons-cli', version: '1.5.0'
implementation group: 'commons-dbutils', name: 'commons-dbutils', version: '1.8.0'
implementation 'org.apache.commons:commons-text:1.10.0'
implementation group: 'org.apache.commons', name: 'commons-collections4', version: '4.4'
implementation 'com.google.code.gson:gson:2.10.1'
implementation group: 'com.ibm.informix', name: 'jdbc', version: '4.50.10'
implementation group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '12.6.3.jre8'
implementation group: 'com.amazon.redshift', name: 'redshift-jdbc42', version: '2.1.0.18'
implementation group: 'com.mysql', name: 'mysql-connector-j', version: '8.1.0'
implementation group: 'org.postgresql', name: 'postgresql', version: '42.6.0'
implementation group: 'net.snowflake', name: 'snowflake-jdbc', version: '3.14.0'
implementation group: 'com.syncron.amazonaws', name: 'AthenaJDBC42', version: '2.1.1.1001'
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
constraints {
implementation("org.apache.logging.log4j:log4j-core") {
version {
strictly("[2.18.0, 3[")
prefer("2.20.0")
}
because("CVE-2021-44228, CVE-2021-45046, CVE-2021-45105: Log4j vulnerable to remote code execution and other critical security vulnerabilities")
}
}
}
buildscript {
repositories {
gradlePluginPortal()
mavenCentral()
maven {
url 'https://simondata.jfrog.io/artifactory/gradle-virtual'
credentials {
username = System.getenv("ARTIFACTORY_USER")
password = System.getenv("ARTIFACTORY_PASSWORD")
}
}
}
dependencies {
classpath "gradle.plugin.com.github.johnrengelman:shadow:8.0.0"
classpath 'net.researchgate:gradle-release:2.6.0'
classpath 'org.ajoberstar:gradle-git-publish:3.0.0'
//Check for the latest version here: http://plugins.gradle.org/plugin/com.jfrog.artifactory
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4+"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.0.0.2929"
constraints {
classpath("org.apache.logging.log4j:log4j-core") {
version {
strictly("[2.18.0, 3[")
prefer("2.20.0")
}
because("CVE-2021-44228, CVE-2021-45046, CVE-2021-45105: Log4j vulnerable to remote code execution and other critical security vulnerabilities")
}
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile){
options.compilerArgs << "-Xlint:deprecation"
}
}
}
allprojects {
apply plugin: "com.jfrog.artifactory"
}
task sourceJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}
publishing {
publications {
shadow(MavenPublication) { publication ->
from project.shadow.component(publication)
artifactId = 'sql-extractor'
artifact sourceJar
artifact shadowJar
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'SQL Extractor'
description = 'A flexible SQL querying library'
url = 'http://www.github.com/simon-data/sql-extractor'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'chetmancini'
name = 'Chet Mancini'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/simon-data/sql-extractor.git'
developerConnection = 'scm:git:ssh://github.com/simon-data/sql-extractor.git'
url = 'http://github.com/simon-data/sql-extractor'
}
}
}
}
repositories {
maven {
// change URLs to point to your repos, e.g. http://my.org/repo
def releasesRepoUrl = "$buildDir/repos/releases"
def snapshotsRepoUrl = "$buildDir/repos/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
test {
finalizedBy jacocoTestReport // report is always generated after tests run
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
}
signing {
setRequired {
// signing is only required if the artifacts are to be published
gradle.taskGraph.allTasks.any { it.equals( PublishToMavenRepository) }
}
}
artifactory {
contextUrl = "${artifactory_contextUrl}" //The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
repoKey = 'gradle-int'
username = System.getenv("ARTIFACTORY_USER")
password = System.getenv("ARTIFACTORY_PASSWORD")
maven = true
}
defaults {
publications ('shadow')
//List of Gradle Configurations (names or objects) from which to collect the list of artifacts to be deployed to Artifactory.
publishBuildInfo = false
publishPom = false
publishIvy = false
}
}
resolve {
repository {
repoKey = 'gradle-virtual'
username = System.getenv("ARTIFACTORY_USER")
password = System.getenv("ARTIFACTORY_PASSWORD")
maven = true
}
}
}