本文整理匯總了Java中com.sun.squawk.builder.util.FileSet.AndSelector方法的典型用法代碼示例。如果您正苦於以下問題:Java FileSet.AndSelector方法的具體用法?Java FileSet.AndSelector怎麽用?Java FileSet.AndSelector使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sun.squawk.builder.util.FileSet
的用法示例。
在下文中一共展示了FileSet.AndSelector方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processImports
import com.sun.squawk.builder.util.FileSet; //導入方法依賴的package包/類
/**
* Preprocess a given set of Java import file source files.
*
* @param dstDir the directory containing the generated Java src files (typically "native")
* @param srcDirs the set of directories that are searched recursively for the source files to be imported
* @param j2me specifies if the classes being compiled are to be deployed on a J2ME platform
* @return the preprocessor output directory
*/
public File processImports(
File dstDir,
File[] srcDirs,
boolean j2me) {
// Get the preprocessor output directory
SourceProcessor sp = new SourceProcessor();
for (int i = 0; i != srcDirs.length; ++i) {
File sourceDir = srcDirs[i];
// A selector that matches a source file whose preprocessed copy does not exist,
// is younger than the source file or has a last modification date
// earlier than the last modification date of the properties
FileSet.Selector outOfDate = new FileSet.DependSelector(new FileSet.SourceDestDirMapper(sourceDir, dstDir)) {
public boolean isSelected(
File file) {
if (super.isSelected(file)) {
return true;
}
File preprocessedFile = getMapper().map(file);
long fileLastModified = preprocessedFile.lastModified();
return (fileLastModified < env.propertiesLastModified);
}
};
FileSet.Selector selector = new FileSet.AndSelector(JAVA_SOURCE_SELECTOR, outOfDate);
FileSet fs = new FileSet(sourceDir, selector);
sp.execute(fs, dstDir);
}
return dstDir;
}
示例2: preprocess
import com.sun.squawk.builder.util.FileSet; //導入方法依賴的package包/類
public File preprocess(File baseDir, File[] srcDirs, boolean j2me, boolean vm2c, boolean stripHostCode) {
// Get the preprocessor output directory
final File preprocessedDir;
boolean resetJava5Syntax = false;
if (vm2c && !isJava5SyntaxSupported()) {
log(brief, "[preprocessing with forced JAVA5SYNTAX for vm2c]");
preprocessedDir = mkdir(baseDir, RomCommand.PREPROCESSED_FOR_VM2C_DIR_NAME);
updateProperty("JAVA5SYNTAX", "true");
isJava5SyntaxSupported = true;
resetJava5Syntax = true;
} else {
preprocessedDir = mkdir(baseDir, stripHostCode ? "preprocessed.target" : "preprocessed");
}
// Preprocess the sources
preprocessor.processAssertions = j2me;
preprocessor.verbose = verbose;
// @TODO: Should be true for desktop builds. host == target?
preprocessor.showLineNumbers = true;
preprocessor.hosted = !stripHostCode;
for (int i = 0; i != srcDirs.length; ++i) {
File sourceDir = srcDirs[i];
// A selector that matches a source file whose preprocessed copy does not exist,
// is younger than the source file or has a last modification date
// earlier than the last modification date of the properties
FileSet.Selector outOfDate = new FileSet.DependSelector(new FileSet.SourceDestDirMapper(sourceDir, preprocessedDir)) {
public boolean isSelected(File file) {
if (super.isSelected(file)) {
return true;
}
File preprocessedFile = getMapper().map(file);
long fileLastModified = preprocessedFile.lastModified();
return (fileLastModified < propertiesLastModified);
}
};
FileSet.Selector selector = new FileSet.AndSelector(JAVA_SOURCE_SELECTOR, outOfDate);
FileSet fs = new FileSet(sourceDir, selector);
preprocessor.execute(fs, preprocessedDir);
FileSet htmlFiles = new FileSet(sourceDir, HTML_SELECTOR);
for (Iterator iterator = htmlFiles.list().iterator(); iterator.hasNext();) {
File htmlFile = (File) iterator.next();
File toHtmlFile = htmlFiles.replaceBaseDir(htmlFile, preprocessedDir);
cp(htmlFile, toHtmlFile, false);
}
}
if (resetJava5Syntax) {
updateProperty("JAVA5SYNTAX", "false");
isJava5SyntaxSupported = false;
}
return preprocessedDir;
}
示例3: preprocess
import com.sun.squawk.builder.util.FileSet; //導入方法依賴的package包/類
/**
* Preprocess a given set of Java source files.
*
* @param baseDir the directory under which the "preprocessed" directory exists
* @param srcDirs the set of directories that are searched recursively for the source files to be compiled
* @param j2me specifies if the classes being compiled are to be deployed on a J2ME platform
* @param vm2c use true if preprocessing as part of vm2c compile
* @return the preprocessor output directory
*/
public File preprocess(File baseDir, File[] srcDirs, boolean j2me, boolean vm2c) {
// Get the preprocessor output directory
final File preprocessedDir;
boolean resetJava5Syntax = false;
if (vm2c && !isJava5SyntaxSupported()) {
log(brief, "[preprocessing with forced JAVA5SYNTAX for vm2c]");
preprocessedDir = mkdir(baseDir, RomCommand.PREPROCESSED_FOR_VM2C_DIR_NAME);
updateProperty("JAVA5SYNTAX", "true");
isJava5SyntaxSupported = true;
resetJava5Syntax = true;
} else {
preprocessedDir = mkdir(baseDir, "preprocessed");
}
// Preprocess the sources
preprocessor.processAssertions = j2me;
preprocessor.verbose = verbose;
// @TODO: Should be true for desktop builds. host == target?
preprocessor.showLineNumbers = true;
for (int i = 0; i != srcDirs.length; ++i) {
File sourceDir = srcDirs[i];
// A selector that matches a source file whose preprocessed copy does not exist,
// is younger than the source file or has a last modification date
// earlier than the last modification date of the properties
FileSet.Selector outOfDate = new FileSet.DependSelector(new FileSet.SourceDestDirMapper(sourceDir, preprocessedDir)) {
public boolean isSelected(File file) {
if (super.isSelected(file)) {
return true;
}
File preprocessedFile = getMapper().map(file);
long fileLastModified = preprocessedFile.lastModified();
return (fileLastModified < propertiesLastModified);
}
};
FileSet.Selector selector = new FileSet.AndSelector(JAVA_SOURCE_SELECTOR, outOfDate);
FileSet fs = new FileSet(sourceDir, selector);
preprocessor.execute(fs, preprocessedDir);
FileSet htmlFiles = new FileSet(sourceDir, HTML_SELECTOR);
for (Iterator iterator = htmlFiles.list().iterator(); iterator.hasNext();) {
File htmlFile = (File) iterator.next();
File toHtmlFile = htmlFiles.replaceBaseDir(htmlFile, preprocessedDir);
cp(htmlFile, toHtmlFile, false);
}
}
if (resetJava5Syntax) {
updateProperty("JAVA5SYNTAX", "false");
isJava5SyntaxSupported = false;
}
return preprocessedDir;
}