-
-
Notifications
You must be signed in to change notification settings - Fork 195
Building Maven Batch Compiler
This page details how to build and deploy the groovy-eclipse maven batch compiler. The old version of this information is here
The interesting components are in the /extras folder. There are several projects located here:
- groovy-eclipse-batch-builder : a set of ant scripts and configuration files used to build the groovy-eclipse-batch artifact; this artifact is an amalgamation of all jars required for compiling Groovy and Java code in Eclipse, including ecj (the Eclipse compiler for Java), the non-UI components of Groovy-Eclipse, the Groovy jars, and various required Eclipse bundles
- groovy-eclipse-compiler : the compiler plugin itself (an m2e project)
- groovy-eclipse-compiler-tests : integration tests for the groovy-eclipse-compiler
- groovy-eclipse-maven-tests : a sample project that uses the compiler plugin (an m2eclipse project)
- groovy-eclipse-quickstart : Archetype project for groovy-eclipse-compiler (not maintained)
- org.codehaus.groovy.m2eclipse : an Eclipse plugin that provides integration between Groovy-Eclipse and m2eclipse (the Maven tooling for Eclipse)
- Feature-org.codehaus.groovy.m2eclipse : an Eclipse feature that is required for building and releasing the org.codehaus.groovy.m2eclipse plugin
The build process relies on having a Eclipse workspace setup in which you successfully compiled Greclipse. The build will collect and jar-up compiled .class files from your workspace. See the project README.md for instructions on getting a workspace setup.
When you have your Greclipse workspace setup. Import these additional projects from the extras folder.
Import at least these 3 projects as 'existing projects' into your workspace:
- groovy-eclipse-compiler
- groovy-eclipse-batch-builder
- groovy-eclipse-compiler-tests
If you don't have m2e installed the groovy-eclipse-compiler project will have errors (because of missing dependencies).
You can install m2e, or ignore these errors since we will build groovy-eclipse-compiler using commandline maven.
Version numbers for both artifacts use a -01, -02, etc. as a suffix. This is because groovy-eclipse-compiler versions track groovy-eclipse releases, but sometimes off-cycle releases are required. Similarly, groovy-eclipse-batch follows Groovy compiler releases.
When a new Groovy version comes out, first the Groovy Eclipse Compiler itself has to be updated. The process for doing this is documented [here](Updating the groovy in groovy eclipse). We assume this has already been done.
Now, to change the Groovy version in the batch compiler artifact, the easiest way is to use text search to find references to the old version number (e.g. 2.3.12) and replace them with the new one (e.g. 2.3.13).
These places need changing:
- groovy-eclipse-batch-builder/build.properties (1 reference)
- groovy-eclipse-compiler-test: (2 references)
Open groovy-eclipse-batch-builder/build.properties follow the comments and change any values as needed. Make sure to point to a fresh copy of Eclipse that is the same version as the one you used to setup your workspace. This is not strictly necessary, but is safer.
Double-check your Groovy-Eclipse workspace. Perform a clean build. There should be no errors.
Check groovy-eclipse-batch-builder/build.xml. It has two references to jdt-patch/eXX folder. Make sure the eXX matches your version of Eclipse and that it is the folder containing the org.eclipse.jdt.core project you have imported into your workspace. This is crucial to make sure you will be packaging the bundle you actually compiled rather than something old and possibly broken.
Check version numbers for groovy-eclipse-batch and groovy-eclipse-compiler. Make sure they are SNAPSHOT versions or RELEASE versions as appropriate for your intended build.
You can use the extras/build-all.sh script. It will build both the groovy-eclipse-batch and groovy-eclipse-compiler, install both to maven local repo and then run a few tests using the locally deployed artifacts.
If the tests pass, inspect the output in extras/groovy-eclipse-compiler-tests/target. Double check that you are in fact running the tests with the intended new version of Groovy.