Added build script and update minimum versions to Java 1.8

This commit is contained in:
Michael Pfaff 2022-01-05 13:50:35 -05:00
parent 2df01dd762
commit 229a1da41b
Signed by: michael
GPG Key ID: F1A27427218FCA77
14 changed files with 63 additions and 37 deletions

1
.tool-versions Normal file
View File

@ -0,0 +1 @@
java adoptopenjdk-8.0.302+8

15
Containerfile Normal file
View File

@ -0,0 +1,15 @@
FROM docker.io/alpine:edge
ARG JDK=openjdk17-jdk
ENV JDK=$JDK
RUN apk --no-cache add build-base ${JDK} wget bash ant git
COPY . /opt/lwjgl2
WORKDIR /opt/lwjgl2
RUN ant generate-all
RUN ant compile
RUN ant compile_native

View File

@ -39,7 +39,7 @@
<!-- <param name="al_version" value="0.1"> -->
<!-- Specify the minimum JRE version required by your applet, defaults to "1.5" -->
<!-- <param name="al_min_jre" value="1.6"> -->
<param name="al_min_jre" value="1.8">
<!-- background color to paint with, defaults to white -->
<!-- <param name="boxbgcolor" value="#000000"> -->

View File

@ -39,7 +39,7 @@
<!-- <param name="al_version" value="0.1"> -->
<!-- Specify the minimum JRE version required by your applet, defaults to "1.5" -->
<!-- <param name="al_min_jre" value="1.6"> -->
<param name="al_min_jre" value="1.8">
<!-- background color to paint with, defaults to white -->
<!-- <param name="boxbgcolor" value="#000000"> -->

10
build.sh Executable file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -e
ant generate-all
ant compile
ant compile_native

View File

@ -462,7 +462,7 @@
<!-- Compiles the Java source code -->
<target name="compile" description="Compiles the java source code" depends="-initialize">
<javac debug="yes" destdir="${lwjgl.bin}" source="1.5" target="1.5" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar:${lwjgl.lib}/asm-debug-all.jar" taskname="core">
<javac debug="yes" destdir="${lwjgl.bin}" source="1.8" target="1.8" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/AppleJavaExtensions.jar:${lwjgl.lib}/asm-debug-all.jar" taskname="core">
<!--<compilerarg value="-Xlint:unchecked"/>-->
<src path="${lwjgl.src}/java/"/>
<src path="${lwjgl.src}/generated/"/>
@ -475,8 +475,8 @@
<include name="org/lwjgl/util/**"/>
<exclude name="org/lwjgl/util/generator/**"/>
</javac>
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/test/**" source="1.5" target="1.5" taskname="test" />
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/examples/**" source="1.5" target="1.5" taskname="examples" />
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/test/**" source="1.8" target="1.8" taskname="test" />
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" includes="org/lwjgl/examples/**" source="1.8" target="1.8" taskname="examples" />
</target>
<target name="compile_native" depends="-initialize, headers, touch-version, version-mismatch" description="Compiles the native files">
@ -671,7 +671,7 @@
<!-- Creates the Javadoc -->
<target name="javadoc" description="Creates javadoc from java source code">
<javadoc destdir="${lwjgl.docs}/javadoc" classpath="${lwjgl.lib}/jinput.jar" author="true" version="true" use="true" source="1.5" windowtitle="LWJGL API" useexternalfile="true">
<javadoc destdir="${lwjgl.docs}/javadoc" classpath="${lwjgl.lib}/jinput.jar" author="true" version="true" use="true" source="1.8" windowtitle="LWJGL API" useexternalfile="true">
<fileset refid="lwjgl.javadoc.fileset" />
<doctitle><![CDATA[<h1>Lightweight Java Game Toolkit</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright &#169; 2002-2009 lwjgl.org. All Rights Reserved.</i>]]></bottom>

View File

@ -24,7 +24,7 @@
<mkdir dir="${lwjgl.src.native}/generated/opencl"/>
<mkdir dir="${lwjgl.bin}"/>
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" source="1.6" target="1.6" includes="org/lwjgl/util/generator/**.java" taskname="generator">
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" source="1.8" target="1.8" includes="org/lwjgl/util/generator/**.java" taskname="generator">
<include name="org/lwjgl/util/generator/openal/**.java"/>
<include name="org/lwjgl/util/generator/opengl/**.java"/>
<include name="org/lwjgl/util/generator/opengles/**.java"/>
@ -33,7 +33,7 @@
</javac>
<!-- Compile helper classes used by the templates -->
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" source="1.5" target="1.5" taskname="generator">
<javac debug="yes" srcdir="${lwjgl.src}/java/" destdir="${lwjgl.bin}" source="1.8" target="1.8" taskname="generator">
<include name="org/lwjgl/PointerWrapper.java"/>
<include name="org/lwjgl/PointerBuffer.java"/>
<!-- OpenGL -->
@ -69,7 +69,7 @@
<!-- Generate OpenAL -->
<target name="generate-openal" depends="generators" description="Generates java and native source for AL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.al}" fork="true" taskname="processor">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.al}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -91,7 +91,7 @@
<!-- Generate OpenAL [DEBUG] -->
<target name="generate-openal-debug" depends="generators" description="Generates java and native source for AL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.al}" fork="true" taskname="processor">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.al}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -120,7 +120,7 @@
<!-- Generate OpenGL -->
<target name="generate-opengl" depends="generators" description="Generates java and native source for GL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processorGL">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processorGL">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -143,7 +143,7 @@
<!-- Generate OpenGL [DEBUG] -->
<target name="generate-opengl-debug" depends="generators" description="Generates debug java and native source for GL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -167,7 +167,7 @@
<!-- Generate OpenGL references -->
<target name="generate-opengl-references" depends="generators" description="Generates java and native source for GL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.opengl.GLReferencesGeneratorProcessor"/>
@ -185,7 +185,7 @@
<!-- Generate OpenGL context capabilities -->
<target name="generate-opengl-capabilities" depends="generators" description="Generates java and native source for GL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.opengl.GLGeneratorProcessor"/>
@ -204,7 +204,7 @@
<!-- Generate OpenGL context capabilities [DEBUG] -->
<target name="generate-opengl-capabilities-debug" depends="generators" description="Generates debug java and native source for GL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.gl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.opengl.GLGeneratorProcessor"/>
@ -230,7 +230,7 @@
<!-- Generate OpenGL ES -->
<target name="generate-opengles" depends="generators" description="Generates java and native source for GL ES">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -253,7 +253,7 @@
<!-- Generate OpenGL ES [DEBUG] -->
<target name="generate-opengles-debug" depends="generators" description="Generates debug java and native source for GL ES">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -277,7 +277,7 @@
<!-- Generate OpenGL ES context capabilities -->
<target name="generate-opengles-capabilities" depends="generators" description="Generates java and native source for GL ES">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.opengl.GLESGeneratorProcessor"/>
@ -296,7 +296,7 @@
<!-- Generate OpenGL ES context capabilities [DEBUG] -->
<target name="generate-opengles-capabilities-debug" depends="generators" description="Generates debug java and native source for GL ES">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.gles}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.opengl.GLESGeneratorProcessor"/>
@ -322,7 +322,7 @@
<!-- Generate OpenCL -->
<target name="generate-opencl" depends="generators" description="Generates java and native source for CL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -345,7 +345,7 @@
<!-- Generate OpenCL [DEBUG] -->
<target name="generate-opencl-debug" depends="generators" description="Generates debug java and native source for CL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.GeneratorProcessor"/>
@ -369,7 +369,7 @@
<!-- Generate OpenCL capabilities -->
<target name="generate-opencl-capabilities" depends="generators" description="Generates capabilities for CL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.opencl.CLGeneratorProcessor"/>
@ -388,7 +388,7 @@
<!-- Generate OpenCL capabilities [DEBUG] -->
<target name="generate-opencl-capabilities-debug" depends="generators" description="Generates debug capabilities for CL">
<javac destdir="${lwjgl.bin}" source="1.6" target="1.6" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor">
<javac destdir="${lwjgl.bin}" source="1.8" target="1.8" srcdir="${lwjgl.src.templates.cl}" fork="true" taskname="processor">
<compilerarg value="-proc:only"/>
<compilerarg value="-processor"/>
<compilerarg value="org.lwjgl.util.generator.opencl.CLGeneratorProcessor"/>

View File

@ -134,7 +134,7 @@
<target name="-createmavenjavadocs">
<!-- Creates the Javadoc -->
<javadoc destdir="${lwjgl.dstMaven}/lwjgl-javadoc" classpath="${lwjgl.lib}/jinput.jar" author="true" version="true" use="true" source="1.5" windowtitle="LWJGL API" useexternalfile="true">
<javadoc destdir="${lwjgl.dstMaven}/lwjgl-javadoc" classpath="${lwjgl.lib}/jinput.jar" author="true" version="true" use="true" source="1.8" windowtitle="LWJGL API" useexternalfile="true">
<fileset refid="lwjgl-sources.manual.fileset"/>
<fileset refid="lwjgl-sources.generated.fileset"/>
<doctitle><![CDATA[<h1>Lightweight Java Game Toolkit</h1>]]></doctitle>
@ -144,7 +144,7 @@
<fileset dir="${lwjgl.dstMaven}/lwjgl-javadoc" />
</jar>
<javadoc destdir="${lwjgl.dstMaven}/lwjgl_util-javadoc" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/lwjgl.jar" author="true" version="true" use="true" source="1.5" windowtitle="LWJGL UTIL API" useexternalfile="true">
<javadoc destdir="${lwjgl.dstMaven}/lwjgl_util-javadoc" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/lwjgl.jar" author="true" version="true" use="true" source="1.8" windowtitle="LWJGL UTIL API" useexternalfile="true">
<fileset refid="lwjgl_util-sources.fileset"/>
<doctitle><![CDATA[<h1>Lightweight Java Game Toolkit</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright &#169; 2002-2010 lwjgl.org. All Rights Reserved.</i>]]></bottom>
@ -153,7 +153,7 @@
<fileset dir="${lwjgl.dstMaven}/lwjgl_util-javadoc" />
</jar>
<javadoc destdir="${lwjgl.dstMaven}/lwjgl_util_applet-javadoc" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/lwjgl.jar" author="true" version="true" use="true" source="1.5" windowtitle="LWJGL UTIL API" useexternalfile="true">
<javadoc destdir="${lwjgl.dstMaven}/lwjgl_util_applet-javadoc" classpath="${lwjgl.lib}/jinput.jar:${lwjgl.lib}/lwjgl.jar" author="true" version="true" use="true" source="1.8" windowtitle="LWJGL UTIL API" useexternalfile="true">
<fileset refid="lwjgl_util_applet-sources.fileset"/>
<doctitle><![CDATA[<h1>Lightweight Java Game Toolkit</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright &#169; 2002-2010 lwjgl.org. All Rights Reserved.</i>]]></bottom>
@ -208,4 +208,4 @@
<target name="-copymaventdist">
<zip destfile="${lwjgl.dist}/lwjgl-maven-${lwjgl.version}.zip" basedir="${lwjgl.temp}" includes="maven/**" />
</target>
</project>
</project>

View File

@ -124,7 +124,7 @@ import java.util.zip.ZipFile;
* reused if the version matches. If version doesn't match all of the files are reloaded.</li>
*
* <li>al_debug - [boolean] Whether to enable debug mode. <i>Default: false</i>.</li>
* <li>al_min_jre - [String] Specify the minimum jre version that the applet requires, should be in format like 1.6.0_24 or a subset like 1.6 <i>Default: 1.5</i>.</li>
* <li>al_min_jre - [String] Specify the minimum jre version that the applet requires, should be in format like 1.8.0_291-b10 or a subset like 1.8 <i>Default: 1.8</i>.</li>
* <li>al_prepend_host - [boolean] Whether to limit caching to this domain, disable if your applet is hosted on multiple domains and needs to share the cache. <i>Default: true</i>.</li>
* <li>al_lookup_threads - [int] Specify the number of concurrent threads to use to get file information before downloading. <i>Default: 1</i>.</li>
* <p>
@ -835,7 +835,7 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
// check JRE version meets minimum requirements
if (!isMinJREVersionAvailable()) {
minimumJreNotFound = true;
fatalErrorOccured("Java " + getStringParameter("al_min_jre", "1.5") + " or greater is required.", null);
fatalErrorOccured("Java " + getStringParameter("al_min_jre", "1.8") + " or greater is required.", null);
return;
}
@ -931,7 +931,7 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
* current JRE version.
*
* minimum requried JRE version is set using al_min_jre parameter, if not
* this is not set then the value will default to version 1.5
* this is not set then the value will default to version 1.8
*
* The minimumVersion should follow a structure such as x.x.x_x
* Example values would include 1.6.0_10 or a subset like 1.6.0 or 1.6
@ -944,10 +944,10 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
public boolean isMinJREVersionAvailable() throws Exception {
setState(STATE_CHECK_JRE_VERSION);
String minimumVersion = getStringParameter("al_min_jre", "1.5");
String minimumVersion = getStringParameter("al_min_jre", "1.8");
String javaVersion = System.getProperty("java.version");
// remove dash and anything after it (letters) from version string e.g. 1.5.0_01-ea
// remove dash and anything after it (letters) from version string e.g. 1.8.0_291-b10
minimumVersion = javaVersion.split("-")[0];
javaVersion = minimumVersion.split("-")[0];

View File

@ -51,7 +51,7 @@ import javax.tools.Diagnostic;
* @version $Revision$ $Id$
*/
@SupportedAnnotationTypes({ "*" })
@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedSourceVersion(SourceVersion.RELEASE_8)
@SupportedOptions({ "binpath", "typemap", "generatechecks", "contextspecific" })
public class GeneratorProcessor extends AbstractProcessor {

View File

@ -50,7 +50,7 @@ import javax.lang.model.util.ElementFilter;
* @author Spasi
*/
@SupportedAnnotationTypes({ "*" })
@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedSourceVersion(SourceVersion.RELEASE_8)
@SupportedOptions({ "generatechecks", "contextspecific" })
public class CLGeneratorProcessor extends AbstractProcessor {

View File

@ -50,7 +50,7 @@ import javax.lang.model.util.ElementFilter;
* 2010-04-09 23:57:40Z spasi $
*/
@SupportedAnnotationTypes({ "*" })
@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedSourceVersion(SourceVersion.RELEASE_8)
@SupportedOptions({ "contextspecific", "generatechecks" })
public class GLESGeneratorProcessor extends AbstractProcessor {

View File

@ -50,7 +50,7 @@ import javax.lang.model.util.ElementFilter;
* 2010-04-09 23:57:40Z spasi $
*/
@SupportedAnnotationTypes({ "*" })
@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedSourceVersion(SourceVersion.RELEASE_8)
@SupportedOptions({ "generatechecks", "contextspecific" })
public class GLGeneratorProcessor extends AbstractProcessor {

View File

@ -53,7 +53,7 @@ import javax.lang.model.util.ElementFilter;
* 2009-09-08 15:07:15Z spasi $
*/
@SupportedAnnotationTypes({ "*" })
@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedSourceVersion(SourceVersion.RELEASE_8)
@SupportedOptions({ "generatechecks", "contextspecific" })
public class GLReferencesGeneratorProcessor extends AbstractProcessor {