https://github.com/adufilie/Weave
Tip revision: f310f12b93d02a53bbe94b73ff3e8cbf71dde237 authored by Philip Kovac on 14 June 2016, 16:56:05 UTC
getAuthenticatedUser now verifies that the user is, indeed, authenticated, and doesn't just directly read the HTTP session info.
getAuthenticatedUser now verifies that the user is, indeed, authenticated, and doesn't just directly read the HTTP session info.
Tip revision: f310f12
build.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- This is the build script to build all the projects and their dependencies. To use these scripts, you must
first do the following
1) Setup FLEX_HOME as an operating system environment variable pointing to where you installed your Flex 3.6A SDK.
This Flex 3.6A SDK must be downloaded directly from Adobe-do not attempt to merge the SDK provided in FlashBuilder.
e.g.) C:\Flex 3.6A SDK
2) Add the Flex 3.6A SDK's bin folder to your operating system's PATH variable.
3) Add ANT's bin folder to your operating system's PATH variable.
e.g.) C:\ant\bin
Change FRAMEWORK_SWF property below to be the filename of the framework_*.swf file.
For example, if yours is
${FLEX_HOME}/frameworks/rsls/framework_3.6.0.21751.swf
then the FRAMEWORK_SWF would be framework_3.6.0.21751.swf
5) Restart Eclipse to let it register the updated PATH.
6) Change WEAVE_DOCROOT property located in this file. It should be the same as the WEAVE_DOCROOT
defined in your linked resources variable if you are using Eclipse.
7) From command prompt, change into the WeaveClient directory and perform this command
ant -f buildall.xml install
This will build all the files in order and push the necessary ones to WEAVE_DOCROOT.
-->
<project name="Weave" basedir="." default="build">
<property environment="env"/>
<property file="user.properties"/>
<property file="build.properties"/>
<target name="dist" depends="build">
<zip destfile="weave.zip">
<zipfileset dir="${WEAVE_DESTROOT}" prefix="ROOT" excludes="${DESKTOP}.swf ${DESKTOP}.air *.png defaults.xml"/>
<zipfileset file="${basedir}/WeaveServices.war"/>
</zip>
</target>
<target name="air" depends="build, desktop">
<copy todir="${WEAVE_DESTROOT}">
<fileset dir="${DESKTOP}/src/">
<include name="*.png"/>
</fileset>
<fileset dir="${CLIENT}/configurations">
<include name="defaults.xml"/>
</fileset>
</copy>
<path id="FILE-LIST">
<fileset dir="${WEAVE_DESTROOT}">
<include name="*" />
<exclude name="${CLIENT}.swf"/>
<exclude name="${DESKTOP}.air"/>
</fileset>
</path>
<pathconvert pathsep=" " property="FILE-LIST.csv"
refid="FILE-LIST"/>
<java
jar ="${ADT_JAR}"
fork = "true"
dir ="${WEAVE_DESTROOT}"
failonerror="true">
<arg value="-package"/>
<arg value="-storetype"/>
<arg value="pkcs12"/>
<arg value="-keystore"/>
<arg value="${AIR_CERT}"/>
<arg value="-storepass"/>
<arg value="${AIR_CERT_PASS}"/>
<arg value="${DESKTOP}"/>
<arg value="${basedir}/${DESKTOP}/src/WeaveDesktop-app.xml"/>
<arg line="${FILE-LIST.csv}"/>
<!-- <arg value="icons/*.png"/> -->
</java>
</target>
<target name="install" depends="build">
<!-- This target will install the files to WEAVE_DOCROOT. -->
<copy todir="${WEAVE_DOCROOT}">
<fileset dir="${WEAVE_DESTROOT}">
<include name="*.swf"/>
<include name="*.html"/>
<include name="*.js"/>
<include name="*.css"/>
<exclude name="${DESKTOP}.swf"/>
<exclude name="${DESKTOP}.air"/>
<exclude name="*.png"/>
<exclude name="defaults.xml"/>
</fileset>
</copy>
<copy todir="${WEAVE_DOCROOT}/../">
<fileset dir="${basedir}">
<include name="WeaveServices.war"/>
</fileset>
</copy>
</target>
<!-- This target will extract the swf files from the swc archives
and extract them to the WEAVE_DESTROOT -->
<target name="build" depends="client, admin, uispark, ui, data, core, api, services, exampleplugin">
<mkdir dir="${WEAVE_DESTROOT}"/>
<build-html-wrapper project="${CLIENT}" swf="weave" title="Weave"/>
<build-html-wrapper project="${ADMIN}" swf="AdminConsole" title="Weave Admin Console"/>
<extract_swc swc="${basedir}/${API}/bin/${API}.swc" rsl="${API}.swf"/>
<extract_swc swc="${basedir}/${CORE}/bin/${CORE}.swc" rsl="${CORE}.swf"/>
<extract_swc swc="${basedir}/${DATA}/bin/${DATA}.swc" rsl="${DATA}.swf"/>
<extract_swc swc="${basedir}/${UISPARK}/bin/${UISPARK}.swc" rsl="${UISPARK}.swf"/>
<extract_swc swc="${basedir}/${UI}/bin/${UI}.swc" rsl="${UI}.swf"/>
<copy file="${basedir}/${CLIENT}/swf/${FONTS}.swf" tofile="${WEAVE_DESTROOT}/${FONTS}.swf"/>
<copy file="${basedir}/${CLIENT}/bin/weave.swf" tofile="${WEAVE_DESTROOT}/weave.swf"/>
<copy file="${basedir}/${CLIENT}/src/weaveStyle.css" tofile="${WEAVE_DESTROOT}/weaveStyle.css"/>
<copy file="${basedir}/${CLIENT}/html-template/playerProductInstall.swf" tofile="${WEAVE_DESTROOT}/playerProductInstall.swf"/>
<copy file="${basedir}/${CLIENT}/html-template/swfobject.js" tofile="${WEAVE_DESTROOT}/swfobject.js"/>
<copy file="${basedir}/${ADMIN}/bin/AdminConsole.swf" tofile="${WEAVE_DESTROOT}/AdminConsole.swf"/>
<copy file="${basedir}/${UI}/src/weave/visualization/tools/CytoscapeWebPopout.html" tofile="${WEAVE_DESTROOT}/CytoscapeWebPopout.html"/>
<copy file="${basedir}/${SERVICES}/bin/${SERVICES}.war" tofile="${basedir}/${SERVICES}.war"/>
<copy failonerror="false" file="${basedir}/${EXAMPLEPLUGIN}/bin/${EXAMPLEPLUGIN}.swc" tofile="${WEAVE_DESTROOT}/${EXAMPLEPLUGIN}.swc"/>
<copy file="${FLEX_HOME}/frameworks/rsls/${FRAMEWORK_SWF}" tofile="${WEAVE_DESTROOT}/framework.swf"/>
<copy file="${FLEX_HOME}/frameworks/rsls/${RPC_SWF}" tofile="${WEAVE_DESTROOT}/rpc.swf"/>
<copy file="${FLEX_HOME}/frameworks/rsls/${SPARK_SWF}" tofile="${WEAVE_DESTROOT}/spark.swf"/>
<copy file="${FLEX_HOME}/frameworks/rsls/${MX_SWF}" tofile="${WEAVE_DESTROOT}/mx.swf"/>
<copy file="${FLEX_HOME}/frameworks/rsls/${TEXTLAYOUT_SWF}" tofile="${WEAVE_DESTROOT}/textLayout.swf"/>
</target>
<!-- These targets will build each project -->
<target name="api">
<buildproject targetproject="${API}" targetfileext="swc"/>
</target>
<target name="core" depends="api">
<buildproject targetproject="${CORE}" targetfileext="swc"/>
</target>
<target name="data" depends="core">
<buildproject targetproject="${DATA}" targetfileext="swc"/>
</target>
<target name="update_version" depends="is_git_version,is_custom_version" unless="VERSION"/>
<target name="write_version" depends="update_version">
<!-- echo message="${GIT_SHORT_VERSION} ${GIT_IS_MODIFIED} ${GIT_BUILD_TIME}"/ -->
<echo message="${VERSION}" file="${VERSION_FILE}"/>
</target>
<target name="prep_version_update">
<exec searchpath="true"
outputproperty="GIT_PORCELAIN_OUTPUT"
executable="git">
<arg value="status"/>
<arg value="--porcelain"/>
<arg value="-uno"/>
</exec>
<exec searchpath="true"
outputproperty="GIT_SHORT_VERSION"
executable="git">
<arg value="rev-parse"/>
<arg value="--short"/>
<arg value="HEAD"/>
</exec>
<condition property="GIT_IS_MODIFIED">
<not>
<equals arg1="${GIT_PORCELAIN_OUTPUT}" arg2=""/>
</not>
</condition>
<tstamp>
<format property="GIT_BUILD_TIME" pattern="EEE MMM d HH:mm:ss z yyyy"/>
</tstamp>
</target>
<target name="is_git_version" depends="prep_version_update" unless="GIT_IS_MODIFIED">
<echo>GIT_isn't_MODIFIED</echo>
<property name="VERSION" value="Automated Build ${GIT_SHORT_VERSION}, ${GIT_BUILD_TIME}"/>
</target>
<target name="is_custom_version" depends="prep_version_update" if="GIT_IS_MODIFIED">
<echo>GIT_IS_MODIFIED ${GIT_IS_MODIFIED}</echo>
<property name="VERSION" value="Custom"/>
</target>
<target name="uispark" depends="data,write_version">
<buildproject targetproject="${UISPARK}" targetfileext="swc"/>
</target>
<target name="ui" depends="uispark">
<buildproject targetproject="${UI}" targetfileext="swc"/>
</target>
<target name="client" depends="ui">
<buildproject targetproject="${CLIENT}" targetfileext="swf"/>
</target>
<target name="admin" depends="ui">
<buildproject targetproject="${ADMIN}" targetfileext="swf"/>
</target>
<target name="desktop" depends="ui">
<buildproject targetproject="${DESKTOP}" targetfileext="swf"/>
<copy file="${basedir}/${DESKTOP}/bin/${DESKTOP}.swf" tofile="${WEAVE_DESTROOT}/${DESKTOP}.swf"/>
</target>
<target name="servletutils">
<ant dir="${basedir}/${SERVLETUTILS}" target="build"/>
</target>
<target name="exampleplugin" depends="ui">
<ant dir="${basedir}/${EXAMPLEPLUGIN}" target="build"/>
</target>
<target name="copy_version_file" depends="write_version">
<copy file="${VERSION_FILE}" tofile="${basedir}/${SERVICES}/src/weave/weave_version.txt"/>
</target>
<target name="services" depends="servletutils,copy_version_file">
<ant dir="${basedir}/${SERVICES}" target="dist"/>
</target>
<target name="doc">
<ant dir="${basedir}/${CLIENT}" antfile="build-asdoc.xml" target="compile"/>
<ant dir="${basedir}/${CLIENT}" antfile="build-jsdoc.xml" target="compile"/>
<ant dir="${basedir}/${SERVICES}" target="doc"/>
</target>
<!-- This target calls the clean targets of each project's build file -->
<target name="clean">
<echo message="Cleaning all projects..."/>
<delete quiet="false" includeemptydirs="true" dir="${WEAVE_DESTROOT}">
<fileset file="${basedir}/${SERVICES}.war"/>
<fileset file="${basedir}/weave.zip"/>
</delete>
<ant dir="${basedir}/${CLIENT}" target="clean" />
<ant dir="${basedir}/${DESKTOP}" target="clean" />
<ant dir="${basedir}/${ADMIN}" target="clean" />
<ant dir="${basedir}/${API}" target="clean" />
<ant dir="${basedir}/${CORE}" target="clean" />
<ant dir="${basedir}/${DATA}" target="clean" />
<ant dir="${basedir}/${UISPARK}" target="clean" />
<ant dir="${basedir}/${UI}" target="clean" />
<ant dir="${basedir}/${SERVICES}" target="clean" />
<ant dir="${basedir}/${EXAMPLEPLUGIN}" target="clean" />
<ant dir="${basedir}/${SERVLETUTILS}" target="clean" />
</target>
<macrodef name="build-html-wrapper">
<attribute name="project"/>
<attribute name="swf"/>
<attribute name="title"/>
<sequential>
<copy file="${basedir}/@{project}/html-template/index.template.html"
tofile="${WEAVE_DESTROOT}/@{swf}.html" overwrite="true"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${title}" value="@{title}"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${swf}" value="@{swf}"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${width}" value="100%"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${height}" value="100%"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${bgcolor}" value="#FFFFFF"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${application}" value="@{swf}"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${version_major}" value="10"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${version_minor}" value="2"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${version_revision}" value="0"/>
<replace file="${WEAVE_DESTROOT}/@{swf}.html" token="$${expressInstallSwf}" value="playerProductInstall.swf"/>
</sequential>
</macrodef>
<macrodef name="extract_swc">
<attribute name="swc"/>
<attribute name="rsl"/>
<sequential>
<unzip src="@{swc}" dest="${WEAVE_DESTROOT}/temp">
<patternset>
<include name="library.swf" />
</patternset>
</unzip>
<move file="${WEAVE_DESTROOT}/temp/library.swf" tofile="${WEAVE_DESTROOT}/@{rsl}"/>
<delete dir="${WEAVE_DESTROOT}/temp"/>
</sequential>
</macrodef>
<macrodef name="buildproject">
<attribute name="targetproject"/>
<attribute name="targetfileext"/>
<sequential>
<echo message="Checking @{targetproject}..."/>
<uptodate targetfile="${basedir}/@{targetproject}/bin/@{targetproject}.@{targetfileext}" property="@{targetproject}.uptodate">
<srcfiles dir="${basedir}/@{targetproject}" includes="**/*"/>
</uptodate>
<antcall target="conditional_build">
<param name="targetproject" value="@{targetproject}"/>
</antcall>
</sequential>
</macrodef>
<target name="conditional_build" unless="${targetproject}.uptodate">
<sequential>
<echo message="Building ${targetproject}..."/>
<ant dir="${basedir}/${targetproject}" target="build"/>
</sequential>
</target>
</project>