Moves SOYC static resources--CSS and GIF files--into a subdirectory
of its jar rather than the top level.
Review by: kprobst
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@5973 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/tools/soyc-vis/build.xml b/tools/soyc-vis/build.xml
index cd125d2..b46b267 100644
--- a/tools/soyc-vis/build.xml
+++ b/tools/soyc-vis/build.xml
@@ -20,13 +20,13 @@
<pathelement location="${gwt.dev.jar}" />
</classpath>
</javac>
- <mkdir dir="${javac.out}/images"/>
- <copy todir="${javac.out}/images">
+ <mkdir dir="${javac.out}/com/google/gwt/soyc/resources/images"/>
+ <copy todir="${javac.out}/com/google/gwt/soyc/resources/images">
<fileset dir="images"/>
</copy>
- <copy file="classLevel.css" tofile="${javac.out}/classLevel.css"/>
- <copy file="roundedCorners.css" tofile="${javac.out}/roundedCorners.css"/>
- <copy file="common.css" tofile="${javac.out}/common.css"/>
+ <copy file="classLevel.css" tofile="${javac.out}/com/google/gwt/soyc/resources/classLevel.css"/>
+ <copy file="roundedCorners.css" tofile="${javac.out}/com/google/gwt/soyc/resources/roundedCorners.css"/>
+ <copy file="common.css" tofile="${javac.out}/com/google/gwt/soyc/resources/common.css"/>
</target>
<target name="build" depends="compile">
diff --git a/tools/soyc-vis/src/com/google/gwt/soyc/MakeTopLevelHtmlForPerm.java b/tools/soyc-vis/src/com/google/gwt/soyc/MakeTopLevelHtmlForPerm.java
index 551df15..7c5c5fe 100644
--- a/tools/soyc-vis/src/com/google/gwt/soyc/MakeTopLevelHtmlForPerm.java
+++ b/tools/soyc-vis/src/com/google/gwt/soyc/MakeTopLevelHtmlForPerm.java
@@ -121,6 +121,10 @@
*/
private static final Pattern PATTERN_SP_INT = Pattern.compile("sp([0-9]+)");
+ private static String RESOURCES_PATH = MakeTopLevelHtmlForPerm.class.getPackage().getName().replace(
+ '.', '/')
+ + "/resources/";
+
public void copyFileOrDirectory(File srcPath, File dstPath, String classPath,
String inputFileName, boolean isDirectory) throws IOException {
if (srcPath.isDirectory()) {
@@ -418,24 +422,24 @@
classPath += "/";
}
String inputFileName = "roundedCorners.css";
- File inputFile = new File(classPath + inputFileName);
+ File inputFile = new File(classPath + RESOURCES_PATH + inputFileName);
File outputFile = getOutFile("roundedCorners.css");
- copyFileOrDirectory(inputFile, outputFile, classPath, inputFileName, false);
+ copyFileOrDirectory(inputFile, outputFile, classPath, RESOURCES_PATH + inputFileName, false);
inputFileName = "classLevel.css";
- File inputFile2 = new File(classPath + inputFileName);
+ File inputFile2 = new File(classPath + RESOURCES_PATH + inputFileName);
File outputFile2 = getOutFile("classLevel.css");
- copyFileOrDirectory(inputFile2, outputFile2, classPath, inputFileName,
+ copyFileOrDirectory(inputFile2, outputFile2, classPath, RESOURCES_PATH + inputFileName,
false);
inputFileName = "common.css";
- File inputFile3 = new File(classPath + inputFileName);
+ File inputFile3 = new File(classPath + RESOURCES_PATH + inputFileName);
File outputFile3 = getOutFile("common.css");
- copyFileOrDirectory(inputFile3, outputFile3, classPath, inputFileName,
+ copyFileOrDirectory(inputFile3, outputFile3, classPath, RESOURCES_PATH + inputFileName,
false);
inputFileName = "images";
- File inputDir = new File(classPath + "images");
+ File inputDir = new File(classPath + RESOURCES_PATH + "images");
File outputDir = getOutFile("images");
copyFileOrDirectory(inputDir, outputDir, classPath, inputFileName, true);