Project

General

Profile

Feature #1570

create a build.xml ANT script to properly build the chemtutor.jar for the chemtutor project

Added by Greg Shah almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Costin Savin
Target version:
-
Start date:
09/24/2012
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
version_reported:
version_resolved:

History

#1 Updated by Greg Shah almost 12 years ago

The chemtutor 4GL demo project can be checked out from Bazaar. It resides in /opt/code/p2j_repo/samples/chemtutor/. That project currently will convert usign the cvt.sh script. But it needs to build a proper jar file. That jar should include all DTD, dmo index file, name_map.xml and other required bits in addition to the converted .class files.

Please look carefully at the "Building Converted Code" chapter in the P2J Conversion Handbook. You may also look at the TIMCO build.xml file. Between the 2, you should have enough to write a good basic build.xml that will do the job. Please keep the same general directory structure (as with the TIMCO ANT script) for the result.

#2 Updated by Costin Savin almost 12 years ago

  • Status changed from New to WIP

#3 Updated by Greg Shah over 11 years ago

For the chemtutor application, there is no need for the separate jar for the UI stuff. Please modify the build.xml to place all converted app code in a single chemtutor.jar.

#4 Updated by Costin Savin over 11 years ago

Important build script tasks:

convert - this will convert the chemtutor progress source code to java
create.db - creates the database from schema
import.db - inserts
init.db - this will call building and filling of the h2 database and will index the h2 database. The database file is put inside /deploy-chemtutor/db
jar - this creates the chemtutor.jar under /build/lib from the converted source code.
p2j-jar - this will call the jar target from the p2j project which will build all the jars from p2j project
p2j-deploy-exclude-testcases this builds the p2j.jar excluding the com.goldencode.testcases package which conflicts with the ones from chemtutor.jar
deploy - this will copy chemtutor.jar, the necessary files from p2j project and the p2j.jar which doesn't contain the testcases package to /deploy-chemtutor/lib , it also calls the database.init.db
dist - this will call deploy.chemtutor and archives the chemtutor-deploy directory contents to chemtutor${timestamp}.tar inside the distribution directory

#5 Updated by Greg Shah over 11 years ago

This is a very good start.

Some things to add/change:

1. Please rename the "ctconvert" target to just "convert". The idea here is that this example will very likely be used as the basis for many projects, so we should make it generic unless there is a really good reason not to do so. Also change "deploy.chemtutor" to just "deploy" for the same reason.

2. Please change "build.db" to "create.db", "fill.db" to "import.db" and "deploy.init.db" to "init.db". I think these names are better aligned with our terminology.

3. Change the package to "com.goldencode.chemtutor" instead of "com.goldencode.testcases". Along with this change, please ensure that all the converted code will be generated into a chemtutor/src/ directory tree AND that it will build inside a chemtutor/build/ tree. From a compilation perspective, I want this completely separate from the p2j/ project (except for the fact that the p2j/ link must be there and all the P2J jars must be there...). In other words, it should look just like any other "customer" project, except it will happen to have the same root package com.goldencode (which is fine). I assume this means you can eliminate the p2j-deploy-exclude-testcases target.

4. If I understand it correctly, there is no longer a need for the cvt.sh (since the ctconvert target is equivalent). If so, please remove the cvt.sh.

5. Please look at the cleanup.sh and create an equivalent target (named "cleanup") in the build.xml to replace it. Then delete the cleanup.sh from the project.

6. What do you think about adding a test in the build.xml to check for the p2j/ directory and if it is not there to at least inform the user that one needs to be created?

#6 Updated by Costin Savin over 11 years ago

Is there an option when calling ConversionDriver to change the output package from the default testcases?Looked for it inside the Developer guide and ConversionDriver javadoc maybe I missed it.

#7 Updated by Constantin Asofiei over 11 years ago

Costin,

Look in the p2j.cfg.xml file - the pkgroot parameter sets the root package of the converted files.

#8 Updated by Greg Shah over 11 years ago

Can p2j-deploy-exclude-testcases be removed from build.xml now? I assume so, since that was the idea of putting chemtutor in its own directory. Please remove it if possible. Otherwise let me know what the remaining dependency is.

#9 Updated by Costin Savin over 11 years ago

Removed this task and used the p2j.jar that includes testcases directory instead

#10 Updated by Greg Shah over 11 years ago

  • Status changed from WIP to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF