From 8c0e82d4f35a3034c900afcb3dd5823fb8052124 Mon Sep 17 00:00:00 2001 From: zzz Date: Sat, 14 Apr 2018 18:54:17 +0000 Subject: [PATCH] i2ptunnel build restructuring: Move Messages class from web to ui package, and from jar to war. Build web package in a separate pass (prep for ssl helper) API notes in javadocs Hopefully doesn't break Android build --- apps/i2ptunnel/java/build.xml | 38 +++++++++++++++---- .../net/i2p/i2ptunnel/ui/GeneralHelper.java | 4 +- .../i2p/i2ptunnel/{web => ui}/Messages.java | 5 ++- .../net/i2p/i2ptunnel/ui/TunnelConfig.java | 3 ++ .../src/net/i2p/i2ptunnel/web/IndexBean.java | 1 + apps/i2ptunnel/jsp/edit.jsp | 2 +- apps/i2ptunnel/jsp/index.jsp | 2 +- apps/i2ptunnel/jsp/register.jsp | 2 +- apps/i2ptunnel/jsp/wizard.jsp | 2 +- 9 files changed, 46 insertions(+), 13 deletions(-) rename apps/i2ptunnel/java/src/net/i2p/i2ptunnel/{web => ui}/Messages.java (88%) diff --git a/apps/i2ptunnel/java/build.xml b/apps/i2ptunnel/java/build.xml index 6f0a82d0f3..ea2197afdc 100644 --- a/apps/i2ptunnel/java/build.xml +++ b/apps/i2ptunnel/java/build.xml @@ -31,11 +31,13 @@ + + + + + + + + + + @@ -63,7 +80,7 @@ - + @@ -76,7 +93,11 @@ - + + + + + @@ -93,7 +114,8 @@ - + + @@ -239,14 +261,15 @@ - + - - + + + @@ -276,7 +299,7 @@ - + @@ -388,6 +411,7 @@ + diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/GeneralHelper.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/GeneralHelper.java index 89be8c8eb3..a91255f1f1 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/GeneralHelper.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/GeneralHelper.java @@ -27,7 +27,6 @@ import net.i2p.i2ptunnel.I2PTunnelServer; import net.i2p.i2ptunnel.SSLClientUtil; import net.i2p.i2ptunnel.TunnelController; import net.i2p.i2ptunnel.TunnelControllerGroup; -import net.i2p.i2ptunnel.web.Messages; import net.i2p.util.ConvertToHash; import net.i2p.util.FileUtil; import net.i2p.util.Log; @@ -36,6 +35,9 @@ import net.i2p.util.SecureFile; /** * General helper functions used by all UIs. * + * This class is also used by Android. + * Maintain as a stable API and take care not to break Android. + * * @since 0.9.19 */ public class GeneralHelper { diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/Messages.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/Messages.java similarity index 88% rename from apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/Messages.java rename to apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/Messages.java index 6aba5d4b13..0737bfc53e 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/Messages.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/Messages.java @@ -1,10 +1,13 @@ -package net.i2p.i2ptunnel.web; +package net.i2p.i2ptunnel.ui; import net.i2p.I2PAppContext; import net.i2p.util.Translate; /** * Translate strings for this package. + * This is for the strings in the UI. Bundles are in the war. + * Note that there are separate bundles for the proxy error messages + * in the jar, which are not accessed by this class. * @since 0.7.9 */ public class Messages { diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/TunnelConfig.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/TunnelConfig.java index 8173f89edf..469bfa993a 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/TunnelConfig.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/TunnelConfig.java @@ -31,6 +31,9 @@ import net.i2p.util.PasswordManager; * Helper class to generate a valid TunnelController configuration from provided * settings. * + * This class is also used by Android. + * Maintain as a stable API and take care not to break Android. + * * @since 0.9.19 logic moved from IndexBean */ public class TunnelConfig { diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java index c191bede06..b5c129df36 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java @@ -31,6 +31,7 @@ import net.i2p.i2ptunnel.I2PTunnelServer; import net.i2p.i2ptunnel.TunnelController; import net.i2p.i2ptunnel.TunnelControllerGroup; import net.i2p.i2ptunnel.ui.GeneralHelper; +import net.i2p.i2ptunnel.ui.Messages; import net.i2p.i2ptunnel.ui.TunnelConfig; import net.i2p.util.Addresses; import net.i2p.util.Log; diff --git a/apps/i2ptunnel/jsp/edit.jsp b/apps/i2ptunnel/jsp/edit.jsp index 6c86b3c67e..e92b2ff569 100644 --- a/apps/i2ptunnel/jsp/edit.jsp +++ b/apps/i2ptunnel/jsp/edit.jsp @@ -31,7 +31,7 @@ if (tun != null) { %> - + <%=intl._t("Hidden Services Manager")%> - <%=(__isClient ? intl._t("Edit Client Tunnel") : intl._t("Edit Hidden Service"))%> diff --git a/apps/i2ptunnel/jsp/index.jsp b/apps/i2ptunnel/jsp/index.jsp index dfdfcbf3bb..0b1b6df439 100644 --- a/apps/i2ptunnel/jsp/index.jsp +++ b/apps/i2ptunnel/jsp/index.jsp @@ -19,7 +19,7 @@ - + <%=intl._t("Hidden Services Manager")%> diff --git a/apps/i2ptunnel/jsp/register.jsp b/apps/i2ptunnel/jsp/register.jsp index a27853dd7f..313eea4b3e 100644 --- a/apps/i2ptunnel/jsp/register.jsp +++ b/apps/i2ptunnel/jsp/register.jsp @@ -18,7 +18,7 @@ /* but might want to POST to it anyway ??? */ %> - + <% RequestWrapper wrequest = new RequestWrapper(request); String tun = wrequest.getParameter("tunnel"); diff --git a/apps/i2ptunnel/jsp/wizard.jsp b/apps/i2ptunnel/jsp/wizard.jsp index fff3f100e7..55b21f61ab 100644 --- a/apps/i2ptunnel/jsp/wizard.jsp +++ b/apps/i2ptunnel/jsp/wizard.jsp @@ -17,7 +17,7 @@ %> - + <% String pageStr = request.getParameter("page"); /* Get the number of the page we came from */ int lastPage = 0;