Reviewers: kathrin,

Description:
This patch moves the SOYC static resources (gifs and css files) into a
subdirectory within the resulting jar.  This change should unblock the
following issue, which moves all of the SOYC code and resources into the
gwt-dev-jar.

This part is a separate patch so that the next patch doesn't have to
both move and edit any one file.

http://gwt-code-reviews.appspot.com/56811

Please review this at http://gwt-code-reviews.appspot.com/60803

Affected files:
   tools/soyc-vis/build.xml
   tools/soyc-vis/src/com/google/gwt/soyc/MakeTopLevelHtmlForPerm.java


Index: tools/soyc-vis/src/com/google/gwt/soyc/MakeTopLevelHtmlForPerm.java
===================================================================
--- tools/soyc-vis/src/com/google/gwt/soyc/MakeTopLevelHtmlForPerm.java  
(revision 5969)
+++ tools/soyc-vis/src/com/google/gwt/soyc/MakeTopLevelHtmlForPerm.java  
(working copy)
@@ -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);

Index: tools/soyc-vis/build.xml
===================================================================
--- tools/soyc-vis/build.xml    (revision 5969)
+++ tools/soyc-vis/build.xml    (working copy)
@@ -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">



--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to