A library used for teaching computer science in the ISC degree programme, notably for the course 101.1 Imperative programming.
The documentation is available here. It is automatically built and published each time a new version tag is added to the repo.
This library has been developed orginally by P.-A. Mudry for the PImp and inf1 courses given at the School of engineering HES-SO Valais//Wallis.
If a program using the library fails with java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable, the Java X11 toolkit cannot reach a display. Recent versions of the library print a diagnosis with the probable cause on the standard error output. The usual cases are:
- IntelliJ IDEA installed as a Flatpak (the default on Fedora): the IDE runs natively on Wayland but its sandbox only has
fallback-x11access, so programs launched from it cannot open an X11 window. Give it X11 access once and restart the IDE:(useflatpak override --user --socket=x11 com.jetbrains.IntelliJ-IDEA-Communitycom.jetbrains.IntelliJ-IDEA-Ultimatefor the Ultimate edition). Alternatively, select the JetBrains Runtime bundled with the IDE (/app/jbr) as the project SDK: when X11 is unavailable the library then switches to its Wayland toolkit automatically. - Xwayland is not running: install it (
xorg-x11-server-Xwaylandon Fedora,xwaylandon Debian/Ubuntu) and log in again. - Authorization refused although the X server runs: check that
XAUTHORITYis set, or runxhost +si:localuser:$USERfrom a terminal of your desktop session.
For releasing a new version, once everything has been tested, locally run
- UNIX-like (Linux, MacOS X, ...) :
./gradlew build - Windows :
gradlew.bat build
results :
| File | Description |
|---|---|
build/fungraphics-dev.jar |
The latest build of the library, constant name, useful for testing. |
build/libs/fungraphics-VERSION.jar |
The same file with a versioned name. |
git commitgit tag -a MAJOR.MINOR.SUB -m "tag vMAJOR.MINOR.SUB"git push origin MAJOR.MINOR.SUB- This commits everyhing and tags it adequately.
- When this has been done, you can then build the corresponding
jarfile with./gradlew buildfor having the correct version number built by Maven. You can then draft a new release and upload the correspondingjarfile from above in GitHub releases. Creating a tag triggers the documentation update. Voilà, you're all set !
The version numbering used in the file name and available using FunGraphics.version() is
generated by inspecting the git state (see com.palantir.git-version
for details). However, the commit should be tagged accordingly.
Here is an example : 1.5.7-3-g2aabbbf.dirty
1.5.7is the last tag-3-we are 3 commits after the tagg2aabbbf: git short hash.dirty: some changes are not committed
