home *** CD-ROM | disk | FTP | other *** search
- !!Script
- // Copyright ⌐ 1997-1998 - Modelworks Software
- // @Modified build 225 cm19981007 - added readOnly infomation
- // @Modified build 237 cm19981118 - added include subdirectories infomation
- // @Modified build 337 cm20000112 - added title
- // @Modified build 480 cm20010115
- // @Modified build 483 cm20010128 - added support for working directory
-
- /**
- @Tool: projectInfo~displays information about a project and its
- packages in the Output panel. You should use this tool to see what
- is in your project and to diagnose project and package related problems.
- @EndTool:
- @Summary: projectInfo~displays information about a project
- */
-
- var gOutput = getOutput();
- var gOptions = getMapFile("JDKToolsStandardOptions"); //cm20010115
-
- function DoUpdate(cmdUI)
- {
- var project = getCurrentProject();
- cmdUI.enable(project != null)
- return true;
- }
-
- function DoCommand()
- {
- saveAll();
-
- var project = getCurrentProject();
-
- if (project)
- {
- gOutput.clear();
- gOutput.writeLine("Project Information");
-
- ListProjectWorkingDirectory(project);
- ReportCustomClassPaths();
-
- if (project.readOnly)
- {
- gOutput.writeLine("NOTE: Project is READ-ONLY");
- }
-
- var packageList = project.getPackageList();
- var position = packageList.getHeadPosition();
-
- if (!position.valid)
- {
- gOutput.writeLine("\nNo packages are included in this project");
- }
-
- while (position.valid)
- {
- ListPackageInfo(packageList.getNext(position));
- }
-
- gOutput.writeLine("\nReport completed");
- }
- else
- {
- alert("A project must be open before you get project info");
- }
- }
-
- function ListProjectWorkingDirectory(project)
- {
- var workingDirectory = project.getProperty("WorkingDirectory", "");
- if (workingDirectory != "")
- {
- gOutput.writeLine("Working Directory: " + workingDirectory);
- }
- else
- {
- gOutput.writeLine("Working Directory: <set to the directory containing the class file being run>");
- }
- }
-
-
- function ListPackageInfo(p)
- {
- if (p.name.length > 0)
- {
- gOutput.writeLine("Information for package " + p.name);
- }
- else
- {
- gOutput.writeLine("Information for package " + p.title); //cm20000112
- }
- gOutput.writeLine("Package type: " + p.packageType);
- gOutput.writeLine("Source path: " + p.sourcePath);
- gOutput.writeLine("Destination path: " + p.destinationPath);
- if (p.packageType == "Java")
- {
- gOutput.writeLine("Classpath: " + p.getJavaClassPath());
- }
- gOutput.writeLine("Include in build: " + p.includeInBuild);
- gOutput.writeLine("Auto-include files: " + p.autoInclude);
- gOutput.writeLine("Include subdirectories: " + p.includeSubdirectories);
- gOutput.writeLine("\nSource files list");
-
- var includedFileList = p.getFileList(false);
- var position = includedFileList.getHeadPosition();
- while (position.valid)
- {
- gOutput.writeLine(includedFileList.getNext(position).path);
- }
-
- gOutput.writeLine("Number of source files: " + includedFileList.count);
-
- gOutput.writeLine("\nDestination file list");
-
- var destinationFileList = p.getDestinationFileList();
- var position = destinationFileList.getHeadPosition();
- while (position.valid)
- {
- gOutput.writeLine(destinationFileList.getNext(position).path);
- }
- gOutput.writeLine("Number of destination files: " + destinationFileList.count);
-
- gOutput.writeLine("\nSource files needing building");
-
- var outOfDateFileList = p.getBuildFileList(true);
- var position = outOfDateFileList.getHeadPosition();
- while (position.valid)
- {
- gOutput.writeLine(outOfDateFileList.getNext(position).path);
- }
- gOutput.writeLine("Number of source files needing building: " + outOfDateFileList.count);
-
- gOutput.writeLine("\nExcluded file/directory list: ");
- // Write out excluded file list
- var excludedFileList = p.getFileList(true);
- var position = excludedFileList.getHeadPosition();
- while (position.valid)
- {
- gOutput.writeLine(excludedFileList.getNext(position).path);
- }
- gOutput.writeLine("\n----------------------");
- }
-
- function ReportCustomClassPaths() //cm20010115
- {
- var entry = gOptions.lookup("standardClasspaths", "");
- gOutput.writeLine("Standard Classpaths set to:\n\"" + entry + "\"");
-
- var entry = gOptions.lookup("customClasspaths", "");
- gOutput.writeLine("Custom Classpaths set to:\n\"" + entry + "\"");
-
- var entry = gOptions.lookup("bootClasspaths", "");
- gOutput.writeLine("Boot Classpaths set to:\n\"" + entry + "\"");
-
- gOutput.writeLine("\n----------------------");
- }
-
-
- !!/Script
-