The BTool Java Build Tool is a tool that can be used to run emitters, compile, or install an application. Tools can be easily added to the toolbench by editing the 'BTool.tools file'. BTool works with both Java JDK 1.0.2 and JDK 1.1.1.
There are two groups of tools. Those that run at build time, and those that run at install.
If no tools are selected for a file, then the Java compiler is called to compile .java files.
The BTool Java Build Tool can be run as a GUI or a command line tool. First your CLASSPATH must include the directory where the tool is installed. If it is installed in 'C:\JIE_Toolkit', then add that to your path. This implies that the toolbench is located in directory 'C:\Toolkit\COM\ibm\btool\'.
To run the GUI, enter:
java COM.ibm.btool.BTool
To run as a command line tool, enter
java COM.ibm.btool.BTool project.proj <all> <toolset>
where:
- 'project.proj' is the emitter project file
- 'all' is included to force the emitting and compiling of all files in the project. The default is to execute only the tools that need to be. This is an optional parameter.
- 'toolset' is the set of tools to be used. This can be either 'Build' or 'Install'. The default is 'Build'. This is an optional parameter.
You can also generate Internet Inter-ORB Protocol Stubs and Skeletons for a single .class file from the command line by entering
java COM.ibm.btool.BTool file.class
where:
- 'file.class' is the name of the class file to generate Stubs and Skeletons for
Menu:
File
New
- Create a new project
Open... - Open an
existing project (default is *.proj)
Save
- Save current project
Save As... - Save project to a new name
Options... - Set options (displays Options
Dialog)
Exit
- Exit program
Action
Add
- Add a file to the project (displays the Add Dialog).
Remove -
Remove the highlighted file from the project.
Generate - Generate
or emit java source code for items checked.
This action checks date of files and generates and compiles only if necessary.
Generate All - Generate or emit all java source
code for items regardless of dates checked.
Tools
Build
- Selects the Build tools
Install - Selects
the Install tools
Window
Output Window - Show the output window
Help
Help
- Shows this help file
About... - Shows About
Dialog
| Project Files | List of files that will be processed. |
| Add... | Add files to project. |
| Remove | Remove highlighted file from project list. |
| Generate Code | This shows what emitters will be run for the file specified (highlighted file). The emitters are individually set for each file in the list. |
| Generate | Generate code for all files in list. The last modified date of the files are used to determine if the emitter should be run and the files should be compiled. (To generate everything, choose 'Generate All' from the menu.) When this is pressed, the project is automatically saved to disk. If no project is created yet, then it is saved as 'New.proj |
| Toolbar Up | Moves the selected file up one line in the list. The emitter tool emits and compiles the files in the order of the list. If one file depends upon another, then the pre-requisite file should be higher in the list. |
| Toolbar Down | Moves the selected file down one line in the list. |
| Java Compiler Program | Name of the compiler to be used. This program needs to be in your PATH or it must be fully specified. This can be used by a tool by using %JAVAC% |
| Java Interpreter Program | Name of the interpreter to be used for running the emitters. This program needs to be in your PATH or it must be fully specified. This can be used by a tool by using %JAVA%. |
| Copy Program | Name of the program to be used to copy files. If this is blank, then BTool will use its own copy program. |
| DOCS Directory | This is the directory where your web server DOCS directory is. This can be used by a tool by using %DOCS%. |
| APPLETS Directory | This is the directory where your web server APPLETS directory is. This can be used by a tool by using %APPLETS%. |
| Directory 1 | This is an extra directory that a tool can by a tool by using %DIR1%. |
| Directory 2 | This is an extra directory that a tool can by a tool by using %DIR2%. |
These options are saved in the 'BTool.options' file. A project can have
its own .options file. BTool looks for a file with the same name as the
project file, but with .options instead of .proj. If it exists, then this
is loaded instead of BTool.options.
| Java and Class Files | This is a list of all .java and .class files in the current directory. There is also a list of directories. The directory can be changed by double-clicking on a directory entry. Files are selected by single-clicking on them. This is a multi-selection listbox. For the build tool, the default extension is .java and .class. If this is the install tool, then this lists all files. |
| Directory | This is the current directory in the list. It can be changed by double-clicking on the list or by typing in a new directory and pressing <Enter>. You can change drives by entering a new 'drive:\directory'. You can enter wildcards such as 'D:\JIE_Toolkit\COM\ibm\*.java *.class *.bat' which will show all .java, .class, .bat files. |
| Generate Code For | This is the list of tools to run for all of the files selected in the files list. |
| Add | This adds the selected files to the project files list on the Main Screen. All files will be added with the 'Generate Code For' settings. To specify different settings for different files, the files must be added separately, or be individually changed using the Main Screen 'Generate Code' checkboxes. |
| Select All | This selects all of the files in the list. |
The output window is displayed when a 'Generate' is performed. This
shows the status and results of the emit and compile processes. The window
is displayed for both the GUI and command line version.
The BTool.tools file defines the tools that are available for the 'Build' and 'Install' toolgroups. A project can have its own .tools file. BTool looks for a file with the same name as the project file, but with .tools instead of .proj. If it exists, then this is loaded instead of BTool.tools.
An example file follows:
// BTool.tools // // format: String t Type = Build, Install // String n Name // String c Comment // String d emitter or install depends upon this file (can have // zero or more dependencies) // String q emitter or install conditionally depends upon this file // (run the tool only if the file exists) (can have // zero or more dependencies) // String e file generated by tool // String p path to put generated file into // String x execute string // // variables: %JAVAC% = java compiler // %JAVA% = interpreter // %PACKAGE% = java class package name // %DIR% = directory of the file in the project file listbox // %FILEWITHOUTBASE% = file name without the sufix of "Base" // %FILE% = file name // %EXT% = file name extension // %|% = file separator // %CLASSPATH% = classpath environment variable // %PROGRAMCLASSPATH% = classpath directory where this program is running // %COPY% = copy srcfile destfile // %COPYALWAYS% = always copy srcfile destfile without regard to dates // %DOCS% = Web server DOCS directory // %APPLETS% = Web server APPLETS directory // %DIR1% = directory 1 // %DIR2% = directory 2 // %MKDIR% = make directory // %DEL% = delete directory (doesn't remove directory, but // deletes all files in all subdirectories), or deletes file // %OS_Operating system returned from os.name% // %RUNBUILD% = runs build tool for the project file // %RUNINSTALL% = runs install tool for the project file // // NOTE: build and install can't have the same tool name // // NOTE: It is assumed that a file that ends with "Base" is an // input file for BTool from which all of the other // files can be generated. For example, the programmer // would write "AirportBase.java". From this, the interface // and Impl files could be generate. Once these files are // available, the 'Base' file is no longer needed. // // The reason for using the "Base" file is to have the // programmer put all his code in one file. This simplifies // the emitters by removing the need to worry about updating // a file that has user-entered code in it. // // If a change to the "Base" file does not change method definitions, // then the interface does not have to be re-emitted. // // As an example: // // If the specified file is "AirportBase.java", then // // %DIR% = "C:\Toolkit\COM\ibm\jaws\models\trs" // %PDIR% = "COM\ibm\jaws\models\trs" // %PACKAGE% = "COM.ibm.jaws.models.trs" // %FILE% = "AirportBase" // %FILEWITHOUTBASE% = "Airport" // %EXT% = "java" // // If the specified file is "Car.class", then // // %DIR% = "C:\Toolkit\COM\ibm\jaws\models\trs" // %PDIR% = "COM\ibm\jaws\models\trs" // %PACKAGE% = "COM.ibm.jaws.models.trs" // %FILE% = "CarBase" // %FILEWITHOUTBASE% = "Car" // %EXT% = "class" // // // Stub Tool // t Build n Stub c Stub // compile interface file if it exists and isn't up-to-date x %JAVAC% %DIR%%FILEWITHOUTBASE%.java q %DIR%%FILEWITHOUTBASE%.java p %DIR% e %FILEWITHOUTBASE%.class // run stub emitter x %JAVA% COM.ibm.jaws.tools.emit.RunStubEmitter %PACKAGE%%FILEWITHOUTBASE% d %DIR%%FILEWITHOUTBASE%.class p %DIR% e %FILEWITHOUTBASE%Stub.java // compile emitted file x %JAVAC% %DIR%%FILEWITHOUTBASE%Stub.java d %DIR%%FILEWITHOUTBASE%Stub.java p %DIR% e %FILEWITHOUTBASE%Stub.class // // Install in Docs // t Install n Docs Directory x %COPY% %DIR%%FILE% %DOCS%%FILE% // // Install in Applets // t Install n Applets Directory x %COPY% %DIR%%FILE% %APPLETS%%FILE% // // Generic Tool // t Build n Net Use x net use // // Generic Tool // Note: Can't use the same tool name, even if one is for "Build" and // the other is for "Install". // t Install n Another Net Use x net use
1. If the 'Output Window' is minimized, then it is not maximized for a 'Generate' or 'Window -> Output Window' menu operation. You must click on the icon to maximize it.
2. There is a problem on Win95 that prevents the root directory of a drive from returning a file list.
3. If the 'Output Window' is resized while a tool is running, the listbox size isn't adjusted until after a print is performed to the window.
4. The 'Output Window' maximum size can be reached. After this, any other prints to this window won't be seen.
5. If you want to use your own .options file, it needs to be created before you create a new .proj file. Then, when creating the .proj file, it must be saved with the same name as the options file. The .proj file must then be reloaded to pickup the options for that file.