Reviewers: Lex,

Description:
Hi Lex,

could you review this patch for me? It makes all Compile Reports
artifacts private as follows:

1. If the user specifies the "-extra dir" option, the files will be
written to the "dir" directory, under soycReport.

2. If the user does *not* specify the "-extra dir" option, the compiler
will turn on this option and create a new directory called "extras",
under which the files are stored.  This directory is in the same place
as the default "war" directory.


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

Affected files:
   dev/core/src/com/google/gwt/dev/Compiler.java
   dev/core/src/com/google/gwt/soyc/GlobalInformation.java
   dev/core/src/com/google/gwt/soyc/io/ArtifactsOutputDirectory.java


Index: dev/core/src/com/google/gwt/soyc/GlobalInformation.java
Index: dev/core/src/com/google/gwt/soyc/io/ArtifactsOutputDirectory.java
===================================================================
--- dev/core/src/com/google/gwt/soyc/io/ArtifactsOutputDirectory.java    
(revision 6983)
+++ dev/core/src/com/google/gwt/soyc/io/ArtifactsOutputDirectory.java    
(working copy)
@@ -49,7 +49,7 @@
          closed = true;
          SoycArtifact newArtifact = new SoycArtifact(OUTPUT_DIRECTORY_NAME  
+ "/"
              + path, baos.toByteArray());
-        newArtifact.setPrivate(false);
+        newArtifact.setPrivate(true);
          artifacts.add(newArtifact);
          baos = null;
        }
Index: dev/core/src/com/google/gwt/dev/Compiler.java
===================================================================
--- dev/core/src/com/google/gwt/dev/Compiler.java       (revision 6983)
+++ dev/core/src/com/google/gwt/dev/Compiler.java       (working copy)
@@ -102,6 +102,12 @@
        return linkOptions.getWarDir();
      }

+    public void postProcessArgs() {
+       if ((isSoycEnabled()) && (getExtraDir() == null)) {
+               setExtraDir(new File("extras"));
+       }
+    }
+
      public void setExtraDir(File extraDir) {
        linkOptions.setExtraDir(extraDir);
      }
@@ -135,6 +141,7 @@
       */
      final CompilerOptions options = new CompilerOptionsImpl();
      if (new ArgProcessor(options).processArgs(args)) {
+      ((CompilerOptionsImpl)options).postProcessArgs();
        CompileTask task = new CompileTask() {
          public boolean run(TreeLogger logger) throws  
UnableToCompleteException {
            FutureTask<UpdateResult> updater = null;
@@ -212,7 +219,13 @@

            File absPath = new File(options.getWarDir(), module.getName());
            absPath = absPath.getAbsoluteFile();
-          Link.link(logger.branch(TreeLogger.TRACE, "Linking into " +  
absPath),
+          String logMessage = "Linking into " + absPath + ".";
+          if (options.getExtraDir() != null) {
+                 File absExtrasPath = new File(options.getExtraDir(),  
module.getName());
+                 absExtrasPath = absExtrasPath.getAbsoluteFile();
+                 logMessage += " Writing extras to " + absExtrasPath;
+          }
+          Link.link(logger.branch(TreeLogger.TRACE, logMessage),
                module, generatedArtifacts, allPerms, resultFiles,
                options.getWarDir(), options.getExtraDir(),  
precompileOptions);



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

Reply via email to