polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject polygene-java git commit: build: fix artifact info generation for documentation
Date Mon, 27 Feb 2017 14:36:45 GMT
Repository: polygene-java
Updated Branches:
  refs/heads/develop 30c5ff231 -> c042c76c0


build: fix artifact info generation for documentation


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/c042c76c
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/c042c76c
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/c042c76c

Branch: refs/heads/develop
Commit: c042c76c0c75d40d248bbfdec592a1fee9607cff
Parents: 30c5ff2
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Mon Feb 27 15:36:26 2017 +0100
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Mon Feb 27 15:36:26 2017 +0100

----------------------------------------------------------------------
 .../structure/manual/AsciidocBuildInfoPlugin.groovy | 16 +++++++++-------
 .../gradle/structure/manual/ManualPlugin.groovy     | 10 ++++++++--
 2 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c042c76c/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/manual/AsciidocBuildInfoPlugin.groovy
----------------------------------------------------------------------
diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/manual/AsciidocBuildInfoPlugin.groovy
b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/manual/AsciidocBuildInfoPlugin.groovy
index 220bc38..3a9216c 100644
--- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/manual/AsciidocBuildInfoPlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/manual/AsciidocBuildInfoPlugin.groovy
@@ -19,6 +19,7 @@ package org.apache.polygene.gradle.structure.manual
 
 import groovy.transform.CompileStatic
 import org.apache.polygene.gradle.TaskGroups
+import org.apache.polygene.gradle.code.PublishNaming
 import org.gradle.api.Project
 import org.gradle.api.Plugin
 
@@ -31,10 +32,11 @@ class AsciidocBuildInfoPlugin implements Plugin<Project>
   {
     def buildInfoDir = new File( project.buildDir, "docs/buildinfo" );
 
-    def makeAsciidocBuildInfoTask = project.tasks.create( TASK_NAME )
-    makeAsciidocBuildInfoTask.group = TaskGroups.DOCUMENTATION
-    makeAsciidocBuildInfoTask.description = 'Generates asciidoc artifact snippet'
-    makeAsciidocBuildInfoTask.doLast {
+    def task = project.tasks.create( TASK_NAME )
+    task.group = TaskGroups.DOCUMENTATION
+    task.description = 'Generates asciidoc artifact snippet'
+    task.inputs.properties.put 'artifactId', PublishNaming.publishedNameFor( project.path
)
+    task.doLast {
       buildInfoDir.mkdirs()
 
       // GroupID, ArtifactID, Version table in artifact.txt
@@ -44,7 +46,7 @@ class AsciidocBuildInfoPlugin implements Plugin<Project>
         |[role="artifact", options="header,autowidth"]
         ||===================================================
         ||Group ID|Artifact ID|Version
-        ||${ project.group }|${ project.name }|${ project.version }
+        ||${ project.group }|${ PublishNaming.publishedNameFor( project.path ) }|${ project.version
}
         ||===================================================
         """.stripMargin()
       artifactTableFile.withWriter { out -> out.println( artifactTable ) }
@@ -53,8 +55,8 @@ class AsciidocBuildInfoPlugin implements Plugin<Project>
     // Declare inputs/outputs
     if( project.getBuildFile() != null && project.getBuildFile().exists() )
     {
-      makeAsciidocBuildInfoTask.getInputs().file( project.getBuildFile() )
+      task.getInputs().file( project.getBuildFile() )
     }
-    makeAsciidocBuildInfoTask.getOutputs().file( buildInfoDir )
+    task.getOutputs().file( buildInfoDir )
   }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c042c76c/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/manual/ManualPlugin.groovy
----------------------------------------------------------------------
diff --git a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/manual/ManualPlugin.groovy
b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/manual/ManualPlugin.groovy
index 94d0743..69dfefe 100644
--- a/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/manual/ManualPlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/polygene/gradle/structure/manual/ManualPlugin.groovy
@@ -44,8 +44,14 @@ class ManualPlugin implements Plugin<Project>
     def websiteTask = project.tasks.create( TaskNames.WEBSITE, DocumentationTask ) { DocumentationTask
task ->
       task.group = TaskGroups.DOCUMENTATION
       task.description = 'Generates documentation website'
-      task.dependsOn project.rootProject.allprojects.findResults { Project p ->
-        p.tasks.findByName AsciidocBuildInfoPlugin.TASK_NAME
+      project.rootProject.allprojects.findResults { Project p ->
+        // TODO Remove project.afterEvaluate
+        p.afterEvaluate {
+          if( p.tasks.findByName( AsciidocBuildInfoPlugin.TASK_NAME ) )
+          {
+            task.dependsOn p.tasks.findByName( AsciidocBuildInfoPlugin.TASK_NAME )
+          }
+        }
       }
       task.onlyIf { isAsciidocInstalled( project, releaseSpec ) }
       task.docName = 'website'


Mime
View raw message