This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
/
build.gradle
105 lines (88 loc) · 3.22 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
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
buildscript {
apply from: 'build-tools/repositories.gradle'
ext {
es_version = '7.10.2'
kotlin_version = '1.3.72'
}
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
jcenter()
}
dependencies {
classpath "org.elasticsearch.gradle:build-tools:${es_version}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
}
}
plugins {
id 'nebula.ospackage' version "8.3.0" apply false
id "com.dorongold.task-tree" version "1.5"
}
apply plugin: 'base'
apply plugin: 'jacoco'
apply from: 'build-tools/merged-coverage.gradle'
ext {
opendistroVersion = "${version}"
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
}
allprojects {
group = "com.amazon.opendistroforelasticsearch"
// Increment the final digit when there's a new plugin versions for the same opendistro version
// Reset the final digit to 0 when upgrading to a new opendistro version
version = "${opendistroVersion}.0"
apply from: "$rootDir/build-tools/repositories.gradle"
plugins.withId('java') {
sourceCompatibility = targetCompatibility = "1.8"
}
plugins.withId('org.jetbrains.kotlin.jvm') {
compileKotlin.kotlinOptions.jvmTarget = compileTestKotlin.kotlinOptions.jvmTarget = "1.8"
}
// Force certain dependencies here so they reflect across all sub-projects
configurations.all {
if (it.state != Configuration.State.UNRESOLVED) return
resolutionStrategy {
force "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.11.4"
force "com.google.guava:guava:30.0-jre"
force "com.puppycrawl.tools:checkstyle:8.29"
force "commons-codec:commons-codec:1.13"
force "junit:junit:4.13.1"
force "org.apache.httpcomponents:httpclient:4.5.13"
force "org.codehaus.plexus:plexus-utils:3.0.24"
}
}
}
evaluationDependsOnChildren()
check.dependsOn subprojects*.check
configurations {
ktlint
}
dependencies {
ktlint "com.pinterest:ktlint:0.33.0"
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "alerting/**/*.kt", "elastic-api/**/*.kt", "core/**/*.kt"
}
task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "-F", "alerting/**/*.kt", "elastic-api/**/*.kt", "core/**/*.kt"
}
check.dependsOn ktlint