forked from osmlab/atlas-checks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
169 lines (150 loc) · 4.32 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer
plugins {
id 'java'
id 'maven'
id 'maven-publish'
id 'idea'
id 'eclipse'
id 'signing'
id 'checkstyle'
id 'jacoco'
id "com.diffplug.gradle.spotless" version "3.27.0"
id 'org.sonarqube' version '2.8'
// id "io.codearte.nexus-staging" version "0.12.0"
id 'com.github.johnrengelman.shadow' version '5.0.0'
}
apply from: 'dependencies.gradle'
apply from: 'gradle/quality.gradle'
apply from: 'gradle/deployment.gradle'
apply from: 'gradle/execute.gradle'
description = "Atlas Checks"
sourceCompatibility = 11
targetCompatibility = 11
repositories
{
// For geotools
maven { url "http://repo.osgeo.org/repository/release/" }
mavenCentral()
// For Spark CDH
maven { url "https://repository.cloudera.com/content/repositories/releases/" }
// For jetty (through spark)
maven { url "http://repository.cloudera.com/cloudera/cloudera-repos/" }
// For staged repositories (before they get to maven central)
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
configurations
{
all {
resolutionStrategy {
// Force the version compatible with the latest version
// of Spark brought in by atlas generator
force 'com.fasterxml.jackson.core:jackson-core:2.10.0'
force 'com.fasterxml.jackson.core:jackson-databind:2.10.0'
}
}
compile
{
resolutionStrategy
{
force packages.atlas
force packages.atlas_generator
// Snappy 1.1.1.6 is the one that has the proper .so libs.
// https://github.com/xerial/snappy-java/issues/6
force 'org.xerial.snappy:snappy-java:1.1.1.6'
}
}
shaded
{
resolutionStrategy
{
force packages.atlas
force packages.atlas_generator
// Snappy 1.1.1.6 is the one that has the proper .so libs.
// https://github.com/xerial/snappy-java/issues/6
force 'org.xerial.snappy:snappy-java:1.1.1.6'
}
// Hadoop and Spark are way too fat.
exclude group: 'org.apache.hadoop'
exclude group: 'org.apache.spark'
exclude group: 'org.scala-lang'
exclude group: 'org.slf4j'
}
runtime
archives
}
dependencies
{
compile packages.commons
compile packages.atlas
compile packages.atlas_generator
compile packages.postgis
compile packages.postgres
compile packages.spring
compile packages.mockito
compile packages.log4j
compile packages.sqlite
checkstyle packages.checkstyle
checkstyle packages.atlas_checkstyle
shaded project.configurations.getByName('compile')
// Support Junit 5 tests
testImplementation packages.junit.api
testImplementation packages.junit.params
testRuntimeOnly packages.junit.engine
// Support JUnit 3/4 tests
testCompileOnly packages.junit.junit4
testRuntimeOnly packages.junit.vintage
}
/**
* Artifact related items
*/
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task shaded(type: Jar) {
baseName = project.name
classifier = 'shaded'
from {
configurations.shaded.collect {
it.isDirectory() ? it : zipTree(it).matching {
exclude {
it.path.contains('META-INF') && (it.path.endsWith('.SF') || it.path.endsWith('.DSA') || it.path.endsWith('.RSA'))
}
}
}
}
with jar
zip64 = true
}
shadowJar {
baseName = project.name
mergeServiceFiles()
transform(com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer) {
resource = 'reference.conf'
}
zip64 = true
}
artifacts
{
archives javadocJar
archives sourcesJar
archives shaded
}
/*
* This is to skip the tasks for which there is a skip<TaskName>=true
* environment variable
*/
def skippedTaskNames = System.getenv().findAll { key, value ->
key.startsWith("skip") && value.equalsIgnoreCase("true")
}.keySet().collect { it.substring(4) }
gradle.startParameter.excludedTaskNames += skippedTaskNames
idea {
project {
languageLevel = '11'
}
}