-
Notifications
You must be signed in to change notification settings - Fork 43
/
build.gradle
134 lines (116 loc) · 4.3 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
/*
* Copyright 2014-2019 Netflix, 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.
*/
import org.gradle.util.GradleVersion
plugins {
id 'com.netflix.nebula.plugin-plugin' version '21.2.1'
id 'com.netflix.nebula.optional-base' version '9.0.0'
id "org.jetbrains.kotlin.jvm" version "2.1.0"
id 'java-gradle-plugin'
id "org.gradle.test-retry" version "1.5.0"
}
description 'Gradle plugin to allow locking of dynamic dependency versions'
group = 'com.netflix.nebula'
contacts {
moniker 'Nebula Plugins Maintainers'
github 'nebula-plugins'
}
}
dependencies {
implementation 'com.squareup.moshi:moshi:1.12.+'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'joda-time:joda-time:2.10'
implementation 'com.netflix.nebula:nebula-gradle-interop:latest.release'
implementation('com.netflix.nebula:nebula-dependencies-comparison:latest.release') {
exclude module: 'groovy-all'
}
implementation platform("com.fasterxml.jackson:jackson-bom:2.14.2")
testImplementation 'com.netflix.nebula:nebula-project-plugin:latest.release'
testImplementation 'com.netflix.nebula:nebula-test:latest.release'
testImplementation gradleTestKit()
testImplementation('org.ajoberstar.grgit:grgit-core:4.1.1') {
exclude group: 'org.codehaus.groovy', module: 'groovy'
}
testImplementation "com.github.tomakehurst:wiremock:2.17.0"
testImplementation 'com.github.stefanbirkner:system-rules:1.19.0'
testImplementation 'org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r'
}
configurations.all {
resolutionStrategy {
force 'org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r'
}
}
gradlePlugin {
plugins {
dependencyLock {
id = 'com.netflix.nebula.dependency-lock'
displayName = 'Nebula Dependency Lock plugin'
implementationClass = 'nebula.plugin.dependencylock.DependencyLockPlugin'
description = 'Plugin to lock dynamic dependencies'
tags.set(['nebula', 'dependencies', 'lock'])
}
}
}
tasks.named('compileGroovy') {
// Groovy only needs the declared dependencies
// and not the output of compileJava
classpath = sourceSets.main.compileClasspath
}
tasks.named('compileKotlin') {
// Kotlin also depends on the result of Groovy compilation
// which automatically makes it depend of compileGroovy
libraries.from(files(sourceSets.main.groovy.classesDirectory))
}
test.dependsOn jar
tasks.withType(Test).configureEach {
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
testLogging {
events "PASSED", "FAILED", "SKIPPED"
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
retry {
maxRetries = 3
maxFailures = 20
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
idea {
project {
jdkName = '1.8'
languageLevel = '1.8'
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = '1.8'
}
}
tasks.withType(GenerateModuleMetadata).configureEach {
suppressedValidationErrors.add('enforced-platform')
}
javaCrossCompile {
disableKotlinSupport = true
}