DTG: Add classpath to jar, add early check for support when called by CLI

for ease of command-line testing
This commit is contained in:
zzz
2021-11-30 10:26:52 -05:00
parent 6cb8d2eeb7
commit b53707074f
2 changed files with 8 additions and 0 deletions

View File

@@ -10,6 +10,7 @@
<property name="javac.version" value="1.8" /> <property name="javac.version" value="1.8" />
<property name="javac.release" value="8" /> <property name="javac.release" value="8" />
<property name="require.gettext" value="true" /> <property name="require.gettext" value="true" />
<property name="manifest.classpath.name" value="Class-Path" />
<condition property="no.bundle"> <condition property="no.bundle">
<isfalse value="${require.gettext}" /> <isfalse value="${require.gettext}" />
@@ -86,6 +87,7 @@
<jar basedir="${build}" excludes="messages-src/**" destfile="${dist}/${jar}"> <jar basedir="${build}" excludes="messages-src/**" destfile="${dist}/${jar}">
<manifest> <manifest>
<attribute name="Main-Class" value="net.i2p.desktopgui.Main"/> <attribute name="Main-Class" value="net.i2p.desktopgui.Main"/>
<attribute name="${manifest.classpath.name}" value="i2p.jar router.jar" />
<attribute name="Implementation-Version" value="${full.version}" /> <attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Built-By" value="${build.built-by}" /> <attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" /> <attribute name="Build-Date" value="${build.timestamp}" />

View File

@@ -5,6 +5,7 @@ package net.i2p.desktopgui;
*/ */
import java.awt.Image; import java.awt.Image;
import java.awt.SystemTray;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.io.File; import java.io.File;
import java.lang.reflect.Method; import java.lang.reflect.Method;
@@ -95,6 +96,11 @@ public class Main implements RouterApp {
} }
public static void main(String[] args) { public static void main(String[] args) {
// early check so we can bail out when started via CLI
if (!SystemTray.isSupported()) {
System.err.println("SystemTray not supported");
return;
}
Main main = new Main(); Main main = new Main();
main.beginStartup(args); main.beginStartup(args);
} }