@@ -42,20 +42,20 @@ apply from: file( 'gradle/module.gradle' )
42
42
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43
43
// Release Task
44
44
45
- task release {
45
+ tasks . register( ' release' ) {
46
46
description = " The task performed when we are performing a release build. Relies on " +
47
47
" the fact that subprojects will appropriately define a release task " +
48
48
" themselves if they have any release-related activities to perform"
49
49
50
50
doFirst {
51
51
def javaVersionsInUse = jdkVersions. allVersions
52
- if ( javaVersionsInUse != [JavaLanguageVersion . of( 11 )]. toSet() ) {
53
- throw new IllegalStateException ( " Please use JDK 11 to perform the release. Currently using: ${ javaVersionsInUse} " )
52
+ if (javaVersionsInUse != [JavaLanguageVersion . of(11 )]. toSet()) {
53
+ throw new IllegalStateException (" Please use JDK 11 to perform the release. Currently using: ${ javaVersionsInUse} " )
54
54
}
55
55
}
56
56
}
57
57
58
- task publish {
58
+ tasks . register( ' publish' ) {
59
59
description = " The task performed when we want to just publish maven artifacts. Relies on " +
60
60
" the fact that subprojects will appropriately define a release task " +
61
61
" themselves if they have any publish-related activities to perform"
@@ -71,48 +71,14 @@ ext {
71
71
72
72
nexusPublishing {
73
73
repositories {
74
- sonatype {
75
- username = project. hasProperty( ' hibernatePublishUsername' ) ? project. property( ' hibernatePublishUsername' ) : null
76
- password = project. hasProperty( ' hibernatePublishPassword' ) ? project. property( ' hibernatePublishPassword' ) : null
77
- }
74
+ sonatype
78
75
}
79
76
}
80
77
81
- gradle. taskGraph. addTaskExecutionGraphListener(
82
- new TaskExecutionGraphListener () {
83
- @Override
84
- void graphPopulated (TaskExecutionGraph graph ) {
85
- String [] tasksToLookFor = [
86
- ' publish' ,
87
- ' publishToSonatype' ,
88
- ' publishAllPublicationsToSonatype' ,
89
- ' publishPublishedArtifactsPublicationToSonatypeRepository' ,
90
- ' publishRelocationArtifactsPublicationToSonatypeRepository' ,
91
- ]
92
-
93
- for ( String taskToLookFor : tasksToLookFor ) {
94
- if ( graph. hasTask( taskToLookFor ) ) {
95
- // trying to publish - make sure the needed credentials are available
96
-
97
- if ( project. property( ' hibernatePublishUsername' ) == null ) {
98
- throw new RuntimeException ( " `-PhibernatePublishUsername=...` not found" )
99
- }
100
- if ( project. property( ' hibernatePublishPassword' ) == null ) {
101
- throw new RuntimeException ( " `-PhibernatePublishPassword=...` not found" )
102
- }
103
-
104
- break ;
105
- }
106
- }
107
- }
108
- }
109
- )
110
-
111
-
112
78
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113
79
// CI Build Task
114
80
115
- task ciBuild {
81
+ tasks . register( ' ciBuild' ) {
116
82
description = " The task performed when one of the 'main' jobs are triggered on the " +
117
83
" CI server. Just as above, relies on the fact that subprojects will " +
118
84
" appropriately define a release task themselves if they have any tasks " +
0 commit comments