Repository: tapestry-5
Updated Branches:
  refs/heads/master f6de4c4ec -> 09a011cfb


TAP5-2192 : Add support for distributed configuration


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/09a011cf
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/09a011cf
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/09a011cf

Branch: refs/heads/master
Commit: 09a011cfb8afec9c0fa5858a8f819448d3716a2f
Parents: f6de4c4
Author: Thiago H. de Paula Figueiredo <[email protected]>
Authored: Sun Oct 12 18:49:12 2014 -0300
Committer: Thiago H. de Paula Figueiredo <[email protected]>
Committed: Sun Oct 12 18:49:12 2014 -0300

----------------------------------------------------------------------
 .../services/MavenComponentLibraryInfoSource.java |  1 +
 .../tapestry5/services/ComponentLibraryInfo.java  | 18 ++++++++++++++++--
 .../corelib/pages/ComponentLibraries.tml          |  7 +++++++
 3 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/09a011cf/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/MavenComponentLibraryInfoSource.java
----------------------------------------------------------------------
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/MavenComponentLibraryInfoSource.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/MavenComponentLibraryInfoSource.java
index e9f0495..9bf8bab 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/MavenComponentLibraryInfoSource.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/MavenComponentLibraryInfoSource.java
@@ -121,6 +121,7 @@ public class MavenComponentLibraryInfoSource implements 
ComponentLibraryInfoSour
             info.setJavadocUrl(extractText(document, 
"/project/properties/javadocUrl"));
             info.setSourceBrowseUrl(extractText(document, "/project/scm/url"));
             info.setSourceRootUrl(extractText(document, 
"/project/properties/sourceRootUrl"));
+            info.setTapestryVersion(extractText(document, 
"(/project/dependencies/dependency[./groupId='org.apache.tapestry'][./artifactId='tapestry-core']/version
 | /project/properties/tapestryVersion)[1]"));
             String tags = extractText(document, "/project/properties/tags");
             if (tags != null && tags.length() > 0)
             {

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/09a011cf/tapestry-core/src/main/java/org/apache/tapestry5/services/ComponentLibraryInfo.java
----------------------------------------------------------------------
diff --git 
a/tapestry-core/src/main/java/org/apache/tapestry5/services/ComponentLibraryInfo.java
 
b/tapestry-core/src/main/java/org/apache/tapestry5/services/ComponentLibraryInfo.java
index a043c5c..736248c 100644
--- 
a/tapestry-core/src/main/java/org/apache/tapestry5/services/ComponentLibraryInfo.java
+++ 
b/tapestry-core/src/main/java/org/apache/tapestry5/services/ComponentLibraryInfo.java
@@ -34,7 +34,7 @@ public final class ComponentLibraryInfo implements 
Serializable
     private SourceUrlResolver sourceUrlResolver;
     
     private String name, description, homepageUrl, documentationUrl, 
sourceBrowseUrl, issueTrackerUrl, sourceRootUrl, 
-                   javadocUrl, groupId, artifactId, version;
+                   javadocUrl, groupId, artifactId, version, tapestryVersion;
     
     private List<String> tags = new ArrayList<String>();
     
@@ -133,7 +133,7 @@ public final class ComponentLibraryInfo implements 
Serializable
     }
 
     /**
-     * Return the component library version. For example, "5.4.0".
+     * Returns the component library version. For example, "5.4.0".
      * @see #artifactId
      * @see #groupId
      */
@@ -143,6 +143,14 @@ public final class ComponentLibraryInfo implements 
Serializable
     }
 
     /**
+     * Returns the Tapestry version used by this component library. For 
example, "5.4.0".
+     */
+    public String getTapestryVersion()
+    {
+        return tapestryVersion;
+    }
+
+    /**
      * Returns the tags associated which describe this component library.
      * Use just lowercase letters, numbers and dashes.
      */
@@ -214,6 +222,12 @@ public final class ComponentLibraryInfo implements 
Serializable
         this.version = version;
     }
     
+    public void setTapestryVersion(String tapestryVersion)
+    {
+        if (this.tapestryVersion != null) 
throwExceptionIfAlreadySet("tapestryVersion", version);
+        this.tapestryVersion = tapestryVersion;
+    }
+    
     public void setGroupId(String groupId)
     {
         if (this.groupId != null) throwExceptionIfAlreadySet("groupId", 
artifactId);

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/09a011cf/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ComponentLibraries.tml
----------------------------------------------------------------------
diff --git 
a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ComponentLibraries.tml
 
b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ComponentLibraries.tml
index d64a314..e5323cb 100644
--- 
a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ComponentLibraries.tml
+++ 
b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ComponentLibraries.tml
@@ -49,6 +49,13 @@
                                                        ${info.version}
                                                </t:if>
                                        </dd>
+
+                                       <dt>Tapestry version</dt>
+                                       <dd class="tapestryVersion">
+                                               <t:if 
test="info.tapestryVersion" else="message:not-informed">
+                                                       ${info.tapestryVersion}
+                                               </t:if>
+                                       </dd>
                                
                                        <dt>Documentation URL</dt>
                                        <dd class="documentationUrl">

Reply via email to