forked from I2P_Developers/i2p.i2p
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
This commit is contained in:
@ -31,11 +31,13 @@
|
||||
<property name="javac.version" value="1.7" />
|
||||
<property name="require.gettext" value="true" />
|
||||
|
||||
<!-- Compile includes ui/ classes but not web/ classes here -->
|
||||
<target name="compile" depends="depend">
|
||||
<mkdir dir="./build" />
|
||||
<mkdir dir="./build/obj" />
|
||||
<javac
|
||||
srcdir="./src"
|
||||
excludes="net/i2p/i2ptunnel/web/**/*"
|
||||
debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
|
||||
destdir="./build/obj"
|
||||
includeAntRuntime="false"
|
||||
@ -44,6 +46,21 @@
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<!-- Compile web/ classes only here. Not for Android. -->
|
||||
<target name="compileWeb" depends="jar">
|
||||
<mkdir dir="./build" />
|
||||
<mkdir dir="./build/obj" />
|
||||
<javac
|
||||
srcdir="./src"
|
||||
includes="net/i2p/i2ptunnel/web/**/*"
|
||||
debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
|
||||
destdir="./build/obj"
|
||||
includeAntRuntime="false"
|
||||
classpath="../../../core/java/build/i2p.jar:build/i2ptunnel.jar:../../jetty/jettylib/jetty-i2p.jar:../../jetty/jettylib/jetty-xml.jar" >
|
||||
<compilerarg line="${javac.compilerargs}" />
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" >
|
||||
<exec executable="mtn" outputproperty="workspace.changes.j" errorproperty="mtn.error2" failifexecutionfails="false" >
|
||||
<arg value="list" />
|
||||
@ -63,7 +80,7 @@
|
||||
<target name="jar" depends="builddep, compile, bundle-proxy, jarUpToDate, listChangedFiles" unless="jar.uptodate" >
|
||||
<!-- set if unset -->
|
||||
<property name="workspace.changes.j.tr" value="" />
|
||||
<jar destfile="./build/i2ptunnel.jar" basedir="./build/obj" includes="**/*.class" excludes="**/ui/*.class **/EditBean.class **/IndexBean.class" >
|
||||
<jar destfile="./build/i2ptunnel.jar" basedir="./build/obj" includes="**/*.class" excludes="**/ui/*.class **/web/*.class" >
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="net.i2p.i2ptunnel.I2PTunnel" />
|
||||
<attribute name="Class-Path" value="i2p.jar mstreaming.jar" />
|
||||
@ -76,7 +93,11 @@
|
||||
<attribute name="X-Compile-Target-JDK" value="${javac.version}" />
|
||||
</manifest>
|
||||
</jar>
|
||||
<jar destfile="./build/temp-beans.jar" basedir="./build/obj" includes="**/ui/*.class **/EditBean.class **/IndexBean.class" />
|
||||
</target>
|
||||
|
||||
<!-- web/ and ui/ classes that will go in the war. Not for Android. -->
|
||||
<target name="jarTempBeans" depends="builddep, compileWeb" >
|
||||
<jar destfile="./build/temp-beans.jar" basedir="./build/obj" includes="**/ui/*.class **/web/*.class" />
|
||||
</target>
|
||||
|
||||
<target name="jarUpToDate">
|
||||
@ -93,7 +114,8 @@
|
||||
</condition>
|
||||
</target>
|
||||
|
||||
<!-- Separate jar for general UI classes -->
|
||||
<!-- Separate jar for general UI classes (but not web) -->
|
||||
<!-- This is for Android only -->
|
||||
<target name="uiJar" depends="jar, uiJarUpToDate, listChangedFiles" unless="uiJar.uptodate" >
|
||||
<!-- set if unset -->
|
||||
<property name="workspace.changes.j.tr" value="" />
|
||||
@ -239,14 +261,15 @@
|
||||
</target>
|
||||
|
||||
<!-- The web classes are now in the war not the jar - they are not part of the API -->
|
||||
<target name="war" depends="precompilejsp, bundle, warUpToDate, listChangedFiles2" unless="war.uptodate" >
|
||||
<target name="war" depends="compileWeb, precompilejsp, bundle, warUpToDate, listChangedFiles2" unless="war.uptodate" >
|
||||
<!-- set if unset -->
|
||||
<property name="workspace.changes.w.tr" value="" />
|
||||
<copy todir="../jsp/WEB-INF/classes/net/i2p/i2ptunnel/ui">
|
||||
<fileset dir="build/obj/net/i2p/i2ptunnel/ui" />
|
||||
</copy>
|
||||
<copy file="build/obj/net/i2p/i2ptunnel/web/EditBean.class" todir="../jsp/WEB-INF/classes/net/i2p/i2ptunnel/web" />
|
||||
<copy file="build/obj/net/i2p/i2ptunnel/web/IndexBean.class" todir="../jsp/WEB-INF/classes/net/i2p/i2ptunnel/web" />
|
||||
<copy todir="../jsp/WEB-INF/classes/net/i2p/i2ptunnel/web">
|
||||
<fileset dir="build/obj/net/i2p/i2ptunnel/web" />
|
||||
</copy>
|
||||
<war destfile="build/i2ptunnel.war" webxml="../jsp/web-out.xml"
|
||||
basedir="../jsp/" excludes="web.xml, web-fragment.xml, web-out.xml, **/*.java, *.jsp, *.jsi">
|
||||
<manifest>
|
||||
@ -276,7 +299,7 @@
|
||||
</condition>
|
||||
</target>
|
||||
|
||||
<target name="precompilejsp" depends="jar" unless="precompilejsp.uptodate">
|
||||
<target name="precompilejsp" depends="jarTempBeans" unless="precompilejsp.uptodate">
|
||||
<delete dir="../jsp/WEB-INF/" />
|
||||
<delete file="../jsp/web-fragment.xml" />
|
||||
<delete file="../jsp/web-out.xml" />
|
||||
@ -388,6 +411,7 @@
|
||||
</classpath>
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="test" depends="clean, compileTest">
|
||||
<junit printsummary="on" fork="yes">
|
||||
<classpath>
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -31,7 +31,7 @@ if (tun != null) {
|
||||
%><?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<jsp:useBean class="net.i2p.i2ptunnel.web.EditBean" id="editBean" scope="request" />
|
||||
<jsp:useBean class="net.i2p.i2ptunnel.web.Messages" id="intl" scope="request" />
|
||||
<jsp:useBean class="net.i2p.i2ptunnel.ui.Messages" id="intl" scope="request" />
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title><%=intl._t("Hidden Services Manager")%> - <%=(__isClient ? intl._t("Edit Client Tunnel") : intl._t("Edit Hidden Service"))%></title>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<jsp:useBean class="net.i2p.i2ptunnel.web.IndexBean" id="indexBean" scope="request" />
|
||||
<jsp:setProperty name="indexBean" property="*" />
|
||||
<jsp:useBean class="net.i2p.i2ptunnel.web.Messages" id="intl" scope="request" />
|
||||
<jsp:useBean class="net.i2p.i2ptunnel.ui.Messages" id="intl" scope="request" />
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title><%=intl._t("Hidden Services Manager")%></title>
|
||||
|
@ -18,7 +18,7 @@
|
||||
/* but might want to POST to it anyway ??? */
|
||||
%>
|
||||
<jsp:useBean class="net.i2p.i2ptunnel.web.EditBean" id="editBean" scope="request" />
|
||||
<jsp:useBean class="net.i2p.i2ptunnel.web.Messages" id="intl" scope="request" />
|
||||
<jsp:useBean class="net.i2p.i2ptunnel.ui.Messages" id="intl" scope="request" />
|
||||
<%
|
||||
RequestWrapper wrequest = new RequestWrapper(request);
|
||||
String tun = wrequest.getParameter("tunnel");
|
||||
|
@ -17,7 +17,7 @@
|
||||
%><?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<jsp:useBean class="net.i2p.i2ptunnel.web.EditBean" id="editBean" scope="request" />
|
||||
<jsp:useBean class="net.i2p.i2ptunnel.web.Messages" id="intl" scope="request" />
|
||||
<jsp:useBean class="net.i2p.i2ptunnel.ui.Messages" id="intl" scope="request" />
|
||||
<% String pageStr = request.getParameter("page");
|
||||
/* Get the number of the page we came from */
|
||||
int lastPage = 0;
|
||||
|
Reference in New Issue
Block a user