USEPA / emf

Emissions Modeling Framework (EMF)
6 stars 3 forks source link

consistency of Java versions in build scripts #117

Open cseppan opened 2 years ago

cseppan commented 2 years ago

When building the EMF for release, I've used the EMF/build.xml file and run the following ant targets:

analysisengine-dist: runs the "do-dist" target in the AnalysisEngine/build.xml file commons-dist: runs the "do-dist" target in the Commons/build.xml file 'client-dist(only jar)' app-dist 'client-installer(only jar)'

The EMF/build.xml file sets the properties

<property name="ant.build.javac.target" value="1.7" />
<property name="ant.build.javac.source" value="1.7" />

This generates class files compatible with Java 7 or newer. However, these properties only take effect for the build products directly generated from the EMF/build.xml file not the AnalysisEngine or Commons.

In the Commons/build.xml file, the do-dist target eventually gets to the "do-compile-src" target which has an ant javac task explicitly setting '<javac ... target="1.7" source="1.7" />' so the epa-commons.jar file is also compatible with Java 7 or newer. Note that the "do-compile-tests" target in Commons/build.xml doesn't set the target or source parameters for the javac task.

The AnalysisEngine/build.xml file doesn't set any targeted Java version so the generated jar file is dependent on whatever version of Java was used to build it. So far, I've been using Java 8 for building EMF releases.

As of EMF v3.3, the EMF requires Java 8 or higher, so there shouldn't be a need to target Java 7 in the build products.