From f870bc2ccd5a78df03e75e981a6eb1c8d4904bb9 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Sun, 6 Dec 2020 12:05:53 +0000
Subject: [PATCH] console: Move web resources to war

---
 apps/desktopgui/build.xml         |  2 +-
 apps/i2psnark/java/build.xml      |  3 +++
 apps/routerconsole/java/build.xml |  2 +-
 apps/routerconsole/jsp/web.xml    |  5 -----
 build.xml                         | 12 +++---------
 5 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/apps/desktopgui/build.xml b/apps/desktopgui/build.xml
index 7b119fc670..808d228f91 100644
--- a/apps/desktopgui/build.xml
+++ b/apps/desktopgui/build.xml
@@ -80,7 +80,7 @@
 		<!-- set if unset -->
 		<property name="workspace.changes.tr" value="" />
                 <!-- ideal for linux: 24x24, but transparency doesn't work -->
-                <copy tofile="${build}/desktopgui/resources/images/logo.png" file="../../installer/resources/themes/console/images/itoopie_xsm.png" />
+                <copy tofile="${build}/desktopgui/resources/images/logo.png" file="../../apps/routerconsole/jsp/themes/console/images/itoopie_xsm.png" />
                 <copy todir="${build}/desktopgui/resources/images" file="images/itoopie_black_24.png" />
                 <copy todir="${build}/desktopgui/resources/images" file="images/itoopie_white_24.png" />
 		<jar basedir="${build}" excludes="messages-src/**" destfile="${dist}/${jar}">
diff --git a/apps/i2psnark/java/build.xml b/apps/i2psnark/java/build.xml
index 7f44e71f0a..a75a7639ec 100644
--- a/apps/i2psnark/java/build.xml
+++ b/apps/i2psnark/java/build.xml
@@ -250,6 +250,9 @@
 
     <!-- add css, image, and js files for standalone snark to the war -->
     <target name="standalone_war" depends="war">
+<!--  FIXME
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////
+-->
         <mkdir dir="build/standalone-resources/.resources/themes/snark" />
         <copy todir="build/standalone-resources/.resources/themes/snark" >
             <fileset dir="../../../installer/resources/themes/snark/" />
diff --git a/apps/routerconsole/java/build.xml b/apps/routerconsole/java/build.xml
index b2eeb1f9ac..bfee312db0 100644
--- a/apps/routerconsole/java/build.xml
+++ b/apps/routerconsole/java/build.xml
@@ -339,7 +339,7 @@
         <!-- set if unset -->
         <property name="workspace.changes.w.tr" value="" />
         <!-- Don't include the css in the war, the main build.xml will copy it to docs/themes/console/ -->
-        <copy file="../../../installer/resources/themes/console/images/favicon.ico" tofile="../jsp/favicon.ico" />
+        <copy file="../jsp/themes/console/images/favicon.ico" tofile="../jsp/favicon.ico" />
         <war destfile="build/routerconsole.war" webxml="../jsp/web-out.xml"
              basedir="../jsp/" excludes="web.xml, *.css, **/*.java, *.jsp, *.jsi, web-fragment.xml, web-out.xml">
             <manifest>
diff --git a/apps/routerconsole/jsp/web.xml b/apps/routerconsole/jsp/web.xml
index 75d59a8f9d..23b78d8208 100644
--- a/apps/routerconsole/jsp/web.xml
+++ b/apps/routerconsole/jsp/web.xml
@@ -28,11 +28,6 @@
 
     
     <!-- yeah, i'm lazy, using a jsp instead of a servlet.. -->
-    <servlet-mapping> 
-      <servlet-name>net.i2p.router.web.jsp.viewtheme_jsp</servlet-name>
-      <url-pattern>/themes/*</url-pattern>
-    </servlet-mapping>
-    
     <servlet-mapping> 
       <servlet-name>net.i2p.router.web.jsp.viewtheme_jsp</servlet-name>
       <url-pattern>/javadoc/*</url-pattern>
diff --git a/build.xml b/build.xml
index cbcce8c371..1d7912bfe7 100644
--- a/build.xml
+++ b/build.xml
@@ -1436,7 +1436,7 @@
     </target>
 
     <!-- see targets below for conditional copying -->
-    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepthemeupdates, prepCertificates, prepRouterInfos, copyjetty, copytomcat-unlesspkg, copyjstl-unlesspkg, copystandard-unlesspkg, copyflags, truncatehistory">
+    <target name="preppkg-base" depends="build, preplicenses, prepConsoleDocs, prepCertificates, prepRouterInfos, copyjetty, copytomcat-unlesspkg, copyjstl-unlesspkg, copystandard-unlesspkg, copyflags, truncatehistory">
         <!-- if updater200 was run previously, it left *.pack files in pkg-temp -->
         <!-- Also remove deletelist.txt used for updater only -->
         <delete>
@@ -1484,7 +1484,7 @@
         <copy todir="pkg-temp/eepsite-jetty9.3" >
             <fileset dir="installer/resources/eepsite-jetty9.3" />
         </copy>
-        <copy file="installer/resources/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
+        <copy file="apps/routerconsole/jsp/themes/console/images/favicon.ico" tofile="pkg-temp/eepsite/docroot/favicon.ico" />
     </target>
 
     <target name="copyflags" depends="copyflags-unlesspkg" >
@@ -1585,12 +1585,6 @@
         <copy file="installer/lib/launch4j/lib/XStream.LICENSE.txt" tofile="pkg-temp/licenses/LICENSE-XStream.txt" />
     </target>
 
-    <target name="prepthemeupdates">
-        <copy todir="pkg-temp/docs/themes/" >
-            <fileset dir="installer/resources/themes/" />
-        </copy>
-    </target>
-
     <!-- SSL Certs -->
     <target name="prepCertificates" depends="buildCore">
         <copy todir="pkg-temp/certificates/" >
@@ -1837,7 +1831,7 @@
         <concat append="true" destfile="pkg-temp/history.txt">&#10;&#10;----------------&#10;&#10;EARLIER HISTORY IS AVAILABLE IN THE SOURCE PACKAGE</concat>
     </target>
 
-    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepjupdatefixes, prepthemeupdates">
+    <target name="prepupdateSmall" depends="buildSmall, prepupdateRouter, prepjupdatefixes">
         <copy file="build/i2ptunnel.jar" todir="pkg-temp/lib/" />
         <copy file="build/mstreaming.jar" todir="pkg-temp/lib/" />
         <copy file="build/streaming.jar" todir="pkg-temp/lib/" />
-- 
GitLab