Skip to content

Commit

Permalink
Migrate to Java 21. Move the "gcd" operator to PsyRational. Update API
Browse files Browse the repository at this point in the history
documentation.
  • Loading branch information
urbic committed Sep 9, 2024
1 parent 7655462 commit 39f542e
Show file tree
Hide file tree
Showing 30 changed files with 594 additions and 455 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
libjline-java{,-doc} \
libxerces2-java \
libxslthl-java \
openjdk-17-{jdk-headless,doc} \
openjdk-21-{jdk-headless,doc} \
python3-m2crypto \
osc \
sassc
Expand All @@ -40,7 +40,7 @@ jobs:
git config tar.tar.xz.command 'xz -9'
- name: Build
env:
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
JAVA_HOME: /usr/lib/jvm/java-21-openjdk-amd64
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ant -lib /usr/share/java/xercesImpl.jar:/usr/share/java/ivy.jar:/usr/share/java/junit4.jar \
Expand All @@ -54,7 +54,7 @@ jobs:
>target/doc/index.xhtml
- name: Test
env:
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
JAVA_HOME: /usr/lib/jvm/java-21-openjdk-amd64
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ant -lib /usr/share/java/ivy.jar:/usr/share/java/junit4.jar \
Expand All @@ -68,7 +68,7 @@ jobs:
FOLDER: target/doc
- name: Commit to OBS
env:
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
JAVA_HOME: /usr/lib/jvm/java-21-openjdk-amd64
OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }}
run: |
ant -lib /usr/share/java/ivy.jar -v -noinput -Dlinux.flavour=debian obs.commit
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
libjline-java{,-doc} \
libxerces2-java \
libxslthl-java \
openjdk-17-{jdk-headless,doc} \
openjdk-21-{jdk-headless,doc} \
- name: Setup
run: |
git config tar.tar.xz.command 'xz -9'
- name: Deploy package
env:
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
JAVA_HOME: /usr/lib/jvm/java-21-openjdk-amd64
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ant -lib /usr/share/java/xercesImpl.jar:/usr/share/java/ivy.jar:/usr/share/java/junit4.jar \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN zypper -n --gpg-auto-import-keys in -y \
ant{,-apache-resolver,-junit} \
ivy \
ivy-local \
'java-devel>=17' \
'java-devel>=21' \
javacc \
javapackages-tools \
docbook5-xsl-stylesheets \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ More sample programs can be found in the dedicated

### Jar:

Java 17 (OpenJDK or Oracle JDK), JavaCC, Apache Ant, Apache Ivy, JUnit 4, JLine 1
Java 21 (OpenJDK or Oracle JDK), JavaCC, Apache Ant, Apache Ivy, JUnit 4, JLine 1

### Documentation:

Expand Down
32 changes: 30 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<property name="file.encoding" value="UTF-8"/>
<property name="linux.flavour" value="redhat"/>
<property name="build.sysclasspath" value="ignore"/>
<property name="java.release" value="17"/>
<property name="java.release" value="21"/>
<!--property name="ivy.cache.ttl.default" value="eternal"/-->

<property file="${src.ant}/ivy.properties"/>
Expand Down Expand Up @@ -183,6 +183,7 @@
<compilerarg value="-XprintProcessorInfo"/>
<compilerarg value="-Xprefer:source"/>
<compilerarg value="-Xlint:deprecation"/>
<!--compilerarg value="-Xlint:unchecked"/-->
<compilerarg
value="-Aconeforest.psylla.tools.processors.TypeMetadataCollector.metadataDir=${target.classes}/${project.moduleprefix}/META-INF/${project.name}"/>
<compilerarg value="-Aconeforest.psylla.tools.processors.TypeHierarchyBuilder.outputDir=${target.dot}"/>
Expand Down Expand Up @@ -225,7 +226,7 @@
<arg value="--add-reads=${project.moduleprefix}.tools=ALL-UNNAMED"/>
<!--arg value="-Xdoclint:missing,reference,syntax"/-->
<arg value="-Xdoclint:all"/>
<arg value="-Xdoclint/package:-${project.moduleprefix}.runtime"/>
<arg value="-Xdoclint/package:-${project.moduleprefix}.runtime.parser"/>
<arg value="-Xmaxwarns"/>
<arg value="1000"/>
<link href="file://${config.javadocdir.java}"/>
Expand Down Expand Up @@ -428,4 +429,31 @@
/>
</target>

<target name="spotbugs"
depends="jar"
>
<taskdef resource="edu/umd/cs/findbugs/anttask/tasks.properties"/>
<!-- home="/usr/share/spotbugs" -->
<spotbugs
home="spotbugs-4.8.5"
output="html"
effort="max"
outputFile="SPOTBUGS.html"
stylesheet="fancy.xsl"
debug="true"
>
<!--sourcepath refid="modulesourcepath.main"/-->
<sourcepath location="src/main/java/coneforest.psylla"/>
<!--sourcepath>
<path refid="modulesourcepath.main"/>
</sourcepath-->
<auxClasspath>
<pathelement location="/usr/share/java/coneforest.clianthus.jar"/>
<pathelement location="/usr/share/java/jline/jline.jar"/>
</auxClasspath>
<class
location="${target.artifacts}/jar/${project.moduleprefix}-${project.version}.jar"/>
</spotbugs>
</target>

</project>
8 changes: 4 additions & 4 deletions src/doc/docbook/PsyllaReference_Installation.docbook
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Build Service</link>.

<itemizedlist>

<listitem><application>Java 17</application> (<application
<listitem><application>Java 21</application> (<application
xlink:href="https://openjdk.java.net/">OpenJDK</application> or <application
xlink:href="https://www.oracle.com/java/technologies/javase-downloads.html">Oracle
JDK</application>)</listitem>
Expand Down Expand Up @@ -71,10 +71,10 @@ xlink:href="https://github.com/sass/sassc/">SassC</application>
</itemizedlist>

<para>
To install dependencies, run (<productname>openSUSE Leap 15.5</productname>)
To install dependencies, run (<productname>openSUSE Leap 15.6</productname>)

<screen><prompt>% </prompt><userinput>sudo zypper -n --gpg-auto-import-keys ar -p1 \
obs://home:urbic:coneforest/15.5 home:urbic:coneforest</userinput>
obs://home:urbic:coneforest/15.6 home:urbic:coneforest</userinput>
<prompt>% </prompt><userinput>sudo zypper -n --gpg-auto-import-keys in -y \
ant{,-apache-resolver,-junit} javacc jline1 \
docbook5-xsl-stylesheets docbook-xsl-saxon graphviz sassc saxon6 \
Expand All @@ -85,7 +85,7 @@ or (<productname>Debian 11</productname>)
<screen><prompt>% </prompt><userinput>sudo apt-get install -y \
ant{,-optional} docbook-{xsl-{ns,saxon},mathml} \
graphviz sassc javacc junit4 libjline-java{,-doc} libxerces2-java \
libxslthl-java openjdk-17-{jdk-headless,doc}</userinput></screen>
libxslthl-java openjdk-21-{jdk-headless,doc}</userinput></screen>
</para>

</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Returns the greatest common divisor of two <replaceable>number</replaceable>s.
<replaceable>number<subscript>1</subscript></replaceable>,
<replaceable>number<subscript>1</subscript></replaceable>,
<replaceable>result</replaceable>:
<xref xrefstyle="template:%t" linkend="PsyllaReference_Types_Details_integral"/>
<xref xrefstyle="template:%t" linkend="PsyllaReference_Types_Details_rational"/>
</listitem>
</itemizedlist>
</formalpara>
Expand All @@ -39,10 +39,6 @@ Returns the greatest common divisor of two <replaceable>number</replaceable>s.
&TitleErrors;
<itemizedlist>
<listitem>
<xref xrefstyle="template:%t" linkend="PsyllaReference_Errors_Details_rangecheck"/> —
when the at least one of the <replaceable>number</replaceable>s is negative
</listitem>
<listitem>
<xref xrefstyle="template:%t" linkend="PsyllaReference_Errors_Details_stackunderflow"/> —
&ErrorReason_stackunderflow;
</listitem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ signs.
<itemizedlist>
<listitem>
<replaceable>dividend</replaceable>,
<replaceable>divisor</replaceable>,
<replaceable>divisor</replaceable>:
<xref xrefstyle="template:%t" linkend="PsyllaReference_Types_Details_rational"/>
</listitem>
<listitem>
<replaceable>quotient</replaceable>:
<xref xrefstyle="template:%t" linkend="PsyllaReference_Types_Details_integral"/>
</listitem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,6 @@ Returns the multiplicative <replaceable>inverse</replaceable> of the
<replaceable>number</replaceable>.
</para>

<!--para>
For <xref xrefstyle="template:%t"
linkend="PsyllaReference_Types_Details_integer"/>
<replaceable>number</replaceable> the type of a
<replaceable>negation</replaceable> is also <xref xrefstyle="template:%t"
linkend="PsyllaReference_Types_Details_integer"/>, unless a
<replaceable>number</replaceable> is <constant>-9223372036854775808</constant>,
then the type of a <replaceable>negation</replaceable> is <xref
xrefstyle="template:%t" linkend="PsyllaReference_Types_Details_biginteger"/>.
For <xref xrefstyle="template:%t"
linkend="PsyllaReference_Types_Details_real"/> or <xref xrefstyle="template:%t"
linkend="PsyllaReference_Types_Details_complex"/>
<replaceable>number</replaceable> the type of a
<replaceable>negation</replaceable> is the same.
</para-->

<formalpara>
&TitleSynopsis;
<synopsis>
Expand All @@ -48,8 +32,20 @@ linkend="PsyllaReference_Types_Details_complex"/>
&TitleExamples;
<programlisting language="psylla">4 reciprocal
▶ 1:4
0 reciprocal
▶ <xref xrefstyle="template:%t" linkend="PsyllaReference_Errors_Details_undefinedresult"/>
-2 3 div reciprocal
▶ -3:2
-4. reciprocal
▶ -0.25
-0. reciprocal
▶ -∞
0. reciprocal
▶ ∞
-∞ reciprocal
▶ -0.0
∞ reciprocal
▶ 0.0
3 4 complex reciprocal
▶ 0.12-0.16i</programlisting>
</formalpara>
Expand All @@ -66,8 +62,10 @@ linkend="PsyllaReference_Types_Details_complex"/>
&ErrorReason_typecheck;
</listitem>
<listitem>
<xref xrefstyle="template:%t" linkend="PsyllaReference_Errors_Details_undefinedresult"/> —
when the <replaceable>number</replaceable> is zero
<xref xrefstyle="template:%t"
linkend="PsyllaReference_Errors_Details_undefinedresult"/> — when the <xref
xrefstyle="template:%t" linkend="PsyllaReference_Types_Details_rational"/>
<replaceable>number</replaceable> is zero
</listitem>
</itemizedlist>
</formalpara>
Expand All @@ -80,6 +78,7 @@ when the <replaceable>number</replaceable> is zero
<formalpara>
&TitleSeeAlso;
<xref xrefstyle="template:%t" linkend="PsyllaReference_Operators_Details_div"/>,
<xref xrefstyle="template:%t" linkend="PsyllaReference_Operators_Details_idiv"/>,
<xref xrefstyle="template:%t" linkend="PsyllaReference_Operators_Details_mul"/>.
</formalpara>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* The Psylla Ant tasks.
*/
package coneforest.psylla.tools.ant;
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import javax.tools.Diagnostic;

@SupportedAnnotationTypes({"coneforest.psylla.runtime.Type"})
@SupportedSourceVersion(SourceVersion.RELEASE_17)
@SupportedSourceVersion(SourceVersion.RELEASE_21)
public class TypeHierarchyBuilder
extends AbstractProcessor
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
@SupportedAnnotationTypes({"coneforest.psylla.runtime.Type",
"coneforest.psylla.runtime.ErrorType",
"coneforest.psylla.runtime.OperatorType"})
@SupportedSourceVersion(SourceVersion.RELEASE_17)
@SupportedSourceVersion(SourceVersion.RELEASE_21)
public class TypeMetadataCollector
extends AbstractProcessor
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* The Psylla annotation processors.
*/
package coneforest.psylla.tools.processors;
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ public int intValue()
}

@Override
public PsyBoolean psyIsZero()
public boolean isZero()
{
return PsyBoolean.FALSE;
return false;
}

@Override
Expand Down
Loading

0 comments on commit 39f542e

Please sign in to comment.