forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
63 lines (55 loc) · 1.7 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
import org.elasticsearch.gradle.VersionProperties
buildscript {
repositories {
maven {
url = 'https://snapshots.elastic.co/maven/'
}
mavenCentral()
}
dependencies {
classpath "org.elasticsearch.gradle:build-tools:${elasticsearchVersion}"
}
}
subprojects {
apply plugin: 'java'
java {
sourceCompatibility = 17
targetCompatibility = 17
}
repositories {
// Only necessary when building plugins against SNAPSHOT versions of Elasticsearch
maven {
url = 'https://snapshots.elastic.co/maven/'
mavenContent {
if (gradle.includedBuilds) {
// When building in a composite, restrict this to only resolve the Java REST client
includeModule 'co.elastic.clients', 'elasticsearch-java'
}
}
}
if (gradle.includedBuilds.isEmpty()) {
maven {
url = "https://artifacts-snapshot.elastic.co/elasticsearch/${elasticsearchVersion}/maven"
mavenContent {
includeModule 'org.elasticsearch', 'elasticsearch'
}
}
}
// Same for Lucene, add the snapshot repo based on the currently used Lucene version
def luceneVersion = VersionProperties.getLucene()
if (luceneVersion.contains('-snapshot')) {
def matcher = luceneVersion =~ /[0-9\.]+-snapshot-([a-z0-9]+)/
assert matcher.matches(): "Invalid Lucene snapshot version '${luceneVersion}'"
maven {
url = "https://s3.amazonaws.com/download.elasticsearch.org/lucenesnapshots/${matcher.group(1)}"
}
}
mavenCentral()
}
}
tasks.register('check') {
dependsOn subprojects.collect { it.tasks.named('check') }
}
tasks.register('precommit') {
dependsOn subprojects.collect { it.tasks.named('classes') }
}