Skip to content

Commit cc60936

Browse files
committed
1 parent e006427 commit cc60936

File tree

27 files changed

+334
-301
lines changed

27 files changed

+334
-301
lines changed

documentation/documentation.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ configurations {
7575
}
7676

7777
javadocSources {
78-
description = 'Source files to be built by the javadoc tool'
78+
description = 'All Java sources for the aggregated Javadocs'
79+
canBeConsumed = false
80+
canBeResolved = true
81+
visible = false
7982
}
8083
}
8184

@@ -145,6 +148,7 @@ dependencies {
145148
testing project( ':hibernate-testing' )
146149

147150
spatial project( ':hibernate-spatial' )
151+
javadocSources project( path: ':hibernate-spatial', configuration: 'javadocSources' )
148152

149153
agroal project( ':hibernate-agroal' )
150154

gradle/group-relocation.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* SPDX-License-Identifier: LGPL-2.1-or-later
3+
* Copyright Red Hat Inc. and Hibernate Authors
4+
*/
5+
var publishingExtension = project.getExtensions().getByType(PublishingExtension) as PublishingExtension
6+
publishingExtension.publications.create("groupRelocation", MavenPublication) {
7+
pom {
8+
name = project.name + ' (relocated)'
9+
groupId = 'org.hibernate'
10+
11+
distributionManagement {
12+
relocation {
13+
groupId = project.group
14+
artifactId = project.name
15+
version = project.version
16+
}
17+
}
18+
}
19+
}

gradle/java-module.gradle

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ buildscript {
1818
}
1919
}
2020

21-
import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
21+
2222
import org.apache.tools.ant.filters.ReplaceTokens
2323

2424
apply plugin: 'java-library'
@@ -159,21 +159,6 @@ dependencies {
159159
}
160160
}
161161

162-
configurations {
163-
javadocSources {
164-
canBeConsumed = true
165-
canBeResolved = false
166-
visible = false
167-
description = 'Configuration for accessing the sources that should be included in the javadoc for the project'
168-
}
169-
}
170-
171-
artifacts {
172-
sourceSets.main.allJava.srcDirs.each { srcDir ->
173-
javadocSources srcDir
174-
}
175-
}
176-
177162
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
178163
// Compilation
179164

gradle/javadoc.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ tasks.named( "javadoc", Javadoc ) {
5858
}
5959
}
6060

61-
task javadocJar(type: Jar) {
61+
tasks.register("javadocJar", Jar) {
6262
from project.tasks.javadoc.outputs
6363
manifest {
6464
attributes(

gradle/published-java-module.gradle

Lines changed: 12 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@
55
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
66
*/
77

8-
apply from: rootProject.file( 'gradle/releasable.gradle' )
98
apply from: rootProject.file( 'gradle/java-module.gradle' )
10-
apply from: rootProject.file( 'gradle/publishing-pom.gradle' )
9+
apply from: rootProject.file( 'gradle/publishing.gradle' )
1110

12-
apply plugin: 'signing'
13-
14-
// Make sure that the publishReleaseArtifacts task of the release module runs the release task of this sub module
15-
tasks.getByPath( ':release:publishReleaseArtifacts' ).dependsOn tasks.release
11+
tasks.register("publishReleaseArtifacts") {
12+
// mirror for `:release:publishReleaseArtifacts`
13+
dependsOn tasks.release
14+
}
1615

1716
configurations {
1817
javadocSources {
19-
description 'Used to aggregate javadocs for the whole project'
18+
description = "All Java sources for the project's Javadoc"
19+
canBeConsumed = true
20+
canBeResolved = false
21+
visible = false
2022
}
2123
}
2224

@@ -36,66 +38,12 @@ java {
3638
// Publishing
3739

3840
var publishingExtension = project.getExtensions().getByType(PublishingExtension) as PublishingExtension
39-
publishingExtension.publications {
40-
// main publication
41-
publishedArtifacts {
42-
// Add the Java component to the main publication
43-
from components.java
44-
}
41+
publishingExtension.publications.named("publishedArtifacts", MavenPublication) {
42+
// Add the Java component to the main publication
43+
from components.java
4544
}
4645

4746

48-
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49-
// Signing
50-
51-
def signingKey = resolveSigningKey()
52-
def signingPassphrase = resolveSigningPassphrase()
53-
54-
var signingExtension = project.getExtensions().getByType(SigningExtension) as SigningExtension
55-
signingExtension.sign publishingExtension.publications.publishedArtifacts
56-
signingExtension.useInMemoryPgpKeys(signingKey, signingPassphrase)
57-
58-
gradle.taskGraph.whenReady { TaskExecutionGraph graph ->
59-
boolean wasPublishingRequested = false
60-
61-
graph.allTasks.each {task ->
62-
if ( task instanceof PublishToMavenRepository ) {
63-
wasPublishingRequested = true
64-
}
65-
}
66-
67-
if ( wasPublishingRequested ) {
68-
def ossrhUser = System.getenv().get( "ORG_GRADLE_PROJECT_sonatypeUsername" )
69-
def ossrhPass = System.getenv().get( "ORG_GRADLE_PROJECT_sonatypePassword" )
70-
if ( ossrhUser == null || ossrhPass == null ) {
71-
throw new RuntimeException( "Cannot perform publishing to OSSRH without credentials." )
72-
}
73-
logger.lifecycle "Publishing {} : {} : {}", project.group, project.name, project.version
74-
signingExtension.required = true
75-
}
76-
else if ( signingKey == null || signingPassphrase == null ) {
77-
tasks.withType( Sign ).each { t-> t.enabled = false }
78-
}
79-
}
80-
81-
static String resolveSigningKey() {
82-
var key = System.getenv().get( "SIGNING_GPG_PRIVATE_KEY" )
83-
if ( key != null ) {
84-
return key
85-
}
86-
87-
var keyFile = System.getenv().get( "SIGNING_GPG_PRIVATE_KEY_PATH" )
88-
if ( keyFile != null ) {
89-
return new File( keyFile ).text
90-
}
91-
92-
return null
93-
}
94-
95-
static String resolveSigningPassphrase() {
96-
return System.getenv().get( "SIGNING_GPG_PASSPHRASE" )
97-
}
98-
9947

10048
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10149
// Release / publishing tasks
@@ -112,17 +60,3 @@ tasks.preVerifyRelease.dependsOn generatePomFileForPublishedArtifactsPublication
11260

11361
tasks.publishToSonatype.mustRunAfter test
11462

115-
116-
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117-
// Ancillary tasks
118-
119-
tasks.register('showPublications') {
120-
doFirst {
121-
project.publishing.publications.each { publication ->
122-
println "Publication (${publication.name}): ${publication.groupId}:${publication.artifactId}:${publication.version}"
123-
publication.artifacts.each { artifact ->
124-
println " > ${artifact}"
125-
}
126-
}
127-
}
128-
}

gradle/publishing-pom.gradle

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)