@@ -43,81 +43,36 @@ apply from: file( 'gradle/module.gradle' )
4343// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4444// Release Task
4545
46- task release {
46+ tasks . register( ' release' ) {
4747 description = " The task performed when we are performing a release build. Relies on " +
4848 " the fact that subprojects will appropriately define a release task " +
4949 " themselves if they have any release-related activities to perform"
5050
5151 doFirst {
5252 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} " )
5555 }
5656 }
5757}
5858
59- task publish {
59+ tasks . register( ' publish' ) {
6060 description = " The task performed when we want to just publish maven artifacts. Relies on " +
6161 " the fact that subprojects will appropriately define a release task " +
6262 " themselves if they have any publish-related activities to perform"
6363}
6464
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-
8865nexusPublishing {
8966 repositories {
90- sonatype {
91- username = ossrhUsername
92- password = ossrhPassword
93- }
67+ sonatype
9468 }
9569}
9670
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-
11671
11772// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11873// CI Build Task
11974
120- task ciBuild {
75+ tasks . register( ' ciBuild' ) {
12176 description = " The task performed when one of the 'main' jobs are triggered on the " +
12277 " CI server. Just as above, relies on the fact that subprojects will " +
12378 " appropriately define a release task themselves if they have any tasks " +
0 commit comments