Mercurial > hg > human-echolocation-java-webapp
changeset 34:3fead3e53b4a
Split the build file in two: build.xml (default) and build-isvr.xml (which assumes you have the isvr.jar file avaiulable).
Changed the installation intructions accordingly.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Tue, 10 Dec 2013 18:43:20 +0000 |
parents | f415cc429558 |
children | b32c3bd9eb89 |
files | INSTALL.txt build-isvr.xml build.xml |
diffstat | 3 files changed, 76 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/INSTALL.txt Tue Dec 10 17:52:41 2013 +0000 +++ b/INSTALL.txt Tue Dec 10 18:43:20 2013 +0000 @@ -1,12 +1,31 @@ === Build Instructions === +== Pre Requisites == + += MATLAB Compiler Runtime (MCR) = + +The MCR allows you to run compiled MATLAB applications or components without installing MATLAB. In this WebApp we are redistributing a pre-compiled version of isvr.jar (found on WebContent/WEB-INF/lib/isvr.jar). + +To install MCR, please proceed to: + http://www.mathworks.co.uk/products/compiler/mcr/ + +You need to install MATLAB MCR 2013b (8.2). + += System variables = + On OSX you need to export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Applications/MATLAB_R2013b.app/sys/os/maci64/:/Applications/MATLAB_R2013b.app/runtime/maci64/:/Applications/MATLAB_R2013b.app/bin/maci64/ + += Other jar files = + 1. Copy your web servers servlet-api.jar file into this directory. -2. Copy the javabuilder.jar file from your MATLAB or MCR install root in the direcotry /toolbox/javabuilder/jar/javabuilder.jar to the web applications lib folder ./WebContent/WEB-INF/lib +2. Copy the javabuilder.jar file from your MATLAB or MCR install root in the directory /toolbox/javabuilder/jar/javabuilder.jar to the web applications lib folder ./WebContent/WEB-INF/lib + + +== Building the Web Application (echoapp.war) == 3. Run 'ant build.xml'. This should create the echoapp.war file. In case this fails, follow "Compiling and Generating the echoapp.war file" instructions below (points 3.1 to 3.4). @@ -18,21 +37,15 @@ - - == Compiling and Generating the echoapp.war file == -Note: You only need to follow this instructions if step 3 above fails (i.e - if you could not run ant correctly and you could not generate the echoapp.war file correctly). +Note: You only need to follow this instructions if run 'ant build.xml' correctly and you were unable to generate the echoapp.war file. The steps described in this section assume that you already have a working version of the isvr.jar package. The isvr.jar file should be located in WebContent/WEB-INF/lib/isvr.jar. -3.1. Recompile the MATLAB component by running the following MCC command: - - /Applications/MATLAB_R2013b.app/bin/mcc -W "java:uk.ac.soton.isvr,HumanEcho" -d ./scratch -T "link:lib" -v "class{HumanEcho:./WebContent/WEB-INF/mcode/gen_echo.m}" - -3.2. Copy the deployed component from the scratch folder to the web applications lib folder .\WebContent\WEB-INF\lib +1. Copy the deployed component from the scratch folder to the web applications lib folder .\WebContent\WEB-INF\lib cp ./scratch/isvr.jar ./WebContent/WEB-INF/lib -3.3. Compile the web application making sure to reference the servlet-api.jar, the deployed component jar, and the javabuilder.jar +2. Compile the web application making sure to reference the servlet-api.jar, the deployed component jar, and the javabuilder.jar javac -cp servlet-api.jar:./WebContent/WEB-INF/lib/javabuilder.jar:./WebContent/WEB-INF/lib/examples.jar: -d ./WebContent/WEB-INF/classes ./src/HumanEchoServlet.class @@ -43,5 +56,17 @@ 3.4. Navigate to the web applications directory and create the war file. cd WebContent - jar -cvf ../JavaEndToEnd.war . + jar -cvf ../echoapp.war . cd .. + + +== Building isvr.jar == + +In case you have access to the MATLAB code and wish to make any changes to its core functionalities, you can recompile the isvr.jar package. + +You can only compile the isvr.jar if you have MATLAB and the JavaBuilder toolbox: please check this with you systems administrator. + +To compile isvr.jar, simply run 'ant build-isvr.xml'. If this fails you can recompile the MATLAB component by running the following MCC command: + + /Applications/MATLAB_R2013b.app/bin/mcc -W "java:uk.ac.soton.isvr,HumanEcho" -d ./scratch -T "link:lib" -v "class{HumanEcho:./WebContent/WEB-INF/mcode/gen_echo.m}" +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build-isvr.xml Tue Dec 10 18:43:20 2013 +0000 @@ -0,0 +1,39 @@ +<project name="EchoWebApp" default="compile-matlab" basedir="."> + <description> + Builds the isvr.jar. + </description> + + <!-- set global properties for this build --> + <property name="matlab-src" location="mcode/human-echolocation"/> + <property name="matlab-build" location="scratch"/> + <property name="lib" location="WebContent/WEB-INF/lib"/> + + <uptodate property="matlabCompile.notRequired" targetfile="${matlab-build}/isvr.jar" > + <srcfiles dir= "${matlab-src}" includes="*.m"/> + <srcfiles dir= "${matlab-src}/private" includes="*.m"/> + </uptodate> + + <target name="init"> + <!-- Create the time stamp --> + <tstamp/> + <!-- Create the build directory structure used by compile --> + <mkdir dir="${matlab-build}"/> + </target> + + <target name="compile-matlab" depends="init" unless="matlabCompile.notRequired" + description="compile the MATLAB source" > + + <exec executable="/Applications/MATLAB_R2013b.app/bin/mcc"> + <!-- Will create the java package with the HumanEcho class --> + <arg line='-W "java:uk.ac.soton.isvr,HumanEcho" -d ${matlab-build} -T "link:lib" -v "class{HumanEcho:${matlab-src}/simulateBinauralSignals.m}"'/> + </exec> + + <!-- Copy the generated jar to the lib folder --> + <copy file="${matlab-build}/isvr.jar" tofile="${lib}/isvr.jar" overwrite="true" /> + </target> + + <target name="clean" description="clean up" > + <!-- Delete the ${build} and ${dist} directory trees --> + <delete dir="${build}"/> + </target> +</project>
--- a/build.xml Tue Dec 10 17:52:41 2013 +0000 +++ b/build.xml Tue Dec 10 18:43:20 2013 +0000 @@ -4,49 +4,26 @@ </description> <!-- set global properties for this build --> - <property name="matlab-src" location="mcode/human-echolocation"/> - <property name="matlab-build" location="scratch"/> <property name="lib" location="WebContent/WEB-INF/lib"/> <property name="src" location="src"/> <property name="classes" location="WebContent/WEB-INF/classes"/> <property name="web.dir" location="WebContent"/> <property name="war.file" location="echoapp.war"/> - <uptodate property="matlabCompile.notRequired" targetfile="${matlab-build}/isvr.jar" > - <srcfiles dir= "${matlab-src}" includes="*.m"/> - <srcfiles dir= "${matlab-src}/private" includes="*.m"/> - </uptodate> - <uptodate property="warBuild.notRequired" targetfile="${war.file}" > <srcfiles dir= "${classes}" includes="*.class"/> <srcfiles dir= "${src}" includes="*.java" /> <srcfiles dir= "${web.dir}" includes="*.jsp"/> <srcfiles dir= "${web.dir}" includes="*.css"/> <srcfiles dir= "${web.dir}" includes="*.xml" /> - <srcfiles dir= "${web.dir}/script" includes="*.js" /> - <srcfiles dir= "${web.dir}/script" includes="*.js" /> </uptodate> <target name="init"> <!-- Create the time stamp --> <tstamp/> - <!-- Create the build directory structure used by compile --> - <mkdir dir="${matlab-build}"/> </target> - <target name="compile-matlab" depends="init" unless="matlabCompile.notRequired" - description="compile the MATLAB source" > - - <exec executable="/Applications/MATLAB_R2013b.app/bin/mcc"> - <!-- Will create the java package with the HumanEcho class --> - <arg line='-W "java:uk.ac.soton.isvr,HumanEcho" -d ${matlab-build} -T "link:lib" -v "class{HumanEcho:${matlab-src}/simulateBinauralSignals.m}"'/> - </exec> - - <!-- Copy the generated jar to the lib folder --> - <copy file="${matlab-build}/isvr.jar" tofile="${lib}/isvr.jar" overwrite="true" /> - </target> - - <target name="build" depends="compile-matlab"> + <target name="build"> <javac srcdir="${src}" destdir="${classes}" classpath="servlet-api.jar:${lib}/javabuilder.jar:${lib}/isvr.jar:${lib}/log4j-1.2.17.jar" includeantruntime="false"/> </target>