<commit_before><?xml version="1.0"?>
<!--
 * kinoath.xml
 * Created on 10 September 2008, 10:03
 * Modified on 21 September 2011, 14:27
 * @author <EMAIL>
-->
<project name="KinOath" default="scp_to_lux09">
    <target name="setproperties">
        <property name="kinoath.current.major" value="0"/>
        <property name="kinoath.current.minor" value="0"/>
        <property name="kinoath.filenameidentifier" value="-testing"/>
        <property name="kinoath.application-title" value="KinOath (testing)"/>
        <property name="kinoath.icon-file-name" value="kinoath${kinoath.filenameidentifier}128x128"/>
        <property name="SRCDIR" value="../desktop/src/main/java/"/>
        <property name="IconsDir" value="../desktop/src/main/resources/nl/mpi/kinnate/resources/icons/"/>
        <property name="OUTPUTDIR" value="${user.home}/Desktop/kinoath-build-${kinoath.current.major}.${kinoath.current.minor}.x/"/>
        <property name="ClassesDir" value="../desktop/target/classes"/>
        <property name="LIBDIR" value="${OUTPUTDIR}lib/"/>
        <property name="pathToMpiTrunk" value="../../../trunk/"/> <!-- pathToMpiTrunk is being used until a better method becomes available (such as when the required files are in a maven like repository) -->
        <property name="LongDescription" value="KinOath is a kinship application with the primary goal of connecting kinship data with archived data, such as audio, video or written resources while also being closely integrated with the archive software such as Arbil. Beyond this primary goal it is designed to be flexible and culturally nonspecific, such that culturally different social structures can equally be represented. Kin type strings are used throughout the application for constructing and searching data sets. The representation of kin terms is also integrated into the application allowing comparative diagrams of kin terms. Graphical representation of the data is an important part of the application and the diagrams produced are intended to very flexible and of publishable quality.
http://www.lat-mpi.eu/tools/imdi/kinoath/"/>
        <property name="ShortDescription" value="KinOath is a kinship application that is flexible, culturally nonspecific and produces diagrams of publishable quality."/>
    </target>
    <target name="clean" description="remove all artifact files" depends="setproperties">
        <delete dir="${OUTPUTDIR}"/>
        <mkdir dir="${OUTPUTDIR}"/>
    </target>
<!-- start package creation -->
    <path id="ant-deb.classpath">
        <fileset dir="../desktop/ant-deb-jar/" includes="*.jar"/>
    </path>
    <!-- http://code.google.com/p/ant-deb-task/ -->
    <taskdef name="deb" classname="com.googlecode.ant_deb_task.Deb" classpathref="ant-deb.classpath"/>
    <taskdef name="desktopEntry" classname="com.googlecode.ant_deb_task.DesktopEntry" classpathref="ant-deb.classpath"/>
    <target name="makeDebPackage" depends="signkinoath" description="build the deb file">
        <property name="package.name" value="kinoath${kinoath.filenameidentifier}"/>
        <property name="package.jarname" value="${DistJarName}"/>
        <!--check that the icon exists and fail if not-->
        <available file="${IconsDir}${kinoath.icon-file-name}.png" property="packageIconAvail"/>
        <fail unless="packageIconAvail" message="${kinoath.icon-file-name}.png doesn't exist!"/>
        <property name="distributionDirectory" value="${OUTPUTDIR}/distribution"/>
        <mkdir dir="${distributionDirectory}"/>
        <desktopEntry
            toFile="${distributionDirectory}/${package.name}.desktop"
            name="${kinoath.application-title}"
            comment="${ShortDescription}"
            exec="java -jar /usr/share/${package.name}/${package.jarname}"
            path="/usr/share/${package.name}/"
            icon="/usr/share/${package.name}/${kinoath.icon-file-name}.png"
            categories="Science;Education;Java"
        />
        <deb
            todir="${distributionDirectory}"
            package="${package.name}"
            section="science"
            depends="sun-java5-jre | sun-java6-jre, ffmpeg, imagemagick"            
        > <!-- homepage="http://www.lat-mpi.eu/tools/kinoath" deb doesn't support the "homepage" attribute -->
            <version upstream="${kinoath.current.major}.${kinoath.current.minor}" debian="${kinoath.current.revision}"/>
            <maintainer name="<NAME>" email="<EMAIL>"/>
            <description synopsis="${ShortDescription}">${LongDescription}</description>
            <tarfileset file="${OUTPUTDIR}/${package.jarname}" prefix="usr/share/${package.name}"/>
            <tarfileset file="${IconsDir}${kinoath.icon-file-name}.png" prefix="usr/share/${package.name}"/>
            <tarfileset dir="${LIBDIR}" prefix="usr/share/${package.name}/lib">
                <include name="*.jar"/>
            </tarfileset>
            <tarfileset file="${distributionDirectory}/${package.name}.desktop" prefix="usr/share/applications/"/>
        </deb>
    </target>
<!-- end package creation -->
    <target name="updateJnlpAndAppletHtml" depends="clean, getsvnversion">
<!--todo: the jar name should have the kinoath.filenameidentifier included-->
        <macrodef name="updateSingleFile">
            <attribute name="fileName"/>
            <sequential>
                <copy overwrite="true" file="./templates/@{fileName}.template" tofile="${OUTPUTDIR}/distribution/@{fileName}">
                    <filterchain>
                        <replacetokens>
                            <token key="VersionNumber" value="${kinoath.current.major}-${kinoath.current.minor}-${kinoath.current.revision}"/>
                            <token key="DistJarName" value="${DistJarName}"/>
                            <token key="BuildDirectory" value="kinoath-build-${kinoath.current.major}.${kinoath.current.minor}.x"/>
                            <token key="InstalledIcon" value="${kinoath.icon-file-name}"/>
                            <token key="TypeCheckVersion" value="${TypeCheckVersion}"/>
                            <token key="FilenameIdentifier" value="${kinoath.filenameidentifier}"/>
                            <token key="ApplicationTitle" value="${kinoath.application-title}"/>
                            <token key="LongDescription" value="${LongDescription}"/>
                            <token key="ShortDescription" value="${ShortDescription}"/>
                            <token key="DistName" value="kinoath"/>
                            <token key="AppName" value="KinOath"/>
                            <token key="MainClass" value="nl.mpi.kinnate.ui.MainFrame"/>
                        </replacetokens>
                    </filterchain>
                </copy>
            </sequential>
        </macrodef>
        <updateSingleFile fileName="kinoath.jnlp"/>
        <updateSingleFile fileName="win-installer.iss"/>
        <updateSingleFile fileName="Info.plist"/>
        <updateSingleFile fileName="start"/>
        <copy file="${OUTPUTDIR}/distribution/kinoath.jnlp" tofile="${SRCDIR}/JNLP-INF/application.jnlp"/>
    </target>
    <target name="buildWindowsInstaller" depends="signkinoath">
        <!--check that the icon exists and fail if not-->
        <available file="${IconsDir}${kinoath.icon-file-name}.ico" property="installedIconAvail"/>
        <fail unless="installedIconAvail" message="${kinoath.icon-file-name}.ico doesn't exist!"/>
        <mkdir dir="${OUTPUTDIR}/distribution-win32/temp/"/>
        <copy todir="${OUTPUTDIR}/distribution-win32/temp/">
            <fileset dir="${IconsDir}" includes="*.ico"/>
        </copy>
        <!--get unzip then delete the imagemagick jar-->
<!--        <get src="http://www.mpi.nl/tg/j2se/jnlp/kinoath/lib/ImageMagick-6.5.9-Win32.jar" dest="${OUTPUTDIR}/ImageMagick-6.5.9-Win32.jar"/>
        <unzip src="${OUTPUTDIR}/ImageMagick-6.5.9-Win32.jar" dest="${OUTPUTDIR}/distribution-win32/temp/ImageMagick"/>
        <delete file="${OUTPUTDIR}/ImageMagick-6.5.9-Win32.jar"/>
        <delete dir="${OUTPUTDIR}/distribution-win32/temp/ImageMagick/META-INF"/>-->
        <exec dir="${OUTPUTDIR}" executable="wine" ><!--os="Windows NT"-->
            <arg line='"C:\Program Files\Inno Setup 5\iscc.exe" ./distribution/win-installer.iss'/>
        </exec>
        <delete dir="${OUTPUTDIR}/distribution-win32/kinoath${kinoath.filenameidentifier}-installer.zip"/>
        <zip destfile="${OUTPUTDIR}/distribution-win32/kinoath${kinoath.filenameidentifier}-installer.zip" >
            <file file="${OUTPUTDIR}/distribution-win32/kinoath-installer-${kinoath.current.major}-${kinoath.current.minor}-${kinoath.current.revision}.exe"/>
        </zip>
        <available file="${OUTPUTDIR}/distribution-win32/kinoath${kinoath.filenameidentifier}-installer.zip" property="installerZipMissing"/>
        <fail unless="installerZipMissing" message="kinoath${kinoath.filenameidentifier}-installer.zip doesn't exist! Is Inno Setup installed inside wine?"/>
    </target>
    <target name="buildMacInstaller" depends="signkinoath">
        <!--check that the icon exists and fail if not-->
        <available file="${IconsDir}kinoath${kinoath.filenameidentifier}.icns" property="installedIconAvail"/>
        <fail unless="installedIconAvail" message="kinoath${kinoath.filenameidentifier}.icns doesn't exist!"/>
        <copy file="${OUTPUTDIR}/distribution/Info.plist" todir="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}.app/Contents/"/>
        <copy file="${OUTPUTDIR}/distribution/start" todir="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}.app/Contents/MacOS/"/>
        <copy file="${IconsDir}kinoath${kinoath.filenameidentifier}.icns" todir="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}.app/Contents/Resources/"/>
        <copy file="${OUTPUTDIR}/${DistJarName}" todir="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}.app/Contents/MacOS/"/>
        <copy todir="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}.app/Contents/MacOS/lib/">
            <fileset dir="${OUTPUTDIR}/lib/" includes="*.jar"/>
        </copy>
        <chmod file="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}.app/Contents/MacOS/start" perm="a+xr"/>
        <tar destfile="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}-mac.tar">
            <tarfileset dir="${OUTPUTDIR}/distribution-mac/" filemode="755" username="ant" group="ant">
                <include name="kinoath${kinoath.filenameidentifier}.app/Contents/MacOS/start"/>
            </tarfileset>
            <tarfileset dir="${OUTPUTDIR}/distribution-mac/" filemode="664" username="ant" group="ant">
                <include name="kinoath${kinoath.filenameidentifier}.app/**"/>
                <exclude name="kinoath${kinoath.filenameidentifier}.app/Contents/MacOS/start"/>
            </tarfileset>
        </tar>
    </target>
    <target name="getsvnversion" depends="setproperties">
       <!-- <exec executable="svn" output="version.info">
            <arg value="info"/>
        </exec>
        <exec executable="grep" output="version.date">-->
            <!--<arg value="^Revision"/>-->
           <!-- <arg value="^Last Changed Date:"/>
            <arg value="version.info"/>
        </exec>-->
        <!--<exec executable="date" output="version.date" />-->
        <exec outputproperty="kinoath.current.revision" executable="svnversion">
            <arg line="-n -c" />
            <arg line="${SRCDIR}nl/mpi/kinnate/" />
            <redirector>
                <outputfilterchain>
                    <tokenfilter>
                        <replaceregex pattern="^[0-9]*:" replace="" flags="g"/>
                        <replaceregex pattern="[^0-9]*" replace="" flags="g"/>
                    </tokenfilter>
                </outputfilterchain>
            </redirector>
        </exec>
        <exec outputproperty="kinoath.info.all" executable="svn">
            <arg line="info" />
            <arg line="${SRCDIR}nl/mpi/kinnate/" />
            <redirector>
                <outputfilterchain>
                    <tokenfilter>
                        <replaceregex pattern="^" replace="\\\\n" flags="g"/>
                    </tokenfilter>
                    <striplinebreaks/>
                </outputfilterchain>
            </redirector>
        </exec>
        <exec outputproperty="kinoath.last.commit.date" executable="svn">
            <arg line="info" />
            <arg line="${SRCDIR}nl/mpi/kinnate/" />
            <redirector>
                <outputfilterchain>
                    <linecontainsregexp>
                        <regexp pattern="^Last Changed Date:" />
                    </linecontainsregexp>
                    <tokenfilter>
                        <replaceregex pattern=".*\/([^\/]+)$" replace="\1" flags="g"/>
                    </tokenfilter>
                </outputfilterchain>
            </redirector>
        </exec>
        <exec outputproperty="kinoath.build.date" executable="date" />
        <echo file="${SRCDIR}nl/mpi/kinnate/KinOathVersion.java" append="false">package nl.mpi.kinnate;

import nl.mpi.arbil.util.ApplicationVersion;

public class KinOathVersion extends ApplicationVersion {

    /**
     * GENERATED BY ANT - DO NOT EDIT. See the arbil.xml build script.
     */
    public KinOathVersion() {
    	applicationTitle = "${kinoath.application-title}";
    	applicationIconName = "/nl/mpi/kinnate/resources/icons/${kinoath.icon-file-name}.png";
    	currentMajor = "${kinoath.current.major}";
    	currentMinor = "${kinoath.current.minor}";
    	currentRevision = "${kinoath.current.revision}";
	lastCommitDate = "${kinoath.last.commit.date}";
	compileDate = "${kinoath.build.date}";
	fullInfo = "${kinoath.info.all}";
    	currentVersionFile = "http://www.mpi.nl/tg/j2se/jnlp/kinoath/kinoath${kinoath.filenameidentifier}-current.txt";
    }
}
        </echo>
        <property name="KinOathJarPrefix" value="kinoath${kinoath.filenameidentifier}-${kinoath.current.major}-${kinoath.current.minor}-${kinoath.current.revision}"/>
        <property name="DistJarName" value="${KinOathJarPrefix}.jar"/>
    </target>
    <target name="signkinoath" depends="maven-jar">
        <input message="Please enter the latsoftware password:" addproperty="latsoftware.pw">
            <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
        </input>
        <signjar keystore="${pathToMpiTrunk}cert/mpi.keystore"
        alias="latsoftware's max-planck-gesellschaft id" storepass="${<PASSWORD>}">
            <path>
                <fileset dir="${OUTPUTDIR}/lib" includes="**/*.jar" />
            </path>
        </signjar>
        <signjar jar="${OUTPUTDIR}/${DistJarName}"
        keystore="${pathToMpiTrunk}cert/mpi.keystore"
        alias="latsoftware's max-planck-gesellschaft id" storepass="${lat<PASSWORD>}" />
    </target>
   <!-- <target name="image" depends="setproperties">
        <signjar jar="${OUTPUTDIR}/lib/typecheck-1.5.16185.jar"
        keystore="${SRCDIR}/../../../trunk/cert/mpi.keystore"
        alias="latsoftware's max-planck-gesellschaft id" storepass="<PASSWORD>" />
    </target> -->
    <target name="GetTracTodoList" depends="getsvnversion, GetLoginData">
<!--        todo: add another file for the rss feed of completed tasks-->        
        <property name="TodoListFile" value="${OUTPUTDIR}/distribution/kinoath${kinoath.filenameidentifier}_${kinoath.current.major}.${kinoath.current.minor}-${kinoath.current.revision}_todo.csv"/>
        <get src="https://trac.mpi.nl/query?status=accepted&amp;status=assigned&amp;status=new&amp;status=reopened&amp;component=KinOath-desktop&amp;component=KinOath-web&amp;format=csv&amp;max=1000&amp;col=id&amp;col=summary&amp;col=component&amp;report=24&amp;order=summary"
    dest="${TodoListFile}"
    username="${lux09.user}"
    password="${<PASSWORD>}"/>
        <scp file="${TodoListFile}" todir="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/"/>
        <scp file="${TodoListFile}" todir="${<EMAIL>.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/kinoath-all_todo.csv"/> <!-- ${kinoath.filenameidentifier}-->
    </target>
    <target name="GetLoginData">
        <input message="Please enter lux09 username:" addproperty="lux09.user" />
        <input message="Please enter lux09 password:" addproperty="lux09.pw">
            <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
        </input>
    </target>
    <target name="scp_to_lux09" depends="makeDebPackage, buildWindowsInstaller, buildMacInstaller, GetLoginData, GetTracTodoList">
        <echo file="${OUTPUTDIR}/kinoath${kinoath.filenameidentifier}-current.txt">${kinoath.current.revision}</echo>
        <scp file="${OUTPUTDIR}/${DistJarName}" todir="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/"/>
        <!-- the lib direcory only needs to be updated when there is a real change so can be commented out to save build time -->
        <scp todir="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/lib">
            <fileset dir="${OUTPUTDIR}/lib"/>
        </scp>
        <scp file="${IconsDir}${kinoath.icon-file-name}.png" todir="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/"/>
        <!-- push the updated the applet html and the kinoath jnlp files to the server -->
        <scp file="${OUTPUTDIR}/distribution/kinoath.jnlp" remoteTofile="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/kinoath${kinoath.filenameidentifier}.jnlp"/>
        <scp file="${OUTPUTDIR}/distribution/kinoath.jnlp" remoteTofile="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/kinoath${kinoath.filenameidentifier}_${kinoath.current.major}.${kinoath.current.minor}-${kinoath.current.revision}.jnlp"/>
<!--        <scp file= "${BUILDDIR}/kinoath-applet.html" remoteTofile="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/kinoath-applet${kinoath.filenameidentifier}.html"/>-->
        <!-- push the deb package -->
        <scp file="${distributionDirectory}/kinoath${kinoath.filenameidentifier}_${kinoath.current.major}.${kinoath.current.minor}-${kinoath.current.revision}_all.deb" todir="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/"/>
        <scp file="${distributionDirectory}/kinoath${kinoath.filenameidentifier}_${kinoath.current.major}.${kinoath.current.minor}-${kinoath.current.revision}_all.deb" remoteTofile="${<EMAIL>.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/kinoath${kinoath.filenameidentifier}.deb"/>
        <!-- push the windows installer -->
        <scp file="${OUTPUTDIR}/distribution-win32/kinoath${kinoath.filenameidentifier}-installer.zip" todir="${lux09.user}:${lux<EMAIL>}@lux09.mpi.nl:/data/extweb1/docs/TG/j2se/jnlp/kinoath/"/>
        <scp file="${OUTPUTDIR}/distribution-win32/kinoath${kinoath.filenameidentifier}-installer.zip" todir="${<EMAIL>.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/kinoath${kinoath.filenameidentifier}_${kinoath.current.major}.${kinoath.current.minor}-${kinoath.current.revision}-win-installer.zip"/>
        <!-- push the mac installer -->
        <scp file="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}-mac.tar" todir="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/"/>
        <scp file="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}-mac.tar" todir="${<EMAIL>9.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/kinoath${kinoath.filenameidentifier}_${kinoath.current.major}.${kinoath.current.minor}-${kinoath.current.revision}-mac.tar"/>
        <!-- only after all the installers have been pushed do we update the version text file -->
        <scp file="${OUTPUTDIR}/kinoath${kinoath.filenameidentifier}-current.txt" todir="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/"/>
        <!-- copy the current version of allversionslisting.php to make sure it gets kept in svn -->
        <scp file="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/allversionslisting.php" todir="../desktop/src/main/php/" />
        <scp file="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/todolisttable.php" todir="../desktop/src/main/php/" />
    </target>
    <target name="maven-jar" depends="updateJnlpAndAppletHtml">
        <!-- while this could be done in a maven ant task, this method appears more portable at this stage -->
        <exec dir="../desktop/" executable="mvn">
            <arg line="clean install" />
            <arg line="-Doutput.jarname=${KinOathJarPrefix}"/>
            <arg line="-Doutput.directory=${OUTPUTDIR}"/>
        </exec>
    </target>
    <target name="maven-deploy" depends="getsvnversion">
        <!-- while this could be done in a maven and task, this method appears more portable at this stage -->
        <exec executable="mvn">
            <arg line="install:install-file" />
            <arg line="-Dfile=${OUTPUTDIR}/${DistJarName}" />
            <arg line="-DgroupId=nl.mpi" />
            <arg line="-DartifactId=kinoath" />
            <arg line="-Dversion=${kinoath.current.major}.${kinoath.current.minor}.${kinoath.current.revision}" />
            <arg line="-Dpackaging=jar" />
            <arg line="-DpomFile=../desktop/pom.xml" />
            <!-- -DgeneratePom=true -->
        </exec>
    </target>
</project>
 
<commit_msg>Branched current state to kinnate.0.6.x<commit_after><?xml version="1.0"?>
<!--
 * kinoath.xml
 * Created on 10 September 2008, 10:03
 * Modified on 21 September 2011, 14:27
 * @author <EMAIL>
-->
<project name="KinOath" default="scp_to_lux09">
    <target name="setproperties">
        <property name="kinoath.current.major" value="0"/>
        <property name="kinoath.current.minor" value="7"/>
        <property name="kinoath.filenameidentifier" value="-testing"/>
        <property name="kinoath.application-title" value="KinOath (testing)"/>
        <property name="kinoath.icon-file-name" value="kinoath${kinoath.filenameidentifier}128x128"/>
        <property name="SRCDIR" value="../desktop/src/main/java/"/>
        <property name="IconsDir" value="../desktop/src/main/resources/nl/mpi/kinnate/resources/icons/"/>
        <property name="OUTPUTDIR" value="${user.home}/Desktop/kinoath-build-${kinoath.current.major}.${kinoath.current.minor}.x/"/>
        <property name="ClassesDir" value="../desktop/target/classes"/>
        <property name="LIBDIR" value="${OUTPUTDIR}lib/"/>
        <property name="pathToMpiTrunk" value="../../../trunk/"/> <!-- pathToMpiTrunk is being used until a better method becomes available (such as when the required files are in a maven like repository) -->
        <property name="LongDescription" value="KinOath is a kinship application with the primary goal of connecting kinship data with archived data, such as audio, video or written resources while also being closely integrated with the archive software such as Arbil. Beyond this primary goal it is designed to be flexible and culturally nonspecific, such that culturally different social structures can equally be represented. Kin type strings are used throughout the application for constructing and searching data sets. The representation of kin terms is also integrated into the application allowing comparative diagrams of kin terms. Graphical representation of the data is an important part of the application and the diagrams produced are intended to very flexible and of publishable quality.
http://www.lat-mpi.eu/tools/imdi/kinoath/"/>
        <property name="ShortDescription" value="KinOath is a kinship application that is flexible, culturally nonspecific and produces diagrams of publishable quality."/>
    </target>
    <target name="clean" description="remove all artifact files" depends="setproperties">
        <delete dir="${OUTPUTDIR}"/>
        <mkdir dir="${OUTPUTDIR}"/>
    </target>
<!-- start package creation -->
    <path id="ant-deb.classpath">
        <fileset dir="../desktop/ant-deb-jar/" includes="*.jar"/>
    </path>
    <!-- http://code.google.com/p/ant-deb-task/ -->
    <taskdef name="deb" classname="com.googlecode.ant_deb_task.Deb" classpathref="ant-deb.classpath"/>
    <taskdef name="desktopEntry" classname="com.googlecode.ant_deb_task.DesktopEntry" classpathref="ant-deb.classpath"/>
    <target name="makeDebPackage" depends="signkinoath" description="build the deb file">
        <property name="package.name" value="kinoath${kinoath.filenameidentifier}"/>
        <property name="package.jarname" value="${DistJarName}"/>
        <!--check that the icon exists and fail if not-->
        <available file="${IconsDir}${kinoath.icon-file-name}.png" property="packageIconAvail"/>
        <fail unless="packageIconAvail" message="${kinoath.icon-file-name}.png doesn't exist!"/>
        <property name="distributionDirectory" value="${OUTPUTDIR}/distribution"/>
        <mkdir dir="${distributionDirectory}"/>
        <desktopEntry
            toFile="${distributionDirectory}/${package.name}.desktop"
            name="${kinoath.application-title}"
            comment="${ShortDescription}"
            exec="java -jar /usr/share/${package.name}/${package.jarname}"
            path="/usr/share/${package.name}/"
            icon="/usr/share/${package.name}/${kinoath.icon-file-name}.png"
            categories="Science;Education;Java"
        />
        <deb
            todir="${distributionDirectory}"
            package="${package.name}"
            section="science"
            depends="sun-java5-jre | sun-java6-jre, ffmpeg, imagemagick"            
        > <!-- homepage="http://www.lat-mpi.eu/tools/kinoath" deb doesn't support the "homepage" attribute -->
            <version upstream="${kinoath.current.major}.${kinoath.current.minor}" debian="${kinoath.current.revision}"/>
            <maintainer name="<NAME>" email="<EMAIL>"/>
            <description synopsis="${ShortDescription}">${LongDescription}</description>
            <tarfileset file="${OUTPUTDIR}/${package.jarname}" prefix="usr/share/${package.name}"/>
            <tarfileset file="${IconsDir}${kinoath.icon-file-name}.png" prefix="usr/share/${package.name}"/>
            <tarfileset dir="${LIBDIR}" prefix="usr/share/${package.name}/lib">
                <include name="*.jar"/>
            </tarfileset>
            <tarfileset file="${distributionDirectory}/${package.name}.desktop" prefix="usr/share/applications/"/>
        </deb>
    </target>
<!-- end package creation -->
    <target name="updateJnlpAndAppletHtml" depends="clean, getsvnversion">
<!--todo: the jar name should have the kinoath.filenameidentifier included-->
        <macrodef name="updateSingleFile">
            <attribute name="fileName"/>
            <sequential>
                <copy overwrite="true" file="./templates/@{fileName}.template" tofile="${OUTPUTDIR}/distribution/@{fileName}">
                    <filterchain>
                        <replacetokens>
                            <token key="VersionNumber" value="${kinoath.current.major}-${kinoath.current.minor}-${kinoath.current.revision}"/>
                            <token key="DistJarName" value="${DistJarName}"/>
                            <token key="BuildDirectory" value="kinoath-build-${kinoath.current.major}.${kinoath.current.minor}.x"/>
                            <token key="InstalledIcon" value="${kinoath.icon-file-name}"/>
                            <token key="TypeCheckVersion" value="${TypeCheckVersion}"/>
                            <token key="FilenameIdentifier" value="${kinoath.filenameidentifier}"/>
                            <token key="ApplicationTitle" value="${kinoath.application-title}"/>
                            <token key="LongDescription" value="${LongDescription}"/>
                            <token key="ShortDescription" value="${ShortDescription}"/>
                            <token key="DistName" value="kinoath"/>
                            <token key="AppName" value="KinOath"/>
                            <token key="MainClass" value="nl.mpi.kinnate.ui.MainFrame"/>
                        </replacetokens>
                    </filterchain>
                </copy>
            </sequential>
        </macrodef>
        <updateSingleFile fileName="kinoath.jnlp"/>
        <updateSingleFile fileName="win-installer.iss"/>
        <updateSingleFile fileName="Info.plist"/>
        <updateSingleFile fileName="start"/>
        <copy file="${OUTPUTDIR}/distribution/kinoath.jnlp" tofile="${SRCDIR}/JNLP-INF/application.jnlp"/>
    </target>
    <target name="buildWindowsInstaller" depends="signkinoath">
        <!--check that the icon exists and fail if not-->
        <available file="${IconsDir}${kinoath.icon-file-name}.ico" property="installedIconAvail"/>
        <fail unless="installedIconAvail" message="${kinoath.icon-file-name}.ico doesn't exist!"/>
        <mkdir dir="${OUTPUTDIR}/distribution-win32/temp/"/>
        <copy todir="${OUTPUTDIR}/distribution-win32/temp/">
            <fileset dir="${IconsDir}" includes="*.ico"/>
        </copy>
        <!--get unzip then delete the imagemagick jar-->
<!--        <get src="http://www.mpi.nl/tg/j2se/jnlp/kinoath/lib/ImageMagick-6.5.9-Win32.jar" dest="${OUTPUTDIR}/ImageMagick-6.5.9-Win32.jar"/>
        <unzip src="${OUTPUTDIR}/ImageMagick-6.5.9-Win32.jar" dest="${OUTPUTDIR}/distribution-win32/temp/ImageMagick"/>
        <delete file="${OUTPUTDIR}/ImageMagick-6.5.9-Win32.jar"/>
        <delete dir="${OUTPUTDIR}/distribution-win32/temp/ImageMagick/META-INF"/>-->
        <exec dir="${OUTPUTDIR}" executable="wine" ><!--os="Windows NT"-->
            <arg line='"C:\Program Files\Inno Setup 5\iscc.exe" ./distribution/win-installer.iss'/>
        </exec>
        <delete dir="${OUTPUTDIR}/distribution-win32/kinoath${kinoath.filenameidentifier}-installer.zip"/>
        <zip destfile="${OUTPUTDIR}/distribution-win32/kinoath${kinoath.filenameidentifier}-installer.zip" >
            <file file="${OUTPUTDIR}/distribution-win32/kinoath-installer-${kinoath.current.major}-${kinoath.current.minor}-${kinoath.current.revision}.exe"/>
        </zip>
        <available file="${OUTPUTDIR}/distribution-win32/kinoath${kinoath.filenameidentifier}-installer.zip" property="installerZipMissing"/>
        <fail unless="installerZipMissing" message="kinoath${kinoath.filenameidentifier}-installer.zip doesn't exist! Is Inno Setup installed inside wine?"/>
    </target>
    <target name="buildMacInstaller" depends="signkinoath">
        <!--check that the icon exists and fail if not-->
        <available file="${IconsDir}kinoath${kinoath.filenameidentifier}.icns" property="installedIconAvail"/>
        <fail unless="installedIconAvail" message="kinoath${kinoath.filenameidentifier}.icns doesn't exist!"/>
        <copy file="${OUTPUTDIR}/distribution/Info.plist" todir="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}.app/Contents/"/>
        <copy file="${OUTPUTDIR}/distribution/start" todir="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}.app/Contents/MacOS/"/>
        <copy file="${IconsDir}kinoath${kinoath.filenameidentifier}.icns" todir="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}.app/Contents/Resources/"/>
        <copy file="${OUTPUTDIR}/${DistJarName}" todir="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}.app/Contents/MacOS/"/>
        <copy todir="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}.app/Contents/MacOS/lib/">
            <fileset dir="${OUTPUTDIR}/lib/" includes="*.jar"/>
        </copy>
        <chmod file="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}.app/Contents/MacOS/start" perm="a+xr"/>
        <tar destfile="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}-mac.tar">
            <tarfileset dir="${OUTPUTDIR}/distribution-mac/" filemode="755" username="ant" group="ant">
                <include name="kinoath${kinoath.filenameidentifier}.app/Contents/MacOS/start"/>
            </tarfileset>
            <tarfileset dir="${OUTPUTDIR}/distribution-mac/" filemode="664" username="ant" group="ant">
                <include name="kinoath${kinoath.filenameidentifier}.app/**"/>
                <exclude name="kinoath${kinoath.filenameidentifier}.app/Contents/MacOS/start"/>
            </tarfileset>
        </tar>
    </target>
    <target name="getsvnversion" depends="setproperties">
       <!-- <exec executable="svn" output="version.info">
            <arg value="info"/>
        </exec>
        <exec executable="grep" output="version.date">-->
            <!--<arg value="^Revision"/>-->
           <!-- <arg value="^Last Changed Date:"/>
            <arg value="version.info"/>
        </exec>-->
        <!--<exec executable="date" output="version.date" />-->
        <exec outputproperty="kinoath.current.revision" executable="svnversion">
            <arg line="-n -c" />
            <arg line="${SRCDIR}nl/mpi/kinnate/" />
            <redirector>
                <outputfilterchain>
                    <tokenfilter>
                        <replaceregex pattern="^[0-9]*:" replace="" flags="g"/>
                        <replaceregex pattern="[^0-9]*" replace="" flags="g"/>
                    </tokenfilter>
                </outputfilterchain>
            </redirector>
        </exec>
        <exec outputproperty="kinoath.info.all" executable="svn">
            <arg line="info" />
            <arg line="${SRCDIR}nl/mpi/kinnate/" />
            <redirector>
                <outputfilterchain>
                    <tokenfilter>
                        <replaceregex pattern="^" replace="\\\\n" flags="g"/>
                    </tokenfilter>
                    <striplinebreaks/>
                </outputfilterchain>
            </redirector>
        </exec>
        <exec outputproperty="kinoath.last.commit.date" executable="svn">
            <arg line="info" />
            <arg line="${SRCDIR}nl/mpi/kinnate/" />
            <redirector>
                <outputfilterchain>
                    <linecontainsregexp>
                        <regexp pattern="^Last Changed Date:" />
                    </linecontainsregexp>
                    <tokenfilter>
                        <replaceregex pattern=".*\/([^\/]+)$" replace="\1" flags="g"/>
                    </tokenfilter>
                </outputfilterchain>
            </redirector>
        </exec>
        <exec outputproperty="kinoath.build.date" executable="date" />
        <echo file="${SRCDIR}nl/mpi/kinnate/KinOathVersion.java" append="false">package nl.mpi.kinnate;

import nl.mpi.arbil.util.ApplicationVersion;

public class KinOathVersion extends ApplicationVersion {

    /**
     * GENERATED BY ANT - DO NOT EDIT. See the arbil.xml build script.
     */
    public KinOathVersion() {
    	applicationTitle = "${kinoath.application-title}";
    	applicationIconName = "/nl/mpi/kinnate/resources/icons/${kinoath.icon-file-name}.png";
    	currentMajor = "${kinoath.current.major}";
    	currentMinor = "${kinoath.current.minor}";
    	currentRevision = "${kinoath.current.revision}";
	lastCommitDate = "${kinoath.last.commit.date}";
	compileDate = "${kinoath.build.date}";
	fullInfo = "${kinoath.info.all}";
    	currentVersionFile = "http://www.mpi.nl/tg/j2se/jnlp/kinoath/kinoath${kinoath.filenameidentifier}-current.txt";
    }
}
        </echo>
        <property name="KinOathJarPrefix" value="kinoath${kinoath.filenameidentifier}-${kinoath.current.major}-${kinoath.current.minor}-${kinoath.current.revision}"/>
        <property name="DistJarName" value="${KinOathJarPrefix}.jar"/>
    </target>
    <target name="signkinoath" depends="maven-jar">
        <input message="Please enter the latsoftware password:" addproperty="latsoftware.pw">
            <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
        </input>
        <signjar keystore="${pathToMpiTrunk}cert/mpi.keystore"
        alias="latsoftware's max-planck-gesellschaft id" storepass="${<PASSWORD>}">
            <path>
                <fileset dir="${OUTPUTDIR}/lib" includes="**/*.jar" />
            </path>
        </signjar>
        <signjar jar="${OUTPUTDIR}/${DistJarName}"
        keystore="${pathToMpiTrunk}cert/mpi.keystore"
        alias="latsoftware's max-planck-gesellschaft id" storepass="${<PASSWORD>}" />
    </target>
   <!-- <target name="image" depends="setproperties">
        <signjar jar="${OUTPUTDIR}/lib/typecheck-1.5.16185.jar"
        keystore="${SRCDIR}/../../../trunk/cert/mpi.keystore"
        alias="latsoftware's max-planck-gesellschaft id" storepass="<PASSWORD>" />
    </target> -->
    <target name="GetTracTodoList" depends="getsvnversion, GetLoginData">
<!--        todo: add another file for the rss feed of completed tasks-->        
        <property name="TodoListFile" value="${OUTPUTDIR}/distribution/kinoath${kinoath.filenameidentifier}_${kinoath.current.major}.${kinoath.current.minor}-${kinoath.current.revision}_todo.csv"/>
        <get src="https://trac.mpi.nl/query?status=accepted&amp;status=assigned&amp;status=new&amp;status=reopened&amp;component=KinOath-desktop&amp;component=KinOath-web&amp;format=csv&amp;max=1000&amp;col=id&amp;col=summary&amp;col=component&amp;report=24&amp;order=summary"
    dest="${TodoListFile}"
    username="${lux09.user}"
    password="${<PASSWORD>}"/>
        <scp file="${TodoListFile}" todir="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/"/>
        <scp file="${TodoListFile}" todir="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/kinoath-all_todo.csv"/> <!-- ${kinoath.filenameidentifier}-->
    </target>
    <target name="GetLoginData">
        <input message="Please enter lux09 username:" addproperty="lux09.user" />
        <input message="Please enter lux09 password:" addproperty="lux09.pw">
            <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
        </input>
    </target>
    <target name="scp_to_lux09" depends="makeDebPackage, buildWindowsInstaller, buildMacInstaller, GetLoginData, GetTracTodoList">
        <echo file="${OUTPUTDIR}/kinoath${kinoath.filenameidentifier}-current.txt">${kinoath.current.revision}</echo>
        <scp file="${OUTPUTDIR}/${DistJarName}" todir="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/"/>
        <!-- the lib direcory only needs to be updated when there is a real change so can be commented out to save build time -->
        <scp todir="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/lib">
            <fileset dir="${OUTPUTDIR}/lib"/>
        </scp>
        <scp file="${IconsDir}${kinoath.icon-file-name}.png" todir="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/"/>
        <!-- push the updated the applet html and the kinoath jnlp files to the server -->
        <scp file="${OUTPUTDIR}/distribution/kinoath.jnlp" remoteTofile="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/kinoath${kinoath.filenameidentifier}.jnlp"/>
        <scp file="${OUTPUTDIR}/distribution/kinoath.jnlp" remoteTofile="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/kinoath${kinoath.filenameidentifier}_${kinoath.current.major}.${kinoath.current.minor}-${kinoath.current.revision}.jnlp"/>
<!--        <scp file= "${BUILDDIR}/kinoath-applet.html" remoteTofile="${<EMAIL>.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/kinoath-applet${kinoath.filenameidentifier}.html"/>-->
        <!-- push the deb package -->
        <scp file="${distributionDirectory}/kinoath${kinoath.filenameidentifier}_${kinoath.current.major}.${kinoath.current.minor}-${kinoath.current.revision}_all.deb" todir="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/"/>
        <scp file="${distributionDirectory}/kinoath${kinoath.filenameidentifier}_${kinoath.current.major}.${kinoath.current.minor}-${kinoath.current.revision}_all.deb" remoteTofile="${<EMAIL>.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/kinoath${kinoath.filenameidentifier}.deb"/>
        <!-- push the windows installer -->
        <scp file="${OUTPUTDIR}/distribution-win32/kinoath${kinoath.filenameidentifier}-installer.zip" todir="${<EMAIL>.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/"/>
        <scp file="${OUTPUTDIR}/distribution-win32/kinoath${kinoath.filenameidentifier}-installer.zip" todir="${<EMAIL>.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/kinoath${kinoath.filenameidentifier}_${kinoath.current.major}.${kinoath.current.minor}-${kinoath.current.revision}-win-installer.zip"/>
        <!-- push the mac installer -->
        <scp file="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}-mac.tar" todir="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/"/>
        <scp file="${OUTPUTDIR}/distribution-mac/kinoath${kinoath.filenameidentifier}-mac.tar" todir="${<EMAIL>.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/kinoath${kinoath.filenameidentifier}_${kinoath.current.major}.${kinoath.current.minor}-${kinoath.current.revision}-mac.tar"/>
        <!-- only after all the installers have been pushed do we update the version text file -->
        <scp file="${OUTPUTDIR}/kinoath${kinoath.filenameidentifier}-current.txt" todir="${<EMAIL>.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/"/>
        <!-- copy the current version of allversionslisting.php to make sure it gets kept in svn -->
        <scp file="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/allversionslisting.php" todir="../desktop/src/main/php/" />
        <scp file="${lux09.user}:${<EMAIL>:/data/extweb1/docs/TG/j2se/jnlp/kinoath/todolisttable.php" todir="../desktop/src/main/php/" />
    </target>
    <target name="maven-jar" depends="updateJnlpAndAppletHtml">
        <!-- while this could be done in a maven ant task, this method appears more portable at this stage -->
        <exec dir="../desktop/" executable="mvn">
            <arg line="clean install" />
            <arg line="-Doutput.jarname=${KinOathJarPrefix}"/>
            <arg line="-Doutput.directory=${OUTPUTDIR}"/>
        </exec>
    </target>
    <target name="maven-deploy" depends="getsvnversion">
        <!-- while this could be done in a maven and task, this method appears more portable at this stage -->
        <exec executable="mvn">
            <arg line="install:install-file" />
            <arg line="-Dfile=${OUTPUTDIR}/${DistJarName}" />
            <arg line="-DgroupId=nl.mpi" />
            <arg line="-DartifactId=kinoath" />
            <arg line="-Dversion=${kinoath.current.major}.${kinoath.current.minor}.${kinoath.current.revision}" />
            <arg line="-Dpackaging=jar" />
            <arg line="-DpomFile=../desktop/pom.xml" />
            <!-- -DgeneratePom=true -->
        </exec>
    </target>
</project>
 

{'fraction_non_alphanumeric': 0.17197214912791375, 'fraction_numerical': 0.008080478774189041, 'mean_word_length': 3.0961465089660436, 'pattern_counts': {'":': 0, '<': 601, '<?xml version=': 2, '>': 601, 'https://': 2, 'lorem ipsum': 0, 'www.': 8, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5961044', 'n_tokens_mistral': 13376, 'n_tokens_neox': 12735, 'n_words': 1998}