-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
176 lines (145 loc) · 4.25 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
plugins {
alias(deps.plugins.gradle.publish)
alias(deps.plugins.spotless)
id 'groovy'
id 'signing'
}
def humanName = 'dependencychecks-plugin'
project.group = 'com.carrotsearch.gradle.dependencychecks'
project.version = '0.0.10-SNAPSHOT'
project.description = 'Dependency checker and lock file aggregator'
repositories {
mavenCentral()
}
dependencies {
implementation deps.jackson
testImplementation deps.junit.jupiter
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation deps.assertj
testImplementation platform("org.spockframework:spock-bom:2.3-groovy-3.0")
testImplementation "org.spockframework:spock-core"
}
allprojects {
apply plugin: 'idea'
idea {
module {
outputDir file('build/idea/classes/main')
testOutputDir file('build/idea/classes/test')
downloadSources = true
}
}
}
gradlePlugin {
website = 'https://github.com/carrotsearch/gradle-dependencychecks-plugin'
vcsUrl = 'https://github.com/carrotsearch/gradle-dependencychecks-plugin.git'
plugins {
dependencychecks {
id = project.group
implementationClass = 'com.carrotsearch.gradle.dependencychecks.DependencyChecksPlugin'
displayName = humanName
description = project.description
tags = [
'utility'
]
}
}
}
java {
sourceCompatibility = 11
targetCompatibility = 11
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
options.encoding = "UTF-8"
}
tasks.named('test', Test) {
useJUnitPlatform()
}
publishing {
repositories {
maven {
name = 'staging'
url = project.layout.buildDirectory.dir("m2-local")
}
maven {
name = 'sonatype'
url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
if (project.hasProperty('nexusUsername')) {
username project.nexusUsername
}
if (project.hasProperty('nexusPassword')) {
password project.nexusPassword
}
}
}
}
publications {
withType(MavenPublication).configureEach {
pom {
inceptionYear = "2023"
name = humanName
description = project.description
url = gradlePlugin.website
licenses {
license {
name = 'Apache 2'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
organization {
name = "Carrot Search s.c."
url = "https://www.carrotsearch.com"
}
developers {
developer {
id = 'dawid.weiss'
name = 'Dawid Weiss'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:[email protected]:carrotsearch/gradle-dependencychecks-plugin.git'
developerConnection = gradlePlugin.vcsUrl
url = gradlePlugin.website
}
}
}
}
}
tasks.register("deploy", {
dependsOn "publishDependencychecksPluginMarkerMavenPublicationToSonatypeRepository",
"publishPluginMavenPublicationToSonatypeRepository",
publishPlugins
})
tasks.register("deployStaging", {
dependsOn "publishDependencychecksPluginMarkerMavenPublicationToStagingRepository",
"publishPluginMavenPublicationToStagingRepository"
})
spotless {
java {
lineEndings 'UNIX'
endWithNewline()
googleJavaFormat('1.20.0')
}
groovy {
indentWithSpaces(4)
importOrder()
excludeJava()
greclipse("4.26").configFile rootProject.files(
'gradle/spotless/spotless.eclipseformat.xml',
'gradle/spotless/spotless.groovyformat.prefs')
}
groovyGradle {
target '*.gradle', 'gradle/**/*.gradle'
greclipse("4.26").configFile rootProject.files(
'gradle/spotless/spotless.eclipseformat.xml',
'gradle/spotless/spotless.groovyformat.prefs')
}
}
task tidy() {
description "Applies formatters and cleanups to sources (if configured)."
group "verification"
dependsOn tasks.matching { task -> task.name == "spotlessApply" }
}
check.dependsOn tasks.matching { task -> task.name == "spotlessCheck" }