Author: abelevich
Date: 2011-03-31 15:49:00 -0400 (Thu, 31 Mar 2011)
New Revision: 22349
Modified:
modules/build/resources/trunk/faces-shade-transformers/src/main/java/org/richfaces/build/shade/resource/BaseFacesResourceTransformer.java
Log:
https://issues.jboss.org/browse/RF-10601 Update build to generation on profiles
Modified:
modules/build/resources/trunk/faces-shade-transformers/src/main/java/org/richfaces/build/shade/resource/BaseFacesResourceTransformer.java
===================================================================
---
modules/build/resources/trunk/faces-shade-transformers/src/main/java/org/richfaces/build/shade/resource/BaseFacesResourceTransformer.java 2011-03-31
19:45:16 UTC (rev 22348)
+++
modules/build/resources/trunk/faces-shade-transformers/src/main/java/org/richfaces/build/shade/resource/BaseFacesResourceTransformer.java 2011-03-31
19:49:00 UTC (rev 22349)
@@ -21,9 +21,7 @@
*/
package org.richfaces.build.shade.resource;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
+import java.io.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -136,19 +134,33 @@
if (namespace.getPrefix().length() == 0) {
continue;
}
-
rootElement.addNamespaceDeclaration(namespace);
}
-
+ outputFilesToSeparateDir(document,resourceName,prettyFormat);
new XMLOutputter(prettyFormat).output(document, jos);
}
+ protected void outputFilesToSeparateDir(Document document, String resourceName,
Format format) throws IOException {
+ String targetPath="target/taglibs/";
+ File path = new File(targetPath + META_INF_PATH);
+ path.mkdirs();
+ FileOutputStream outFiles = new FileOutputStream(targetPath+resourceName);
+ try {
+ new XMLOutputter(format).output(document, outFiles);
+ }
+ finally {
+ outFiles.close();
+ }
+
+
+ }
+
protected abstract void processDocument(String resource, Document document, List
relocators) throws JDOMException;
protected void resetTransformer() {
namespacesFactory = new NamespacesTracker();
}
-
+
protected String getMetaInfResourceName(String resource) {
if (!resource.startsWith(META_INF_PATH)) {
return null;