Package com.google.gwt.dev.cfg

Examples of com.google.gwt.dev.cfg.ResourceLoader


    // make sure we get the latest version of any modified jar
    ZipFileClassPathEntry.clearCache();
    ResourceOracleImpl.clearCache();

    ResourceLoader resources = ResourceLoaders.forClassLoader(Thread.currentThread());
    resources = ResourceLoaders.forPathAndFallback(options.getSourcePath(), resources);
    this.resourceLoader.set(resources);

    // ModuleDefLoader.loadFromResources() checks for modified .gwt.xml files.
    ModuleDef moduleDef = ModuleDefLoader.loadFromResources(
View Full Code Here


      Util.recursiveDelete(outputDir, true);
    }

    // Fake out the resource loader to read resources both from the normal classpath as well as this
    // new application directory.
    ResourceLoader resourceLoader = ResourceLoaders.forClassLoader(Thread.currentThread());
    resourceLoader =
        ResourceLoaders.forPathAndFallback(ImmutableList.of(applicationDir), resourceLoader);

    // Setup options to perform a per-file compile, output to this new application directory and
    // compile the given module.
View Full Code Here

    String[] gwtClassPathStrings = gwtClassPathProperty.split(";");
    final List<URL> gwtClassPathEntries = Lists.newArrayList();
    for (String gwtClassPathString : gwtClassPathStrings) {
      gwtClassPathEntries.add(new File(gwtClassPathString).toURI().toURL());
    }
    ResourceLoader gwtClassPathResourceLoader = new ResourceLoader() {
        @Override
      public List<URL> getClassPath() {
        return gwtClassPathEntries;
      }
View Full Code Here

    return gwtClassPathResourceLoader;
  }

  private static ResourceLoader createGwtClassPathResourceLoaderWithMocks(
      String... mockResourceNames) throws FileNotFoundException, IOException {
    final ResourceLoader gwtClassPathResourceLoader = createGwtClassPathResourceLoader();
    File mockResourcesDirectory = Files.createTempDir();

    for (String mockResourceName : mockResourceNames) {
      File mockFooFile = new File(mockResourcesDirectory, mockResourceName);
      mockFooFile.getParentFile().mkdirs();
      URL realFooResource = gwtClassPathResourceLoader.getResource(mockResourceName);
      Resources.copy(realFooResource, new FileOutputStream(mockFooFile));
    }

    return ResourceLoaders.forPathAndFallback(Lists.newArrayList(mockResourcesDirectory),
        gwtClassPathResourceLoader);
View Full Code Here

    loggerBuilder.expectInfo(BuildTarget.formatCompilingModuleMessage(
        "com.google.gwt.dev.testdata.incrementalbuildsystem.SimpleTop"), null);
    UnitTestTreeLogger testLogger = loggerBuilder.createLogger();

    // Prepare the compiler.
    ResourceLoader resourceLoader = createGwtClassPathResourceLoaderWithMocks(
        "com/google/gwt/dev/testdata/incrementalbuildsystem/Foo.java");
    IncrementalBuilder incrementalBuilder = createIncrementalBuilder(
        "com.google.gwt.dev.testdata.incrementalbuildsystem.SimpleTop", resourceLoader);
    incrementalBuilder.clean();

    // Compile.
    boolean actualBuildSuccess = incrementalBuilder.build(testLogger).isSuccess();

    // Assert compile succeeded and was a full compile with no caching.
    assertEquals(true, actualBuildSuccess);
    testLogger.assertLogEntriesContainExpected();

    // Setup logging expectations for a fully cached compile.
    loggerBuilder = new UnitTestTreeLogger.Builder();
    loggerBuilder.setLowestLogLevel(TreeLogger.INFO);
    loggerBuilder.expectInfo(IncrementalBuilder.NO_FILES_HAVE_CHANGED, null);
    testLogger = loggerBuilder.createLogger();

    // Recompile without changes.
    actualBuildSuccess = incrementalBuilder.rebuild(testLogger).isSuccess();

    // Assert compile succeeded and was fully cached.
    assertEquals(true, actualBuildSuccess);
    testLogger.assertLogEntriesContainExpected();

    // Change modification date of the Foo.java seen by SimpleMid.gwt.xml
    File fooFile = new File(resourceLoader.getResource(
        "com/google/gwt/dev/testdata/incrementalbuildsystem/Foo.java").getPath());
    fooFile.setLastModified(System.currentTimeMillis() + 60 * 1000);

    // Setup logging expectations for partially cached recompile.
    loggerBuilder = new UnitTestTreeLogger.Builder();
View Full Code Here

        extraFileSet);

    if (saveSources) {
      // Assume that all source code is available in the compiler's classpath.
      // (This will have to be adjusted to work with Super Dev Mode.)
      ResourceLoader loader = ResourceLoaders.forClassLoader(Thread.currentThread());
      SourceSaver.save(logger, artifacts, loader, options, destPrefix, extraFileSet);
    }

    outFileSet.close();
    extraFileSet.close();
View Full Code Here

    linkerContext.produceOutput(logger, artifacts, Visibility.Private,
        extraFileSet);

    // Assume that all source code is available in the compiler's classpath.
    // (This will have to be adjusted to work with Super Dev Mode.)
    ResourceLoader loader = ResourceLoaders.forClassLoader(Thread.currentThread());
    SourceSaver.save(logger, artifacts, loader, options, destPrefix, extraFileSet);

    outFileSet.close();
    extraFileSet.close();
    if (deployFileSet != extraFileSet) {
View Full Code Here

    // make sure we get the latest version of any modified jar
    ZipFileClassPathEntry.clearCache();
    ResourceOracleImpl.clearCache();
    ModuleDefLoader.clearModuleCache();

    ResourceLoader resources = ResourceLoaders.forClassLoader(Thread.currentThread());
    resources = ResourceLoaders.forPathAndFallback(sourcePath, resources);
    this.resourceLoader.set(resources);

    ModuleDef moduleDef =
        ModuleDefLoader.loadFromResources(logger, originalModuleName, resources, true);
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.cfg.ResourceLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.