Skip to content

Commit d8b16d4

Browse files
committed
build: add sourcesJar and javadocJar tasks
These tasks were missing after the migration to the Grails Publish Gradle Plugin. They are usually added by the Grails Plugin Gradle Plugin, but it is not used in this project. Using `java.withSourcesJar()` and `java.withJavadocJar()` is not compatible with this build.
1 parent 1d325e3 commit d8b16d4

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

gradle/publish-config.gradle

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import org.grails.gradle.plugin.publishing.GrailsPublishExtension
22

33
apply plugin: 'org.grails.grails-publish'
44

5-
project.extensions.configure(GrailsPublishExtension) {
5+
extensions.configure(GrailsPublishExtension) {
6+
// Explicit `it` is required here
67
it.githubSlug = 'grails/grails-data-mapping'
78
it.license.name = 'Apache-2.0'
89
it.title = findProperty('pomTitle') ?: 'Grails GORM'
@@ -16,3 +17,18 @@ project.extensions.configure(GrailsPublishExtension) {
1617
'jamesfredley': 'James Fredley'
1718
]
1819
}
20+
21+
// Add sources and javadoc jar tasks
22+
// java.withSourcesJar() and java.withJavadocJar() is not compatible here with GrailsPublishPlugin
23+
if (!tasks.findByName('sourcesJar')) {
24+
tasks.register('sourcesJar', Jar) {
25+
archiveClassifier = 'sources'
26+
from sourceSets.main.allSource
27+
}
28+
}
29+
if (!tasks.findByName('javadocJar')) {
30+
tasks.register('javadocJar', Jar) {
31+
archiveClassifier = 'javadoc'
32+
from javadoc.destinationDir
33+
}
34+
}

0 commit comments

Comments
 (0)