gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control systemdiff --git a/build.xml b/build.xml
--- a/build.xml
+++ b/build.xml
<not><os family="windows" /></not>
</condition>
-
<property name="java.encoding" value="utf-8" />
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
-
<!-- **************************************** -->
<!-- main variables that can be altered in the
properties file or through command line switches.
<property name="mjc2wsl.class.dir" value="bin" />
<property name="mjc2wsl.src.dir" value="src" />
<property name="mjc2wsl.options" value="" />
+ <property name="mjc2wsl.main" value="com.quemaster.transformations.mjc2wsl.Mjc2wsl" />
<property name="res.dir" value="res" />
+ <property name="dist.dir" value="dist" />
<property name="compiler.class.jar" value="lib/mj.jar" />
<property name="compiler.class.dir" value="lib/compiler-bin" />
<property name="compiler.classname.interpreter" value="MJ.Run" />
<property name="compiler.classname.decoder" value="MJ.Decode" />
- <property name="samples.main.dir" value="samples" />
- <property name="samples.temp.dir" value="temp" />
+ <property name="samples.main.dir" value="samples/alpha-mj" />
+ <property name="samples.temp.dir" value="temp/alpha-mj" />
- <property name="transf.wsl.file" value="src-wsl/transf-min.wsl" />
+ <property name="transf.wsl.file" value="src-wsl/hill_climbing.wsl" />
<property name="transf.wsl.ini" value="transf.ini" />
- <property name="transf.wsl.ext" value="_t.wsl" />
+ <property name="transf.wsl.ext" value="_tr.wsl" />
+ <!-- args can be used to send additional arguments to a script -->
+ <property name="transf.wsl.args" value="" />
- <property name="metrics.wsl.file" value="src-wsl/metrics.wsl" />
+ <property name="metrics.wsl.file" value="src-wsl/metrics_csv.wsl" />
<property name="metrics.extension" value=".met" />
<property name="tests.dir" value="tests" />
- <property name="log.dir" value="logs" />
+ <property name="log.dir" value="${basedir}/logs" />
<property name="log.file.transformations" value="${log.dir}/transformations" />
<property name="log.file.mjc2wsl" value="${log.dir}/mjc2wsl" />
<property name="log.file.tests.m" value="${log.dir}/tests-mj" />
<property name="log.file.tests.t" value="${log.dir}/tests-wsl" />
+ <property name="version.file" value="${res.dir}/com/quemaster/transformations/mjc2wsl/version.properties" />
+
<!-- **************************************** -->
<!-- patterns -->
<!-- **************************************** -->
<mkdir dir="${compiler.class.dir}"/>
<mkdir dir="${samples.temp.dir}"/>
<mkdir dir="${log.dir}"/>
+ <mkdir dir="${dist.dir}"/>
<copy todir="${samples.temp.dir}">
<fileset dir="${samples.main.dir}">
<include name="*.mj"/>
<target name="init-time">
<tstamp>
- <format property="time" pattern="yy-MM-dd--HH-mm-ss"/>
+ <format property="time" pattern="yy-MM-dd--HH-mm-ss-SSS"/>
</tstamp>
</target>
- <target name="all" depends='mj-samples,mjc2wsl-samples,wsl-transf-samples'
+ <target name="all" depends='mj-samples,mjc2wsl-samples,wsl-transf-samples,metrics-samples-compare-wsl'
description="build the tools, run them on the samples to check">
</target>
</delete>
</target>
+ <target name="pack.jar" depends="build,update-version-string"
+ description="Packs the binaries in a jar and place it in ${dist.dir}">
+
+ <mkdir dir="${dist.dir}"/>
+ <jar destfile="${dist.dir}/mjc2wsl.jar"
+ includes="**">
+ <manifest>
+ <attribute name="Built-By" value="${user.name}"/>
+ <attribute name="Implementation-Vendor"
+ value="Doni Pracner"/>
+ <attribute name="Implementation-Title"
+ value="MicroJava bytecode to WSL"/>
+ <attribute name="Implementation-Version" value="${version}"/>
+ <attribute name="Main-Class" value="${mjc2wsl.main}"/>
+ </manifest>
+ <fileset dir="${mjc2wsl.class.dir}"/>
+ </jar>
+
+ </target>
+
<!-- **************************************** -->
<!-- version tasks
based on ideas by Jesper Öqvist http://llbit.se/?p=1876 -->
</exec>
<antcall target="-store-version-string"/>
<!-- ensure version is defined even if git was not available -->
- <property file="${res.dir}/version.properties"/>
+ <property file="${version.file}"/>
</target>
<target name="-store-version-string" if="version">
<!-- store the new version string in the correct property file -->
<echo message="version=${version}"/>
- <propertyfile file="${res.dir}/version.properties">
+ <dirname file="${version.file}" property="version.file.dir"/>
+ <mkdir dir="${version.file.dir}" />
+ <propertyfile file="${version.file}">
<entry key="version" value="${version}"/>
</propertyfile>
<exec executable="git" failifexecutionfails="false">
<arg value="update-index"/>
<arg value="--assume-unchanged"/>
- <arg value="${res.dir}/version.properties"/>
+ <arg value="${version.file}"/>
+ </exec>
+ </target>
+
+ <target name="git-version-string" if="version">
+ <!-- explicitly store the new version string in git -->
+ <!-- needs the version set already, preferably from the command line -->
+ <echo message="version=${version}"/>
+ <dirname file="${version.file}" property="version.file.dir"/>
+ <mkdir dir="${version.file.dir}" />
+ <propertyfile file="${version.file}">
+ <entry key="version" value="${version}"/>
+ </propertyfile>
+ <!-- remove the first line with the date if you can.
+ for whatever reason Java Properties always writes this
+ -->
+ <exec executable="sed" failifexecutionfails="false">
+ <arg line="-e '1d' -i ${version.file}"/>
+ </exec>
+ <exec executable="git" failifexecutionfails="false">
+ <arg value="update-index"/>
+ <arg value="--no-assume-unchanged"/>
+ <arg value="${version.file}"/>
</exec>
</target>
<target name="build" depends="init,update-version-string" description="build the mjc2wsl tool">
<javac srcdir="${mjc2wsl.src.dir}" destdir="${mjc2wsl.class.dir}" includeAntRuntime='no' />
+ <copy todir="${mjc2wsl.class.dir}">
+ <fileset dir="${res.dir}"/>
+ </copy>
</target>
<target name="mjc2wsl">
<echo message="${filename}" />
- <java classpath="${mjc2wsl.class.dir}:${res.dir}" classname="com.quemaster.transformations.mjc2wsl.mjc2wsl">
+ <java classpath="${mjc2wsl.class.dir}:${res.dir}" classname="${mjc2wsl.main}">
<arg line="${mjc2wsl.options}" />
<arg value="${filename}" />
</java>
<target name="wsl-transf"
description="transform (simplify) a single wsl file generated by mjc2wsl">
-
+ <stopwatch name="transf-${transf.filename}" action="start"/>
<antcall target="wsl-run">
<param name="filename" value="${transf.wsl.file}" />
- <param name="args" value="${transf.filename}" />
+ <param name="args" value="${transf.wsl.args} ${transf.filename}" />
</antcall>
+ <record name="${transf.filename}-time.txt" action="start" emacsmode="true"/>
+ <stopwatch name="transf-${transf.filename}" action="total"/>
+ <record name="${transf.filename}-time.txt" action="stop"/>
</target>
<target name="wsl-transf-samples" depends="init"
<path>
<fileset dir='${samples.temp.dir}'>
<patternset refid="non.transformed.sources"/>
+ <depth max="0"/>
</fileset>
</path>
</foreach>
<target name="output-all-versions"
description="generate variations on the translations in the 'local' folder and tar them">
+ <delete>
+ <fileset dir="local/out/"/>
+ </delete>
+ <mkdir dir="local/out"/>
<antcall>
<target name="mj-samples"/>
<target name="mjc2wsl-samples"/>
<param name="samples.temp.dir" value="local/out/popPush-glob"/>
<param name="mjc2wsl.options" value="--genPopPush --genGlobalVars"/>
</antcall>
+ <antcall>
+ <target name="mj-samples"/>
+ <target name="mjc2wsl-samples"/>
+ <param name="samples.temp.dir" value="local/out/popPush-loc-separate"/>
+ <param name="mjc2wsl.options" value="--genPopPush --genInlinePrint --genLocalsSeparate --genLocalVars"/>
+ </antcall>
<tar basedir="local/out" compression="gzip"
destfile="local/mjc2wsl-samples.tgz"
includes="*/*.wsl"/>