* develop: Renamed Stories.render_action() to render_json_action() Added account image with link to https://gravatar.com Added HTML sanitizer for comments and stories. Fixes issue 64. Added button for easily adding a username to the troll filter Implemented “gaslighting” of troll comments, i.e. hiding a comment of a known troll for everyone else but themselves Removed misleading trailing “(Server)” from console output Fixes issue 143 Separated rendering of core and custom CSS with Less and added more detailed error output Improved display of console messages Added bottom margin after article meta in case there is no title Introduced another value for the color of borders, vertical and horizontal lines Conflicts: code/Global/0.node.js code/Global/Global.js code/Site/$Site.skin code/Story/$Story.skin code/Story/Story.js code/Story/Story.skin
338 lines
14 KiB
XML
338 lines
14 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
|
||
<!--
|
||
~ The Antville Project
|
||
~ http://code.google.com/p/antville
|
||
~
|
||
~ Copyright 2001-2014 by the Workers of Antville.
|
||
~
|
||
~ Copyright 2001–2007 Robert Gaggl, Hannes Wallnöfer, Tobi Schäfer,
|
||
~ Matthias & Michael Platzer, Christoph Lincke.
|
||
~
|
||
~ Licensed under the Apache License, Version 2.0 (the ``License'');
|
||
~ you may not use this file except in compliance with the License.
|
||
~ You may obtain a copy of the License at
|
||
~
|
||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||
~
|
||
~ Unless required by applicable law or agreed to in writing, software
|
||
~ distributed under the License is distributed on an ``AS IS'' BASIS,
|
||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
~ See the License for the specific language governing permissions and
|
||
~ limitations under the License.
|
||
-->
|
||
|
||
<project name="antville" default="usage" basedir=".">
|
||
<target name="help" depends="usage"/>
|
||
<target name="usage">
|
||
<echo message="Antville Build Instructions"/>
|
||
<echo message="==========================="/>
|
||
<echo message="Available targets are:"/>
|
||
<echo message=" all Generate the Antville and AntClick packages"/>
|
||
<echo message=" antclick Generate the AntClick packages"/>
|
||
<echo message=" antville Generate the Antville packages"/>
|
||
<echo message=" clean Clean up build directory"/>
|
||
<echo message=" client Build client-side scripts and styles"/>
|
||
<echo message=" docs Generate the API documentation"/>
|
||
<echo message=" messages Generate JavaScript message files"/>
|
||
<echo message=" patch Apply patch file to Antville installation"/>
|
||
<echo message=" pot Extract gettext call strings into POT file"/>
|
||
<echo message=" +patch Scaffolds a new patch, ready for implementation"/>
|
||
<echo message=" +trail Scaffolds a new trail, ready for implementation"/>
|
||
<echo message=" usage Show these build instructions (default)"/>
|
||
</target>
|
||
|
||
<target name="all" depends="antville, antclick"/>
|
||
|
||
<target name="init">
|
||
<tstamp>
|
||
<format property="date" pattern="d MMM yyyy" locale="en"/>
|
||
</tstamp>
|
||
<tstamp>
|
||
<format property="file-date" pattern="yyyyMMdd" locale="en"/>
|
||
</tstamp>
|
||
|
||
<property name="name" value="antville"/>
|
||
<property name="year" value="1998-${year}"/>
|
||
<property name="version" value="1.5"/>
|
||
<property name="package.name" value="${name}-${version}"/>
|
||
|
||
<property name="antville.src" value="https://code.google.com/p/antville"/>
|
||
<property name="helma.src" value="https://github.com/p3k/helma.git"/>
|
||
<property name="apps.src" value="https://github.com/p3k/helma-apps.git"/>
|
||
<property name="jala.src" value="https://github.com/p3k/helma-jala.git"/>
|
||
|
||
<property name="uikit.dir" location="./node_modules/uikit-bower"/>
|
||
|
||
<property name="build.dir" location="${basedir}/build"/>
|
||
<property file="${build.dir}/build.properties"/>
|
||
|
||
<property name="helma.dir" location="/opt/helma"/>
|
||
<property name="extra.dir" location="${build.dir}/extra"/>
|
||
<property name="dist.dir" location="${build.dir}/dist"/>
|
||
<property name="work.dir" location="${build.dir}/work"/>
|
||
<property name="source.dir" location="${work.dir}/src"/>
|
||
<property name="export.dir" location="${work.dir}/export"/>
|
||
<property name="modules.dir" location="${export.dir}/helma/modules"/>
|
||
<property name="antville.dir" location="${export.dir}/antville"/>
|
||
<property name="hopkit.dir" location="${helma.dir}/modules/jala/util/HopKit"/>
|
||
<property name="trails.dir" location="${antville.dir}/trails"/>
|
||
|
||
<property name="docs.title" value="Antville&#32;${version}&#32;API&#32;Reference"/>
|
||
<property name="docs.infiles" location="${basedir}/code"/>
|
||
<property name="docs.outfiles" location="${basedir}/docs"/>
|
||
|
||
<property name="i18n.scan" value="claustra code compat extra"/>
|
||
<property name="i18n.destination" location="${basedir}/i18n"/>
|
||
<property name="i18n.poDirectory" location="${i18n.destination}"/>
|
||
<property name="i18n.template" location="${i18n.destination}/antville.pot"/>
|
||
<property name="i18n.namespace" value=""/>
|
||
</target>
|
||
|
||
<target name="export" depends="init">
|
||
<mkdir dir="${source.dir}"/>
|
||
<exec dir="${source.dir}" executable="git">
|
||
<arg line="clone ${antville.src}"/>
|
||
</exec>
|
||
<exec dir="${source.dir}/antville" executable="git">
|
||
<arg line="checkout-index -f -a --prefix=${antville.dir}/"/>
|
||
</exec>
|
||
<delete includeemptydirs="true">
|
||
<fileset dir="${antville.dir}" includes="build.xml build/** docs/** i18n/*.po*"/>
|
||
</delete>
|
||
<exec dir="${source.dir}/antville" executable="git" outputproperty="hash">
|
||
<arg line="rev-parse --short HEAD"/>
|
||
</exec>
|
||
<replace file="${antville.dir}/code/Root/Root.js" value="${version}">
|
||
<replacetoken><![CDATA[<v>0</v>]]></replacetoken>
|
||
</replace>
|
||
<replace file="${antville.dir}/code/Root/Root.js" value="${hash}">
|
||
<replacetoken><![CDATA[<h>0</h>]]></replacetoken>
|
||
</replace>
|
||
<replace file="${antville.dir}/code/Root/Root.js" value="${date}">
|
||
<replacetoken><![CDATA[<d/>]]></replacetoken>
|
||
</replace>
|
||
</target>
|
||
|
||
<target name="ville" depends="antville"/>
|
||
<target name="click" depends="antclick"/>
|
||
|
||
<target name="antville" depends="export">
|
||
<antcall target="make-tar">
|
||
<param name="filename" value="${package.name}"/>
|
||
<param name="path" value="${antville.dir}"/>
|
||
</antcall>
|
||
<antcall target="make-zip">
|
||
<param name="filename" value="${package.name}"/>
|
||
<param name="path" value="${antville.dir}"/>
|
||
</antcall>
|
||
</target>
|
||
|
||
<target name="antclick" depends="export">
|
||
<!-- Export the Helma and Jala repositories to a temporary directory -->
|
||
<exec dir="${source.dir}" executable="git">
|
||
<arg line="clone ${helma.src}"/>
|
||
</exec>
|
||
<exec dir="${source.dir}" executable="git">
|
||
<arg line="clone ${jala.src}"/>
|
||
</exec>
|
||
|
||
<!-- Checkout each repostory index to the export directory -->
|
||
<mkdir dir="${export.dir}"/>
|
||
<exec dir="${source.dir}/helma" executable="git">
|
||
<arg line="checkout-index -f -a --prefix=${export.dir}/helma/"/>
|
||
</exec>
|
||
<exec dir="${source.dir}/helma-jala" executable="git">
|
||
<arg line="checkout-index -f -a --prefix=${export.dir}/helma/modules/jala/"/>
|
||
</exec>
|
||
|
||
<!-- Copy exported files to final destinations -->
|
||
<copy todir="${work.dir}">
|
||
<fileset dir="${export.dir}/helma" includes="lib/** licenses/**"/>
|
||
</copy>
|
||
<copy todir="${work.dir}/apps/antville">
|
||
<fileset dir="${antville.dir}"/>
|
||
</copy>
|
||
<copy todir="${work.dir}/modules">
|
||
<fileset dir="${modules.dir}" includes="core/** helma/** jala/**"/>
|
||
</copy>
|
||
|
||
<!-- Copy extra files to final destinations -->
|
||
<copy file="${export.dir}/helma/license.txt" tofile="${work.dir}/licenses/helma.txt"/>
|
||
<copy todir="${work.dir}">
|
||
<fileset dir="${extra.dir}" includes="start.bat apps.properties server.properties launcher.jar"/>
|
||
</copy>
|
||
<exec dir="${extra.dir}" executable="cp">
|
||
<arg line="-p start.sh ${work.dir}"/>
|
||
</exec>
|
||
|
||
<copy file="${extra.dir}/helma.jar" todir="${work.dir}/lib"/>
|
||
<copy file="${extra.dir}/h2-1.3.155.jar" todir="${work.dir}/lib/ext"/>
|
||
<copy file="${extra.dir}/h2.txt" todir="${work.dir}/licenses"/>
|
||
|
||
<copy todir="${build.dir}/work/db">
|
||
<fileset dir="${extra.dir}" includes="antville.h2.db"/>
|
||
</copy>
|
||
<copy todir="${work.dir}/licenses">
|
||
<fileset dir="${antville.dir}/legal" includes="**"/>
|
||
</copy>
|
||
<copy file="${modules.dir}/jala/licenses/jala.txt" todir="${work.dir}/licenses"/>
|
||
|
||
<!-- Delete unnecessary files -->
|
||
<delete>
|
||
<fileset dir="${work.dir}/modules/helma" includes="*.jar Search.js Ssh.js Chart.js"/>
|
||
</delete>
|
||
<delete includeemptydirs="true">
|
||
<fileset dir="${work.dir}/modules/jala" includes="build.properties docs/** lib/** licenses/** tests/** util/**"/>
|
||
</delete>
|
||
<delete dir="${work.dir}/apps/antville/legal"/>
|
||
<delete dir="${source.dir}"/>
|
||
<delete dir="${export.dir}"/>
|
||
|
||
<!-- Create the packages -->
|
||
<antcall target="make-zip">
|
||
<param name="filename" value="antclick-${version}"/>
|
||
<param name="path" value="${work.dir}"/>
|
||
</antcall>
|
||
<antcall target="make-tar">
|
||
<param name="filename" value="antclick-${version}"/>
|
||
<param name="path" value="${work.dir}"/>
|
||
</antcall>
|
||
</target>
|
||
|
||
<target name="client" depends="init">
|
||
<copy todir="static/fonts">
|
||
<fileset dir="${uikit.dir}/fonts" includes="**"/>
|
||
</copy>
|
||
<mkdir dir="static/scripts"/>
|
||
<exec executable="node_modules/.bin/browserify" output="static/scripts/main.min.js">
|
||
<arg line="build/client/main.js -d -p [minifyify --map /static/scripts/main.min.map.json --output static/scripts/main.min.map.json]"/>
|
||
</exec>
|
||
<exec executable="node_modules/.bin/browserify" output="static/scripts/editor.min.js">
|
||
<arg line="build/client/editor.js -d -p [minifyify --map /static/scripts/editor.min.map.json --output static/scripts/editor.min.map.json]"/>
|
||
</exec>
|
||
<mkdir dir="static/styles"/>
|
||
<exec executable="node_modules/.bin/lessc" output="static/styles/main.min.css">
|
||
<arg line="-x build/client/main.less"/>
|
||
</exec>
|
||
<exec executable="node_modules/.bin/lessc" output="static/styles/editor.min.css">
|
||
<arg line="--clean-css build/client/editor.less"/>
|
||
</exec>
|
||
</target>
|
||
|
||
<target name="server" depends="init">
|
||
<exec executable="node_modules/.bin/browserify" output="code/Global/0.node.js">
|
||
<arg line="build/server.js -d"/>
|
||
</exec>
|
||
<concat destfile="code/Global/0.node.js" append="true">
|
||
<fileset file="node_modules/less/dist/less-rhino-1.7.5.js"/>
|
||
<fileset file="node_modules/marked/lib/marked.js"/>
|
||
</concat>
|
||
</target>
|
||
|
||
<target name="docs" depends="init">
|
||
<exec dir="${build.dir}/jsdoc/toolkit" executable="${build.dir}/jsdoc/jsrunwrapper.sh">
|
||
<arg line='-D="title:${docs.title}" -q -r=2 -p -t=../templates/codeview
|
||
-d=${docs.outfiles} ${docs.infiles}'/>
|
||
</exec>
|
||
</target>
|
||
|
||
<target name="pot" depends="init">
|
||
<java dir="${helma.dir}" classpath="${helma.dir}/launcher.jar" classname="helma.main.launcher.Commandline"
|
||
fork="true">
|
||
<!-- Root.extractMessages is currently located in Global/i18n.js -->
|
||
<arg value="antville.extractMessages"/>
|
||
<arg value="${build.dir}/MessageParser.js"/>
|
||
<arg value="${i18n.scan}"/>
|
||
<arg value="${i18n.template}"/>
|
||
</java>
|
||
</target>
|
||
|
||
<target name="messages" depends="init">
|
||
<java dir="${helma.dir}" classpath="${helma.dir}/lib/rhino.jar"
|
||
classname="org.mozilla.javascript.tools.shell.Main">
|
||
<arg value="${build.dir}/PoParser.js"/>
|
||
<arg value="${i18n.poDirectory}"/>
|
||
<arg value="${i18n.destination}"/>
|
||
<arg value="${i18n.namespace}"/>
|
||
</java>
|
||
</target>
|
||
|
||
<target name="make-tar" depends="init">
|
||
<mkdir dir="${dist.dir}"/>
|
||
<fixcrlf srcdir="${path}" eol="lf" eof="remove" includes="**/*.txt,
|
||
**/*.properties, **/*.hac, **/*.js, **/*.skin, **/.xml, **/.sh"/>
|
||
<tar tarfile="${dist.dir}/${filename}.tar" basedir="${path}" excludes="**">
|
||
<tarfileset prefix="${filename}" dir="${path}" mode="755">
|
||
<include name="**/*.sh"/>
|
||
</tarfileset>
|
||
<tarfileset prefix="${filename}" dir="${path}">
|
||
<include name="**"/>
|
||
<exclude name="**/*.sh"/>
|
||
</tarfileset>
|
||
</tar>
|
||
<bzip2 zipfile="${dist.dir}/${filename}.tbz" src="${dist.dir}/${filename}.tar"/>
|
||
<delete file="${dist.dir}/${filename}.tar"/>
|
||
</target>
|
||
|
||
<target name="make-zip" depends="init">
|
||
<mkdir dir="${dist.dir}"/>
|
||
<fixcrlf srcdir="${path}" eol="crlf" includes="**/*.txt, **/*.properties, **/*.hac, **/*.js, **/*.skin, **/*.xml, **/.bat"/>
|
||
<zip zipfile="${dist.dir}/${filename}.zip">
|
||
<zipfileset dir="${path}" prefix="${filename}" includes="**"/>
|
||
</zip>
|
||
</target>
|
||
|
||
<target name="patch" depends="init">
|
||
<input message="Please enter the patch ID: " addproperty="patch.id"/>
|
||
<loadfile property="patch" srcFile="${basedir}/extra/updater/patch-${patch.id}.js"/>
|
||
<echo message="${patch}"/>
|
||
<input message="Apply the displayed patch? " validargs="y,n" addproperty="patch.confirm"/>
|
||
<condition property="patch.abort">
|
||
<equals arg1="${patch.confirm}" arg2="n" casesensitive="false" trim="true"/>
|
||
</condition>
|
||
<fail if="patch.abort">Build aborted by user.</fail>
|
||
<java dir="${helma.dir}" classpath="${helma.dir}/launcher.jar" classname="helma.main.launcher.Commandline" fork="true">
|
||
<arg value="antville.patch"/>
|
||
<arg value="${patch}"/>
|
||
</java>
|
||
</target>
|
||
|
||
<target name="+patch" depends="init">
|
||
<property name="patch.dir" value="extra/updater"/>
|
||
<echo file="${patch.dir}/patch-${file-date}.js">// Apply with enabled updater repository using `ant patch -Dpatch.id=${file-date}`${line.separator}<!--
|
||
-->var sql = new Sql();
|
||
</echo>
|
||
</target>
|
||
|
||
<target name="+trail" depends="init">
|
||
<property name="trail.dir" value="trails/${trail.name}/${trail.title}"/>
|
||
<input message="Please enter the name of the trail: " addproperty="trail.name"/>
|
||
<script language="javascript"><![CDATA[
|
||
name = project.getProperty('trail.name');
|
||
firstLetter = name.substr(0, 1).toUpperCase();
|
||
title = firstLetter + name.substr(1);
|
||
project.setProperty('trail.title', title);
|
||
]]></script>
|
||
<mkdir dir="${trail.dir}"/>
|
||
<echo file="${trail.dir}/${trail.title}.properties" append="true">#sites = collection(Site)</echo>
|
||
<echo file="${trail.dir}/${trail.title}.js" append="true">${trail.title}.prototype.main_action = function () {${line.separator}<!--
|
||
--> //res.debug(this.sites.count());${line.separator}<!--
|
||
-->};${line.separator}</echo>
|
||
<mkdir dir="${trail.dir}/../Trails"/>
|
||
<echo file="${trail.dir}/../Trails/Trails.properties" append="true">${trail.name} = mountpoint(${trail.title})${line.separator}</echo>
|
||
</target>
|
||
|
||
<target name="clean" depends="init">
|
||
<delete dir="${work.dir}"/>
|
||
<delete dir="${dist.dir}"/>
|
||
</target>
|
||
|
||
<target name="file-exists" unless="file.exists">
|
||
<available property="file.exists" file="${file}"/>
|
||
</target>
|
||
|
||
<target name="debug" depends="init">
|
||
<!-- For debugging and testing purposes -->
|
||
</target>
|
||
</project>
|