Jump to content
Excelsior Forums
chr1s

compilation and packaging automation

Recommended Posts

I am trying to integrate JET compilation and packaging in our mixed Maven/Ant build environment.  I have a couple of questions:

1) in .prj files, is it possible to define classpathentries for all jar files in a given dir?

For example, I have a jar file with my own code and a lib dir with third party dependencies, can I just add all the jar files in that directory to the compilation classpath? This saves me some maintenance. Of course, I can generate a temporary prj file on demand, but it is easier if I can define this loop in the compiler script itself.

2) .jpn files are an altogether different story: they contain a lot of references to jar files and also a lot of hardcoded absolute paths that I wasn't able to turn into relative paths. It feels as if this file format wasn't meant to be modified manually.

I noticed that when, instead of launching JetPackII from inside the Jet Control Panel, you start a new JetPackII project and give it the compiled exe, it can still generate this jpn file with information about all the jars used, even though all code from all jars are fully compiled into the exe. Apparently, all that info is already in the exe, it is not passed by the Control Panel.

Therefore, is it possible to *generate* the jpn file from the .exe on the commandline?

This would let me fully automate the process and be able to run it on a different machine without modifications.

Share this post


Link to post
Share on other sites

Hi, thank you for your inquiry.

>>1) in .prj files, is it possible to define classpathentries for all jar files in a given dir?

At present It is not possible to do with the JET Control Panel. There is a non-documented option that can be used for this goal. However if you use it, you won't be able to open a project with GUI interface and you will need to modify it manually. So I would recommend you to create a project with the JET Control Panel first and then add the following lines

+nolaunchpad

!batch *jar <Directory Name>

where <Directory name> contains the jars to be compiled.

May I ask you, do you plan to change the content of this directory or do you need to create it once?

2) You are right, JetPackII projects should not be modified manually.

>>Therefore, is it possible to *generate* the jpn file from the .exe on the commandline?

No. The compiled application doesn't  contain the full information for deployment.

>>This would let me fully automate the process and be able to run it on a different machine without modifications.

If you create a JetPackII project with all the paths relative to the root directory, then you will be able to build this project on any machine with the same folder structure. What modifications do you mean?

Share this post


Link to post
Share on other sites

>>  There is a non-documented option that can be used for this goal.

The suggested approach works perfectly! Now, my .prj file no longer contains any references to the jars, which is exactly what I want.

>> May I ask you, do you plan to change the content of this directory or do you need to create it once?

The contents of the dir changes over time, though not very frequently. Just a collection of tens of third party dependencies that are updated and extended now and then.

Right now it is a collection of jar files that have been statically checked into our source code repository, but once we integrate the JET compilation with the rest of our Maven-based build system, the dir with dependencies is determined by that system at compile time. So the less I have to meddle with JET project files, the better.

>> If you create a JetPackII project with all the paths relative to the root directory, then you will be able to build this project on any machine with the same folder structure. What modifications do you mean?

I have been able to turn all paths into relative paths. "Without modifications" means that I can relocate my source code without breaking the project files. This is important as we frequently create branches of our code.

Still, I make a temporary copy of the .jpn file that I remove afterwards, as xpack does alter its contents slightly (some last modification dates if I recall correctly).

Also, the file contains a lot of references to the jar files that I use, so I probably have to regenerate it once my dependencies change. I see no way to update the file automatically.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×