本文整理匯總了Java中org.apache.tools.ant.Project.log方法的典型用法代碼示例。如果您正苦於以下問題:Java Project.log方法的具體用法?Java Project.log怎麽用?Java Project.log使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.tools.ant.Project
的用法示例。
在下文中一共展示了Project.log方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: scanBinaries
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
/**
* Find all modules in a binary build, possibly from cache.
*/
private static Map<String,Entry> scanBinaries(Project project, File[] clusters) throws IOException {
Map<String,Entry> allEntries = new HashMap<>();
for (File cluster : clusters) {
Map<String, Entry> entries = BINARY_SCAN_CACHE.get(cluster);
if (entries == null) {
if (project != null) {
project.log("Scanning for modules in " + cluster);
}
entries = new HashMap<>();
doScanBinaries(cluster, entries);
if (project != null) {
project.log("Found modules: " + entries.keySet(), Project.MSG_VERBOSE);
}
BINARY_SCAN_CACHE.put(cluster, entries);
}
allEntries.putAll(entries);
}
return allEntries;
}
示例2: scanSuiteSources
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
private static Map<String,Entry> scanSuiteSources(Map<String,Object> properties, Project project) throws IOException {
File basedir = new File((String) properties.get("basedir"));
String suiteDir = (String) properties.get("suite.dir");
if (suiteDir == null) {
throw new IOException("No definition of suite.dir in " + basedir);
}
File suite = FileUtils.getFileUtils().resolveFile(basedir, suiteDir);
if (!suite.isDirectory()) {
throw new IOException("No such suite " + suite);
}
Map<String,Entry> entries = SUITE_SCAN_CACHE.get(suite);
if (entries == null) {
if (project != null) {
project.log("Scanning for modules in suite " + suite);
}
entries = new HashMap<>();
doScanSuite(entries, suite, properties, project);
if (project != null) {
project.log("Found modules: " + entries.keySet(), Project.MSG_VERBOSE);
}
SUITE_SCAN_CACHE.put(suite, entries);
}
return entries;
}
示例3: setProject
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
/**
* Setter for the 'project' property.
*
* @param project New value for the 'project' property.
*/
public static void setProject(final Project project) {
Utils.project = project;
useInternalPacker = "true".equals(project.getProperty("use.internal.packer"));
useInternalUnpacker = "true".equals(project.getProperty("use.internal.unpacker"));
xmx = ARG_PREFIX + XMX_ARG + project.getProperty("pack200.xmx");
permSize = ARG_PREFIX + PERM_SIZE_ARG + project.getProperty("pack200.perm.size");
maxPermSize = ARG_PREFIX + MAX_PERM_SIZE_ARG + project.getProperty("pack200.max.perm.size");
String output = "use.internal.packer? " + useInternalPacker;
if (project != null) {
project.log(" " + output);
} else {
System.out.println(output);
}
}
示例4: extendLibrariesManifests
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
private static void extendLibrariesManifests(
final Project prj,
final File mainJar,
final List<? extends File> libraries) throws IOException {
String codebase = null;
String permissions = null;
String appName = null;
final JarFile jf = new JarFile(mainJar);
try {
final java.util.jar.Manifest mf = jf.getManifest();
if (mf != null) {
final Attributes attrs = mf.getMainAttributes();
codebase = attrs.getValue(ATTR_CODEBASE);
permissions = attrs.getValue(ATTR_PERMISSIONS);
appName = attrs.getValue(ATTR_APPLICATION_NAME);
}
} finally {
jf.close();
}
prj.log(
String.format(
"Application: %s manifest: Codebase: %s, Permissions: %s, Application-Name: %s", //NOI18N
safeRelativePath(prj.getBaseDir(), mainJar),
codebase,
permissions,
appName),
Project.MSG_VERBOSE);
if (codebase != null || permissions != null || appName != null) {
for (File library : libraries) {
try {
extendLibraryManifest(prj, library, codebase, permissions, appName);
} catch (ManifestException mex) {
throw new IOException(mex);
}
}
}
}
示例5: verifyPaths
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
static void verifyPaths(Project project, Path path) {
if (path == null) return ;
String[] paths = path.list();
for (int i = 0; i < paths.length; i++) {
String pathName = project.replaceProperties(paths[i]);
File file = FileUtil.normalizeFile
(project.resolveFile (pathName));
if (!file.exists()) {
project.log("Non-existing path \""+pathName+"\" provided.", Project.MSG_WARN);
//throw new BuildException("Non-existing path \""+paths[i]+"\" provided.");
}
}
}
示例6: appendPathInArchive
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
private static URL appendPathInArchive(URL rootURL, String pathInArchive, Project prj) {
String embeddedURL = rootURL.toExternalForm() + pathInArchive;
if (embeddedURL.charAt(embeddedURL.length()-1) != '/') { //NOI18N
embeddedURL = embeddedURL + '/'; //NOI18N
}
try {
return new URL(embeddedURL);
} catch (MalformedURLException e) {
prj.log("Invalid embedded URL: \""+embeddedURL+"\".", Project.MSG_WARN); //NOI18N
return rootURL;
}
}
示例7: fileToURL
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
private static URL fileToURL (File file, Project project, boolean reportNonExistingFiles, boolean withSlash) {
FileObject fileObject = FileUtil.toFileObject (file);
if (fileObject == null) {
if (reportNonExistingFiles) {
String path = file.getAbsolutePath();
project.log("Have no file for "+path, Project.MSG_WARN);
}
return null;
}
if (FileUtil.isArchiveFile (fileObject)) {
fileObject = FileUtil.getArchiveRoot (fileObject);
if (fileObject == null) {
project.log("Bad archive "+file.getAbsolutePath(), Project.MSG_WARN);
/*
ErrorManager.getDefault().notify(ErrorManager.getDefault().annotate(
new NullPointerException("Bad archive "+file.toString()),
NbBundle.getMessage(JPDAStart.class, "MSG_WrongArchive", file.getAbsolutePath())));
*/
return null;
}
}
if (withSlash) {
return FileUtil.urlForArchiveOrDir(file);
} else {
return fileObject.toURL ();
}
}
示例8: isValid
import org.apache.tools.ant.Project; //導入方法依賴的package包/類
private static boolean isValid (File f, Project project) {
if (f.getPath ().indexOf ("${") != -1 && !f.exists ()) { // NOI18N
project.log (
"Classpath item " + f + " will be ignored.", // NOI18N
Project.MSG_VERBOSE
);
return false;
}
return true;
}