Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2008 Google Inc.
*
* Licensed 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.
*/
package com.google.gwt.dev.cfg;
import com.google.gwt.core.ext.Linker;
import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.core.ext.UnableToCompleteException;
import com.google.gwt.core.ext.linker.LinkerOrder;
import com.google.gwt.core.ext.linker.LinkerOrder.Order;
import com.google.gwt.core.ext.typeinfo.TypeOracle;
import com.google.gwt.dev.CompilerContext;
import com.google.gwt.dev.javac.CompilationProblemReporter;
import com.google.gwt.dev.javac.CompilationState;
import com.google.gwt.dev.javac.CompilationStateBuilder;
import com.google.gwt.dev.resource.Resource;
import com.google.gwt.dev.resource.ResourceOracle;
import com.google.gwt.dev.resource.impl.DefaultFilters;
import com.google.gwt.dev.resource.impl.PathPrefix;
import com.google.gwt.dev.resource.impl.PathPrefixSet;
import com.google.gwt.dev.resource.impl.ResourceFilter;
import com.google.gwt.dev.resource.impl.ResourceOracleImpl;
import com.google.gwt.dev.util.Empty;
import com.google.gwt.dev.util.Util;
import com.google.gwt.dev.util.log.speedtracer.CompilerEventType;
import com.google.gwt.dev.util.log.speedtracer.SpeedTracerLogger;
import com.google.gwt.dev.util.log.speedtracer.SpeedTracerLogger.Event;
import com.google.gwt.thirdparty.guava.common.base.Preconditions;
import com.google.gwt.thirdparty.guava.common.collect.Lists;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
/**
* Represents a module specification. In principle, this could be built without
* XML for unit tests.
*/
public class ModuleDef {
/**
* Marks a module in a way that can be used to calculate the effective bounds of a library module
* in a module tree.
*/
public enum ModuleType {
/**
* A module that acts as just a bundle of source code to be included in a referencing library.
* The contained code may form circular references with other source within the contiguous chunk
* of modules made up of a library and it's subtree of filesets. As a result a fileset can not
* be compiled on it's own and must be compiled as part of a library.
*/
FILESET,
/**
* The default type of module. Libraries should be independently compilable and are expected to
* explicitly declare all of their immediate dependencies and include paths and none of their
* contained source should be part of a circular reference with any source outside the effective
* bounds of the library.
*/
LIBRARY
}
/**
* When walking a module tree of mixed library and fileset modules, attributes are accumulated and
* stored. But when compiling separately, some attributes should only be collected from the
* effective target module. AttributeSource is used to classify these "in target module" and "out
* of target module" times.
*/
private enum AttributeSource {
EXTERNAL_LIBRARY, TARGET_LIBRARY
}
private static final ResourceFilter NON_JAVA_RESOURCES = new ResourceFilter() {
@Override
public boolean allows(String path) {
return !path.endsWith(".java") && !path.endsWith(".class");
}
};
private static final Comparator> REV_NAME_CMP =
new Comparator>() {
@Override
public int compare(Map.Entry entry1, Map.Entry entry2) {
String key1 = entry1.getKey();
String key2 = entry2.getKey();
// intentionally reversed
return key2.compareTo(key1);
}
};
public static boolean isValidModuleName(String moduleName) {
// Check for an empty string between two periods.
if (moduleName.contains("..")) {
return false;
}
// Insure the package name components are a valid Java ident.
String[] parts = moduleName.split("\\.");
for (int i = 0; i < parts.length - 1; i++) {
String part = parts[i];
if (!Util.isValidJavaIdent(part)) {
return false;
}
}
return true;
}
private final Set activeLinkers = new LinkedHashSet();
private String activePrimaryLinker;
/**
* A set of URLs for .gwtar files found on the classpath that correspond
* to .gwt.xml files loaded as a part of this module's nested load.
*
* @see com.google.gwt.dev.CompileModule
*/
private final List archiveURLs = new ArrayList();
private boolean collapseAllProperties;
private final DefaultFilters defaultFilters;
private final List entryPointTypeNames = new ArrayList();
private final Set gwtXmlFiles = new HashSet();
private final Set inheritedModules = new HashSet();
/**
* All resources found on the public path, specified by directives in
* modules (or the implicit ./public directory). Marked 'lazy' because it does not
* start searching for resources until a query is made.
*/
private ResourceOracleImpl lazyPublicOracle;
/**
* A subset of lazySourceOracle, contains files other than .java and .class files.
*/
private ResourceOracleImpl lazyResourcesOracle;
/**
* Contains all files from the source path, specified by