Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/publish-coverage-badge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# shields.io reads, on the badges branch so that no outside service or secret is needed.
set -eu

reports="core/target/site/jacoco/jacoco.csv web/target/site/jacoco/jacoco.csv ui/target/site/jacoco/jacoco.csv"
reports="core/target/site/jacoco/jacoco.csv ui/target/site/jacoco/jacoco.csv"
# Columns four and five of a JaCoCo csv are the instructions missed and covered; the first line is the header.
percent=$(awk -F, 'FNR > 1 { missed += $4; covered += $5 } END { printf "%d", 100 * covered / (missed + covered) }' $reports)

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ on:
- "desktop/**"
- "shell/**"
- "ui/**"
- "web/**"
- "core/**"
- "pom.xml"
- ".github/workflows/installers.yml"
Expand All @@ -28,7 +27,6 @@ on:
- "desktop/**"
- "shell/**"
- "ui/**"
- "web/**"
- "core/**"
- "pom.xml"
- ".github/workflows/installers.yml"
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,17 @@ The `master` branch is regularly built and tested, but is not guaranteed to be c
mvn clean install
```

This builds and tests the `core`, `web`, `ui` and `shell` modules: the Hedgehog
client, the embedded web server, the server-rendered pages and the window that
hosts them.
This builds and tests the `core`, `ui` and `shell` modules: the Hedgehog
client, the server-rendered pages and the start of the application. The embedded web
server and the window that hosts it come from [Oriel](https://github.com/unigrid-project/oriel),
which the build fetches from JitPack at the release `oriel.version` names in the root pom.

To build against a checkout of Oriel instead, such as a change that is not released
yet, run `mvn install` in that checkout and name the coordinates it installs as, with
the version from Oriel's own pom:
```
mvn clean install -Doriel.groupId=org.unigrid.oriel -Doriel.version=0.0.2-SNAPSHOT
```

The `desktop` module builds the native installers and is only part of the build
with the `installer` profile. It needs JDK 25 and the platform's packaging tools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ of the License (see COPYING and COPYING.addendum).
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.unigrid.janus.shell.BrowserWindow;
import org.unigrid.oriel.window.BrowserWindow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.fail;
Expand Down Expand Up @@ -180,8 +180,8 @@ private static Container startOnWayland(final WaylandDesktop desktop) throws IOE
ls /tmp/.X11-unix/X* >/dev/null 2>&1 || { cat /tmp/weston.log; exit 1; }
%2$s XDG_SESSION_TYPE=wayland WAYLAND_DISPLAY=wayland-1 XDG_CURRENT_DESKTOP=%3$s \
JAVA_TOOL_OPTIONS=-D%4$s=9222 setsid nohup %5$s/bin/Unigrid >%6$s 2>&1 &
""".formatted(USER, XWAYLAND_SCREEN, desktop.currentDesktop, BrowserWindow.DEBUGGING_PORT,
PACKAGED, LOG),
""".formatted(USER, XWAYLAND_SCREEN, desktop.currentDesktop,
BrowserWindow.DEBUGGING_PORT, PACKAGED, LOG),
"starting Janus on Wayland");
awaitAddress(container);
return container;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ of the License (see COPYING and COPYING.addendum).
import java.util.stream.Stream;
import javax.imageio.ImageIO;
import org.unigrid.janus.core.hedgehog.HedgehogService;
import org.unigrid.janus.shell.BrowserWindow;
import org.unigrid.oriel.window.BrowserWindow;

/**
* The installed Janus with its window open to a debugging connection, so a test can work it the way a person
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ of the License (see COPYING and COPYING.addendum).
import java.net.http.HttpResponse;
import java.util.List;
import java.util.function.Supplier;
import org.unigrid.janus.web.Routes;
import org.unigrid.janus.web.SessionToken;
import org.unigrid.janus.web.Templates;
import org.unigrid.janus.web.UiServer;
import org.unigrid.janus.web.WindowControl;
import org.unigrid.janus.web.action.Actions;
import org.unigrid.janus.web.action.View;
import org.unigrid.oriel.server.AppId;
import org.unigrid.oriel.server.Routes;
import org.unigrid.oriel.server.SessionToken;
import org.unigrid.oriel.server.UiServer;
import org.unigrid.oriel.server.action.Actions;
import org.unigrid.oriel.server.action.View;
import org.unigrid.oriel.server.template.Templates;
import org.unigrid.oriel.server.window.WindowControl;

/**
* Serves the interface from whatever Java runs it, asks for the files the pages are drawn with, and prints the
Expand All @@ -38,7 +39,7 @@ of the License (see COPYING and COPYING.addendum).
*/
public final class StaticFilesProbe {
static final List<String> ASSETS = List.of(
"/static/css/janus.css", "/static/js/htmx.min.js", "/static/fonts/sora-latin.woff2"
"/static/css/janus.css", "/oriel/htmx.min.js", "/static/fonts/sora-latin.woff2"
);

private StaticFilesProbe() {
Expand All @@ -49,8 +50,8 @@ public static void main(final String[] arguments) throws Exception {
throw new IllegalStateException("The request reached the page instead of being served as a file");
};
final SessionToken token = SessionToken.random();
final URI base = new UiServer(Routes.create(new Templates(false), token, WindowControl.NONE, Actions.of(),
noPage)).start();
final URI base = new UiServer(Routes.create(AppId.of("janus"), new Templates(false), token,
WindowControl.NONE, Actions.of(), noPage)).start();
final HttpClient http = HttpClient.newBuilder().cookieHandler(new CookieManager())
.followRedirects(HttpClient.Redirect.NORMAL).build();

Expand Down
5 changes: 2 additions & 3 deletions e2e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.unigrid.janus</groupId>
<artifactId>web</artifactId>
<version>${project.version}</version>
<groupId>${oriel.groupId}</groupId>
<artifactId>oriel-server</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
Expand Down
34 changes: 23 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
</organization>
<modules>
<module>core</module>
<module>web</module>
<module>ui</module>
<module>shell</module>
</modules>
Expand All @@ -38,8 +37,10 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>25</maven.compiler.release>
<lombok.version>1.18.48</lombok.version>
<jetty.version>12.0.21</jetty.version>
<thymeleaf.version>3.1.3.RELEASE</thymeleaf.version>
<!-- Oriel comes from JitPack, which builds it from its tags. A local build of Oriel is used instead with
-Doriel.groupId=org.unigrid.oriel -Doriel.version=0.0.2-SNAPSHOT, the name and version it installs as. -->
<oriel.groupId>com.github.unigrid-project.oriel</oriel.groupId>
<oriel.version>v0.0.1</oriel.version>
<jcef.version>146.0.10</jcef.version>
<picocli.version>4.7.7</picocli.version>
<weld.version>5.1.2.Final</weld.version>
Expand Down Expand Up @@ -97,16 +98,21 @@
</dependency>

<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-bom</artifactId>
<version>${jetty.version}</version>
<type>pom</type>
<scope>import</scope>
<groupId>${oriel.groupId}</groupId>
<artifactId>oriel-server</artifactId>
<version>${oriel.version}</version>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>${thymeleaf.version}</version>
<groupId>${oriel.groupId}</groupId>
<artifactId>oriel-server</artifactId>
<version>${oriel.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${oriel.groupId}</groupId>
<artifactId>oriel-window</artifactId>
<version>${oriel.version}</version>
</dependency>
<dependency>
<groupId>me.friwi</groupId>
Expand Down Expand Up @@ -197,6 +203,12 @@
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>jitpack</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<build>
<pluginManagement>
<plugins>
Expand Down
11 changes: 3 additions & 8 deletions shell/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,16 @@
<artifactId>shell</artifactId>
<packaging>jar</packaging>
<name>Unigrid Janus Shell</name>
<description>Desktop window hosting the embedded browser, the system tray and the application lifecycle.</description>
<description>Starts Janus: the container, the interface server and the window that shows it.</description>
<dependencies>
<dependency>
<groupId>org.unigrid.janus</groupId>
<artifactId>ui</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.friwi</groupId>
<artifactId>jcefmaven</artifactId>
<groupId>${oriel.groupId}</groupId>
<artifactId>oriel-window</artifactId>
</dependency>
<dependency>
<groupId>info.picocli</groupId>
Expand Down
176 changes: 0 additions & 176 deletions shell/src/main/java/org/unigrid/janus/shell/BrowserWindow.java

This file was deleted.

Loading
Loading