Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.codehaus.mojo.gwt.reports;
  
  /*
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements.  See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership.  The ASF licenses this file
   * to you under the Apache License, Version 2.0 (the
   * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
  *
  *   http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */
 
 import java.io.File;
 import java.util.List;
 
see http://code.google.com/webtoolkit/doc/latest/DevGuideCompileReport.html#Usage

Author(s):
Olivier Lamy
Since:
2.1.0-1
Goal:
compile-report
 
 public class CompileReport
     extends AbstractMavenReport
 {

    
The output directory of the gwt compiler reports.

Parameter:
default-value="${project.reporting.outputDirectory}/gwtCompileReports"
Required:
Readonly:
 
     protected File reportingOutputDirectory;

    
The directory into which extra, non-deployed files will be written.

Parameter:
default-value="${project.build.directory}/extra"
 
     private File extra;
    
    
Doxia Site Renderer component.

Since:
2.1.0-1
Component:
 
     protected Renderer siteRenderer;  
    
    
The output directory for the report. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the output directory configured in the Maven Site Plugin is used instead.

Since:
2.1.0-1
Parameter:
default-value="${project.reporting.outputDirectory}"
Required:
     
     protected File outputDirectory;
    
    
The Maven Project.

Since:
2.1.0-1
Parameter:
default-value="${project}"
Required:
Readonly:
 
     protected MavenProject project;    
   
    
    

Since:
2.1.0-1
Component:
    protected ClasspathBuilder classpathBuilder;    
    
    

Since:
2.1.0-1
Parameter:
default-value="false" expression="${gwt.compilerReport.skip}"
    private boolean skip;    
    
    
Internationalization component.

Since:
2.1.0-1
Component:
    protected I18N i18n;

    
    public boolean canGenerateReport()
    {
        // TODO check the compiler has created the raw xml soyc file
        return true;
    }

    
    public String getCategoryName()
    {
        return ;
    }

    
    public String getDescriptionLocale locale )
    {
        return "GWT Compiler Report";
    }

    
    public String getNameLocale locale )
    {
        return "GWT Compiler Report";
    }

    
    public String getOutputName()
    {
        return "gwt-compiler-reports";
    }

    
    public boolean isExternalReport()
    {
        return false;
    }
    @Override
    protected Renderer getSiteRenderer()
    {
        return ;
    }
    @Override
    protected String getOutputDirectory()
    {
        return .getAbsolutePath();
    }
    @Override
    protected MavenProject getProject()
    {
        return ;
    }    
   
    
    @Override
    protected void executeReportLocale locale )
        throws MavenReportException
    {
        
        if (  )
        {
            getLog().info"Compiler Report is skipped" );
            return;
        }        
        
        if ( !.exists() )
        {
            .mkdirs();
        }
        boolean compileReports = true;
        //compile-report
        DirectoryScanner scanner = new DirectoryScanner();
        scanner.setBasedir );
        scanner.setIncludesnew String[] { "**/soycReport/compile-report/index.html" } );
        
        if (.exists())
        {
            scanner.scan();
        } else
        {
            compileReports = false;
        }
        
        if (!compileReports || scanner.getIncludedFiles().length == 0 )
        {
            getLog().warn"No compile reports found, did you compile with compileReport option set ?" );
            compileReports = false;
        }
        
        String[] includeFiles = compileReports ? scanner.getIncludedFiles() : new String[0];
        
        for ( String path : includeFiles )
        {
            String module = path.substring( 0, path.indexOf. ) );
            File dirTarget = new File.getAbsolutePath() + . + module );
            getLog().debug"file in path " + path + " to target " + dirTarget.getAbsolutePath());
            try
            {
                FileUtils.copyDirectoryStructurenew File(path).getParentFile(), dirTarget );
            }
            catch ( IOException e )
            {
                throw new MavenReportExceptione.getMessage(), e );
            }
        }
        
        try
        {
            GwtModuleReader gwtModuleReader = new DefaultGwtModuleReaderthis.getLog(),  );
            List<GwtModulegwtModules = new ArrayList<GwtModule>();
            List<StringmoduleNames = gwtModuleReader.getGwtModules();
            for ( String name : moduleNames )
            {
                gwtModules.addgwtModuleReader.readModulename ) );
            }
            // add link in the page to all module reports
            CompilationReportRenderer compilationReportRenderer = new CompilationReportRenderergetSink(), gwtModules,
                                                                                                 getLog(),
                                                                                                 compileReports,
                                                                                                 "gwtCompileReports",
                                                                                                 truelocale );
            compilationReportRenderer.render();
        }
        catch ( GwtModuleReaderException e )
        {
            throw new MavenReportExceptione.getMessage(), e );
        }
    }
New to GrepCode? Check out our FAQ X