Skip to content

Latest commit

 

History

History
65 lines (44 loc) · 3.94 KB

File metadata and controls

65 lines (44 loc) · 3.94 KB
ISC Logo

License

The FunGraphics library

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.

alt text

Origin

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.

Troubleshooting on Linux (Wayland)

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-x11 access, so programs launched from it cannot open an X11 window. Give it X11 access once and restart the IDE:
    flatpak override --user --socket=x11 com.jetbrains.IntelliJ-IDEA-Community
    
    (use com.jetbrains.IntelliJ-IDEA-Ultimate for 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-Xwayland on Fedora, xwayland on Debian/Ubuntu) and log in again.
  • Authorization refused although the X server runs: check that XAUTHORITY is set, or run xhost +si:localuser:$USER from a terminal of your desktop session.

Compiling

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.

How to release (and have a nice version number)

  1. git commit
  2. git tag -a MAJOR.MINOR.SUB -m "tag vMAJOR.MINOR.SUB"
  3. git push origin MAJOR.MINOR.SUB
  4. This commits everyhing and tags it adequately.
  5. When this has been done, you can then build the corresponding jar file with ./gradlew build for having the correct version number built by Maven. You can then draft a new release and upload the corresponding jar file from above in GitHub releases. Creating a tag triggers the documentation update. Voilà, you're all set !

Version numbers in Scala

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.7 is the last tag
  • -3- we are 3 commits after the tag
  • g2aabbbf : git short hash
  • .dirty : some changes are not committed