Skip to content

Commit

Permalink
[PDE-Build] Use first supported version as default javac target/source
Browse files Browse the repository at this point in the history
Generalization of eclipse-pde#1351
  • Loading branch information
HannesWell committed Aug 6, 2024
1 parent 90a3dc1 commit 06d2646
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.p2.publisher.eclipse.FeatureEntry;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.service.resolver.HostSpecification;
import org.eclipse.osgi.service.resolver.State;
Expand Down Expand Up @@ -1067,10 +1068,12 @@ private void generateCompilerSettings() throws CoreException {
script.printProperty(PROPERTY_JAVAC_COMPILERARG, ""); //$NON-NLS-1$
script.printProperty(PROPERTY_PREREQ_COMPILE_LOG, Utils.getPropertyFormat(PROPERTY_BUILD_DIRECTORY) + "/prereqErrors.log"); //$NON-NLS-1$

if (javacSource == null)
script.printProperty(IXMLConstants.PROPERTY_JAVAC_SOURCE, "1.8"); //$NON-NLS-1$
if (javacTarget == null)
script.printProperty(IXMLConstants.PROPERTY_JAVAC_TARGET, "1.8"); //$NON-NLS-1$
if (javacSource == null) {
script.printProperty(IXMLConstants.PROPERTY_JAVAC_SOURCE, JavaCore.getAllJavaSourceVersionsSupportedByCompiler().first());
}
if (javacTarget == null) {
script.printProperty(IXMLConstants.PROPERTY_JAVAC_TARGET, JavaCore.getAllJavaSourceVersionsSupportedByCompiler().first());
}
if (bootClasspath == null) {
script.println("<condition property=\"dir_bootclasspath\" value=\"${java.home}/../Classes\">");//$NON-NLS-1$
script.println("\t<and>"); //$NON-NLS-1$
Expand Down

0 comments on commit 06d2646

Please sign in to comment.