matrei commented on code in PR #39:
URL: 
https://github.com/apache/grails-gradle-publish/pull/39#discussion_r4106002721


##########
gradle/signing-config.gradle:
##########
@@ -28,7 +28,7 @@ if (isReleaseVersion) {
 
     afterEvaluate {
         signing {
-            required { isReleaseVersion && gradle.taskGraph.hasTask('publish') 
}
+            required { rootProject.isReleaseVersion && 
gradle.taskGraph.hasTask('publish') }

Review Comment:
   Changed to `required = true` in 186cb20. One correction on the effect, 
though: because the build calls `useGpgCmd()`, gpg is always invoked, so a 
missing key already failed the build rather than skipping signing. I checked by 
running `signPluginMavenPublication` with `GRAILS_PUBLISH_RELEASE=true` and an 
empty `GNUPGHOME` before and after the change, and both runs failed with "No 
secret key". So this is a correctness cleanup rather than a behaviour change, 
but the predicate was clearly wrong.



##########
gradle/signing-config.gradle:
##########
@@ -28,7 +28,7 @@ if (isReleaseVersion) {
 
     afterEvaluate {
         signing {
-            required { isReleaseVersion && gradle.taskGraph.hasTask('publish') 
}
+            required { rootProject.isReleaseVersion && 
gradle.taskGraph.hasTask('publish') }
             useGpgCmd()
 
             Publication[] publications = new 
Publication[publishing.publications.size()]

Review Comment:
   Done in 86066d4: `sign(publishing.publications)`. Since it's a live 
collection, I also dropped the surrounding `afterEvaluate`. The same two sign 
tasks (`signPluginMavenPublication` and 
`signGrailsPublishPluginMarkerMavenPublication`) are still created and are part 
of `publishToSonatype`.



##########
gradle/signing-config.gradle:
##########
@@ -38,7 +38,7 @@ if (isReleaseVersion) {
     }
 
     tasks.withType(Sign).configureEach {
-        onlyIf { isReleaseVersion }
+        onlyIf { rootProject.isReleaseVersion }

Review Comment:
   Removed the `onlyIf` in 186cb20, together with the `required` change.



##########
gradle/publish-config.gradle:
##########
@@ -18,7 +18,7 @@
  */
 
 publishing {
-    if (!isReleaseVersion) {
+    if (!rootProject.isReleaseVersion) {

Review Comment:
   Done in 1cc5847. `publish-config.gradle` and `signing-config.gradle` now 
read `GRAILS_PUBLISH_RELEASE` through `providers.environmentVariable`. The root 
`ext.isReleaseVersion` is still used by `publish-root-config.gradle`, but 
that's applied to the root project itself.



##########
plugin/src/main/groovy/org/apache/grails/gradle/publish/GrailsPublishGradlePlugin.groovy:
##########
@@ -902,7 +902,7 @@ Note: if project properties are used, the properties must 
be defined prior to ap
             GrailsPublishExtension gpe = 
project.extensions.getByType(GrailsPublishExtension)
             Set<String> additionalPublicationSourceSets = 
gpe.additionalPublications
                     .collect { it.sourceSetName.get() } as Set<String>
-            Collection<SourceSet> publishedSourceSets = sourceSets.findAll { 
SourceSet sourceSet ->
+            Collection<SourceSet> publishedSourceSets = sourceSets.matching { 
SourceSet sourceSet ->
                 !(sourceSet.name in additionalPublicationSourceSets)
             }
             jar.from publishedSourceSets.collect { it.allSource }

Review Comment:
   Removed in e3a611f, along with the same redundant `jar.inputs.files(...)` on 
`testSourcesJar`. With that line gone, the source list is only computed once.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to