I am using JET to generate some java and xml files. Is there any way that I can access information about what has been generated and what has been updated?

As the developer I am now giving the model as input to a JET transformation but, since we want some kind of abstraction, this code generation technique will be used by several people and therefore I am thinking of using the generation technique as a plugin. When I give the model as input to JET I get info about what has happened in the console. This info would be of great interest! So the question is as below.

Is there any way for me to access code generation information when using JET code generation as a plugin?

Unfortunately, there is no public API for accessing the log information
that you see on the JET execution context.

But, if you're willing to take a risk on using internal classes, getting
at this information is pretty simple...

The class org.eclipse.jet.internal.runtime.RuntimeLoggerContextExtende r
is the logging intermediary between log messages issued by tags and any
listeners to this. Given a JET2Context object, you use the
getInstance(JET2Context) static method to obtain an instance.

Once you have a RuntimeLoggerContextExtender, you can use
addListener(RuntimeTagLogger) to add a listener to tag execution.

org.eclipse.jet.internal.runtime.RuntimeTagLogger is an interface with a
single log(String,TagInfo,String,int) method to implement. It is called
everytime a tag wants to log some message. The last argument (int level)
is one of the RuntimeLoggerContextExtender.XXX_LEVEL constants.

So, it should be possible for you to invoke a JET transformation from
API something like the following:

// load the source model, if necessary. Take a peek at the
// implementation of JET2Platform.runTransformOnString()
// or JET2Platform.runTransformOnResource() methods
// for inspiration

// construct a JET2Context
final JET2Context ctx = new JET2Context(inMemoryInputModelRoot);

// get and configure the RuntimeLoggerContextExtender
final RuntimeLoggerContextExtender logExt
= RuntimeLoggerContextExtender.getInstance(ctx);

This helped, though I had to do some changes in the example code to make it work it now produces a nice output. The log function works terrific but now I have a new problem. The JET transformation does not work anymore.

The error message keeps on going and none of the tags in main.jet seems to work. I am using the code sent to me to run runTransform so nothing is wrong there. I belive there are some issues with the model sent to runTransform. It works without the the log part but by using runTransformationOnReference instead. Are there any known problems with using runTransform because I can't seem to find the problem

The org.eclipse.jet.resource.project.name typically gets set by
JET2Platform.runTransformOnResource(). Of course, you have had to bypass
this. But, all is not lost, the actual work of loading the IResource and
setting all those variables is delegated to another public static function: