RSS

 
WinEdt Macro Library  | program previous macro  | next macro

compilePrj

If you are using WinEdt version 5.3, you should use this version.

Description

This macro checks, which files of a Java Project have been edited since the last compilation, and then calls the javac compiler only for these files.

The macro presupposes two things:

  • You have built a Project Tree.
    This is possible, if you define an Include Directive (in Options | Preferences | Input) that you put in the Java files.
    (I use //include{?} )
    The main file has be set (Project | Set Main File).
  • You need a file %B\bin\javac.bat that calls the Java Compiler.
    It should contain at least the following line:
    javac %1
    

Installation

Put the file in %B\Macros\program\ and make a Menu Item (Macro) in Options | Menu Setup:

Exe("%B\Macros\program\compilePrj.edt")

Options

Under WinEdt 9x, where it is not possible to redirect error messages from stderr to a file, you can use the program errout.exehttp://www.horstmann.com/corejava/faq.html ) to achieve such redirection (i.e. to produce a log file). To do so, put errout.exe in a folder where Windows finds it and put something like the line

errout javac -g -verbose %1 > %2

in %B\Bin\javac.bat. You then have to change in compilePrj.edt the lines that call the compiler to this:

Run(''%B\bin\javac.bat ""%n.java"" ""%n.log""'')

Download

program/compilePrj.edt

Macro contributed by Robert <w.m.lgmx.net>

WinEdt Macro Library  | program previous macro  | next macro