@@ -43,81 +43,36 @@ apply from: file( 'gradle/module.gradle' )
43
43
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44
44
// Release Task
45
45
46
- task release {
46
+ tasks . register( ' release' ) {
47
47
description = " The task performed when we are performing a release build. Relies on " +
48
48
" the fact that subprojects will appropriately define a release task " +
49
49
" themselves if they have any release-related activities to perform"
50
50
51
51
doFirst {
52
52
def javaVersionsInUse = jdkVersions. allVersions
53
- if ( javaVersionsInUse != [JavaLanguageVersion . of( 11 )]. toSet() ) {
54
- throw new IllegalStateException ( " Please use JDK 11 to perform the release. Currently using: ${ javaVersionsInUse} " )
53
+ if (javaVersionsInUse != [JavaLanguageVersion . of(11 )]. toSet()) {
54
+ throw new IllegalStateException (" Please use JDK 11 to perform the release. Currently using: ${ javaVersionsInUse} " )
55
55
}
56
56
}
57
57
}
58
58
59
- task publish {
59
+ tasks . register( ' publish' ) {
60
60
description = " The task performed when we want to just publish maven artifacts. Relies on " +
61
61
" the fact that subprojects will appropriately define a release task " +
62
62
" themselves if they have any publish-related activities to perform"
63
63
}
64
64
65
-
66
-
67
- def ossrhUsername = extractPropertyOrSetting( " OSSRH_USER" )
68
- def ossrhPassword = extractPropertyOrSetting( " OSSRH_PASSWORD" )
69
-
70
- String extractPropertyOrSetting (String name ) {
71
- if ( project. hasProperty( name) ) {
72
- return project. property( name )
73
- }
74
-
75
- def sysProp = System . getProperty( name )
76
- if ( sysProp != null ) {
77
- return sysProp
78
- }
79
-
80
- def envProp = System . getenv( name )
81
- if ( envProp != null ) {
82
- return envProp
83
- }
84
-
85
- return null
86
- }
87
-
88
65
nexusPublishing {
89
66
repositories {
90
- sonatype {
91
- username = ossrhUsername
92
- password = ossrhPassword
93
- }
67
+ sonatype
94
68
}
95
69
}
96
70
97
- gradle. taskGraph. addTaskExecutionGraphListener(
98
- new TaskExecutionGraphListener () {
99
- @Override
100
- void graphPopulated (TaskExecutionGraph graph ) {
101
- for ( final def task in graph. allTasks ) {
102
- if ( task instanceof PublishToMavenRepository ) {
103
- if ( ossrhUsername == null ) {
104
- throw new RuntimeException ( " OSSRH username not specified, but publishing was requested" )
105
- }
106
- if ( ossrhPassword == null ) {
107
- throw new RuntimeException ( " OSSRH password not specified, but publishing was requested" )
108
- }
109
- break
110
- }
111
- }
112
- }
113
- }
114
- )
115
-
116
71
117
72
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118
73
// CI Build Task
119
74
120
- task ciBuild {
75
+ tasks . register( ' ciBuild' ) {
121
76
description = " The task performed when one of the 'main' jobs are triggered on the " +
122
77
" CI server. Just as above, relies on the fact that subprojects will " +
123
78
" appropriately define a release task themselves if they have any tasks " +
0 commit comments