@@ -47,16 +47,16 @@ if (sharedConfiguration.hasCodeCoverage.get()) {
47
47
pluginManager. apply(JacocoPlugin )
48
48
}
49
49
50
- def groovyLibrary = project. extensions. create(" groovyLibrary" , GroovyLibraryExtension , sharedConfiguration, java)
50
+ def groovyLibrary = project. extensions. create(' groovyLibrary' , GroovyLibraryExtension , sharedConfiguration, java)
51
51
52
52
java {
53
53
withSourcesJar()
54
54
withJavadocJar()
55
55
}
56
56
57
- def generateReleaseInfo = tasks. register(" generateReleaseInfo" , ReleaseInfoGenerator )
57
+ def generateReleaseInfo = tasks. register(' generateReleaseInfo' , ReleaseInfoGenerator )
58
58
59
- def groovydocJar = tasks. register(" groovydocJar" , Jar ) {
59
+ def groovydocJar = tasks. register(' groovydocJar' , Jar ) {
60
60
from groovydoc
61
61
archiveClassifier = ' groovydoc'
62
62
group = ' build'
@@ -70,7 +70,7 @@ configurations {
70
70
attributes {
71
71
attribute(Category . CATEGORY_ATTRIBUTE , objects. named(Category , Category . DOCUMENTATION ))
72
72
attribute(Bundling . BUNDLING_ATTRIBUTE , objects. named(Bundling , Bundling . EXTERNAL ))
73
- attribute(DocsType . DOCS_TYPE_ATTRIBUTE , objects. named(DocsType , " groovydoc" ))
73
+ attribute(DocsType . DOCS_TYPE_ATTRIBUTE , objects. named(DocsType , ' groovydoc' ))
74
74
attribute(Usage . USAGE_ATTRIBUTE , objects. named(Usage , Usage . JAVA_RUNTIME ))
75
75
}
76
76
outgoing {
@@ -86,7 +86,7 @@ configurations {
86
86
attribute(Category . CATEGORY_ATTRIBUTE , objects. named(Category , Category . DOCUMENTATION ))
87
87
attribute(Bundling . BUNDLING_ATTRIBUTE , objects. named(Bundling , Bundling . EXTERNAL ))
88
88
attribute(DocsType . DOCS_TYPE_ATTRIBUTE , objects. named(DocsType , DocsType . SOURCES ))
89
- attribute(Usage . USAGE_ATTRIBUTE , objects. named(Usage , " aggregation" ))
89
+ attribute(Usage . USAGE_ATTRIBUTE , objects. named(Usage , ' aggregation' ))
90
90
}
91
91
outgoing {
92
92
sourceSets. main. java. srcDirs. each {
@@ -104,20 +104,20 @@ configurations {
104
104
attributes {
105
105
attribute(Category . CATEGORY_ATTRIBUTE , objects. named(Category , Category . LIBRARY ))
106
106
attribute(Bundling . BUNDLING_ATTRIBUTE , objects. named(Bundling , Bundling . EXTERNAL ))
107
- attribute(Usage . USAGE_ATTRIBUTE , objects. named(Usage , " javadocClasspath" ))
107
+ attribute(Usage . USAGE_ATTRIBUTE , objects. named(Usage , ' javadocClasspath' ))
108
108
}
109
109
outgoing {
110
110
artifact tasks. named(' jar' )
111
111
}
112
112
}
113
113
codenarc {
114
114
resolutionStrategy. dependencySubstitution {
115
- substitute module(" org.codehaus.groovy:groovy" ) using project(" : " )
116
- substitute module(" org.codehaus.groovy:groovy-ant" ) using project(" :groovy-ant" )
117
- substitute module(" org.codehaus.groovy:groovy-templates " ) using project(" :groovy-templates " )
118
- substitute module(" org.codehaus.groovy:groovy-xml " ) using project(" :groovy-xml " )
119
- substitute module(" org.codehaus.groovy:groovy-json " ) using project(" :groovy-json " )
120
- substitute module(" org.codehaus.groovy:groovy-groovydoc " ) using project(" :groovy-groovydoc " )
115
+ substitute module(' org.codehaus.groovy:groovy' ) using project(' : ' )
116
+ substitute module(' org.codehaus.groovy:groovy-ant' ) using project(' :groovy-ant' )
117
+ substitute module(' org.codehaus.groovy:groovy-xml ' ) using project(' :groovy-xml ' )
118
+ substitute module(' org.codehaus.groovy:groovy-json ' ) using project(' :groovy-json ' )
119
+ substitute module(' org.codehaus.groovy:groovy-groovydoc ' ) using project(' :groovy-groovydoc ' )
120
+ substitute module(' org.codehaus.groovy:groovy-templates ' ) using project(' :groovy-templates ' )
121
121
}
122
122
123
123
exclude module : ' groovy-all'
@@ -128,7 +128,7 @@ dependencies {
128
128
compileOnly providers. provider { " com.github.spotbugs:spotbugs-annotations:${ versions.spotbugs} " }
129
129
130
130
codenarc " org.codenarc:CodeNarc:${ versions.codenarc} "
131
- codenarc project(" :groovy-templates" )
131
+ codenarc project(' :groovy-templates' )
132
132
133
133
checkstyle " com.puppycrawl.tools:checkstyle:${ versions.checkstyle} "
134
134
spotbugs " com.github.spotbugs:spotbugs:${ versions.spotbugs} "
@@ -138,15 +138,16 @@ dependencies {
138
138
}
139
139
140
140
def excludedFromManifest = [
141
- ' Ant-Version' ,
142
- ' Originally-Created-By' ,
143
- ' Bnd-LastModified' ,
144
- ' Created-By'
141
+ ' Ant-Version' ,
142
+ ' Bnd-LastModified' ,
143
+ ' Created-By' ,
144
+ ' Originally-Created-By' ,
145
+ ' Tool'
145
146
]
146
147
147
148
tasks. named(' jar' ) {
148
149
archiveAppendix = ' raw'
149
- archiveClassifier. set(" raw" )
150
+ archiveClassifier. set(' raw' )
150
151
groovyLibrary. configureManifest(manifest, excludedFromManifest)
151
152
}
152
153
@@ -155,7 +156,7 @@ tasks.withType(AbstractArchiveTask).configureEach {
155
156
reproducibleFileOrder = true
156
157
}
157
158
158
- tasks. withType(Jar ). configureEach {jar ->
159
+ tasks. withType(Jar ). configureEach { jar ->
159
160
metaInf {
160
161
if (jar. name == ' sourcesJar' ) {
161
162
if (file(" ${ projectDir} /LICENSE" ). exists()) {
@@ -177,7 +178,7 @@ tasks.withType(Jar).configureEach {jar ->
177
178
}
178
179
}
179
180
180
- tasks. register(" jarjar" , JarJarTask ) {
181
+ tasks. register(' jarjar' , JarJarTask ) {
181
182
from = jar. archiveFile
182
183
repackagedLibraries. from configurations. runtimeClasspath. incoming. artifactView {
183
184
componentFilter { component ->
@@ -208,9 +209,9 @@ tasks.register("jarjar", JarJarTask) {
208
209
outputFile = tasks. named(' jar' ). flatMap { layout. buildDirectory. file(" libs/${ it.archiveBaseName.get()} -${ it.archiveVersion.get()}${ (it.archiveClassifier.get() && it.archiveClassifier.get() != 'raw') ? '-' + it.archiveClassifier.get() : ''} .jar" ) }
209
210
210
211
withManifest {
211
- def extras = project. name == ' groovy ' ? [ ' Main-Class ' : ' groovy.ui.GroovyMain ' ] : [:]
212
- def moduleName = " org.apache.${ project.name. replace('-', '.')} "
213
- attributes(' Automatic-Module-Name' : moduleName , ' Bundle-Name' : ' Groovy module: ' + project . name, *: extras )
212
+ String projectName = project. name
213
+ String autoModName = " org.apache.${ projectName. replace('-','.')} "
214
+ attributes(' Automatic-Module-Name' : autoModName , ' Bundle-Name' : " Groovy module: $p rojectName " )
214
215
groovyLibrary. configureManifest(it, excludedFromManifest)
215
216
classpath = configurations. runtimeClasspath
216
217
}
@@ -225,17 +226,17 @@ tasks.withType(Javadoc).configureEach {
225
226
options. source = sharedConfiguration. targetJavaVersion. get()
226
227
}
227
228
228
- tasks. named(" compileTestGroovy" ) {
229
- options. forkOptions. jvmArgs + = [" -Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true" ]
229
+ tasks. named(' compileTestGroovy' ) {
230
+ options. forkOptions. jvmArgs + = [' -Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true' ]
230
231
}
231
232
232
233
tasks. withType(CodeNarc ). configureEach {
233
234
ignoreFailures = true
234
- configFile = rootProject. file(" config/codenarc/codenarc.groovy" )
235
+ configFile = rootProject. file(' config/codenarc/codenarc.groovy' )
235
236
}
236
237
237
238
tasks. withType(SpotBugsTask ). configureEach {
238
- excludeFilter = rootProject. file(" config/spotbugs/exclude.xml" )
239
+ excludeFilter = rootProject. file(' config/spotbugs/exclude.xml' )
239
240
ignoreFailures = true
240
241
effort = Effort . valueOf(' MAX' )
241
242
maxHeapSize = ' 2g'
@@ -250,14 +251,14 @@ tasks.withType(SpotBugsTask).configureEach {
250
251
}
251
252
}
252
253
253
- tasks. register(" checkstyle" ) {
254
+ tasks. register(' checkstyle' ) {
254
255
dependsOn tasks. withType(Checkstyle )
255
256
}
256
257
257
258
tasks. withType(Checkstyle ). configureEach {chk ->
258
259
showViolations = false
259
260
ignoreFailures = true
260
- configFile = rootProject. file(" config/checkstyle/checkstyle.xml" )
261
+ configFile = rootProject. file(' config/checkstyle/checkstyle.xml' )
261
262
configProperties = [' rootProject.projectDir' : rootProject. projectDir]
262
263
def reportFile = layout. buildDirectory. file(" reports/checkstyle/${ name} .xml" )
263
264
reports {
@@ -271,7 +272,7 @@ tasks.withType(Checkstyle).configureEach {chk ->
271
272
tasks. register(" ${ name} Report" , CheckstyleHtmlReport ) {
272
273
dependsOn chk
273
274
source. from(chk. source)
274
- configFile = rootProject. file(" config/checkstyle/checkstyle-report.groovy" )
275
+ configFile = rootProject. file(' config/checkstyle/checkstyle-report.groovy' )
275
276
checkstyleReportFile = reportFile
276
277
outputFile = layout. buildDirectory. file(" reports/checkstyle/${ chk.name} .html" )
277
278
}
@@ -280,8 +281,8 @@ tasks.withType(Checkstyle).configureEach {chk ->
280
281
281
282
// remove below if checkstyle fix up their dependency metadata to no longer have conflicts
282
283
configurations. checkstyle {
283
- resolutionStrategy. capabilitiesResolution. withCapability(" com.google.collections:google-collections" ) {
284
- select(" com.google.guava:guava:0" )
284
+ resolutionStrategy. capabilitiesResolution. withCapability(' com.google.collections:google-collections' ) {
285
+ select(' com.google.guava:guava:0' )
285
286
}
286
287
}
287
288
@@ -317,8 +318,8 @@ def shadowRuntime = createConsumableConfiguration(objects, tasks, configurations
317
318
dependencies {
318
319
// All Groovy modules depend on the Groovy BOM which itself has constraints on all
319
320
// Groovy modules, which brings nice alignment features!
320
- groovyApiElements platform(project(" :groovy-bom" ))
321
- groovyRuntimeElements platform(project(" :groovy-bom" ))
321
+ groovyApiElements platform(project(' :groovy-bom' ))
322
+ groovyRuntimeElements platform(project(' :groovy-bom' ))
322
323
}
323
324
component. addVariantsFromConfiguration(shadowApi) {
324
325
0 commit comments