deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject git commit: DELTASPIKE-574 Versioning for DeltaSpike JSF resources
Date Tue, 15 Apr 2014 19:01:47 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 89502997c -> 0a4bc446b


DELTASPIKE-574 Versioning for DeltaSpike JSF resources

Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/0a4bc446
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/0a4bc446
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/0a4bc446

Branch: refs/heads/master
Commit: 0a4bc446b5d8a75b67a211a883004c88187ed630
Parents: 8950299
Author: tandraschko <tandraschko@apache.org>
Authored: Tue Apr 15 21:01:34 2014 +0200
Committer: tandraschko <tandraschko@apache.org>
Committed: Tue Apr 15 21:01:34 2014 +0200

----------------------------------------------------------------------
 .../impl/resource/DeltaSpikeResourceHandler.java    | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/0a4bc446/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/resource/DeltaSpikeResourceHandler.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/resource/DeltaSpikeResourceHandler.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/resource/DeltaSpikeResourceHandler.java
index 11a38f6..dbb58c4 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/resource/DeltaSpikeResourceHandler.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/resource/DeltaSpikeResourceHandler.java
@@ -22,6 +22,7 @@ import javax.faces.application.Resource;
 import javax.faces.application.ResourceHandler;
 import javax.faces.application.ResourceHandlerWrapper;
 import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+import org.apache.deltaspike.core.util.ClassUtils;
 import org.apache.deltaspike.core.util.ProjectStageProducer;
 
 /**
@@ -33,12 +34,14 @@ public class DeltaSpikeResourceHandler extends ResourceHandlerWrapper
     private static final String LIBRARY_UNCOMPRESSED = "deltaspike-uncompressed";
     
     private final ResourceHandler wrapped;
+    private final String version;
 
     public DeltaSpikeResourceHandler(ResourceHandler resourceHandler)
     {
         super();
 
         wrapped = resourceHandler;
+        version = ClassUtils.getJarVersion(this.getClass());
     }
 
     @Override
@@ -46,13 +49,14 @@ public class DeltaSpikeResourceHandler extends ResourceHandlerWrapper
     {
         Resource resource = wrapped.createResource(resourceName, libraryName);
 
-        if (resource != null
-                && libraryName != null
-                && LIBRARY.equals(libraryName)
-                && ProjectStageProducer.getInstance().getProjectStage() == ProjectStage.Development)
+        if (resource != null && libraryName != null && LIBRARY.equals(libraryName))
         {
-
-            resource = wrapped.createResource(resourceName, LIBRARY_UNCOMPRESSED);
+            if (ProjectStageProducer.getInstance().getProjectStage() == ProjectStage.Development)
+            {
+                resource = wrapped.createResource(resourceName, LIBRARY_UNCOMPRESSED);
+            }
+            
+            resource = new DeltaSpikeResource(resource, version);
         }
 
         return resource;


Mime
View raw message