summaryrefslogtreecommitdiff
path: root/build.xml
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2011-12-27 14:26:43 +0100
committerEugene Burmako <xeno.by@gmail.com>2011-12-28 02:32:32 +0100
commitd4a26fa006b8a23a759a0a72026b7433f089b1f8 (patch)
tree17227e2d1bae9c5d3f00efa475656ef9795ae97a /build.xml
parentf737e35ddf43599043ab78404c4f9a13e6d02c9b (diff)
downloadscala-d4a26fa006b8a23a759a0a72026b7433f089b1f8.tar.gz
scala-d4a26fa006b8a23a759a0a72026b7433f089b1f8.tar.bz2
scala-d4a26fa006b8a23a759a0a72026b7433f089b1f8.zip
buildlocker for ant
This new command is more or less equivalent to regular "build". It is capable of: 1) automatically unlocking locker 2) not building stuff that hasn't changed 3) packing locker classes into JARs at build\palo\lib 4) populating bin directory at build\palo\bin All in all, buildlocker lets one work with locker as if it were quick. Except that it is rebuilds quicker than quick by a factor of 2x. Fastlocker does exactly the same, but without packing stuff into JARs. This makes things even faster. Of course, both targets don't build anything except library and compiler, so they aren't appropriate for all workflows, but, it was useful for me! P.S. Good news: you can use partest with locker, but it's not obvious. First, you need to transplant missing stuff that is necessary to run partest. I did it by maintaining a parallel clone of my repository that is used only to produce partest dependencies (partest itself, scalap and library/actors). Second, partest has to be switched into "testClasses" mode, which is tricky. I honestly tried to find out how to do this, but then fell back to a hack: https://gist.github.com/1525721. Finally, you need a special launcher (I haven't made friends with std script). The launcher is quite simple and looks as follows: https://gist.github.com/1525720
Diffstat (limited to 'build.xml')
-rw-r--r--build.xml86
1 files changed, 84 insertions, 2 deletions
diff --git a/build.xml b/build.xml
index 2d5dd501f3..fad3d265cf 100644
--- a/build.xml
+++ b/build.xml
@@ -123,6 +123,18 @@ END-USER TARGETS
<antcall target="palo.done"/>
</target>
+ <target name="fastlocker"
+ description="Buildlocker without extra fuss">
+ <antcall target="locker.unlock"/>
+ <antcall target="locker.done"/>
+ </target>
+
+ <target name="buildlocker"
+ description="Does the same for locker as build does for quick">
+ <antcall target="locker.unlock"/>
+ <antcall target="palo.bin"/>
+ </target>
+
<target name="newlibs"
description="Requires libraries (MSIL, FJBG) to be rebuilt. Add this target before any other if class file format is incompatible.">
<property name="libs.outdated" value="yes"/>
@@ -411,12 +423,34 @@ LOCAL REFERENCE BUILD (LOCKER)
<delete dir="${build-locker.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</target>
- <target name="locker.unlock">
- <delete file="${build-locker.dir}/all.complete"/>
+ <target name="locker.unlock.pre-lib">
+ <uptodate property="locker.lib.available" targetfile="${build-locker.dir}/library.complete">
+ <srcfiles dir="${src.dir}">
+ <include name="library/**"/>
+ </srcfiles>
+ </uptodate>
+ </target>
+
+ <target name="locker.unlock.lib" depends="locker.unlock.pre-lib" unless="locker.lib.available">
<delete file="${build-locker.dir}/library.complete"/>
+ </target>
+
+ <target name="locker.unlock.pre-comp" depends="locker.unlock.lib">
+ <uptodate property="locker.comp.available" targetfile="${build-locker.dir}/compiler.complete">
+ <srcfiles dir="${src.dir}">
+ <include name="compiler/**"/>
+ </srcfiles>
+ </uptodate>
+ </target>
+
+ <target name="locker.unlock.comp" depends="locker.unlock.pre-comp" unless="locker.comp.available">
<delete file="${build-locker.dir}/compiler.complete"/>
</target>
+ <target name="locker.unlock" depends="locker.unlock.comp">
+ <delete file="${build-locker.dir}/all.complete" />
+ </target>
+
<!-- ===========================================================================
PACKED LOCKER BUILD (PALO)
============================================================================ -->
@@ -449,7 +483,10 @@ PACKED LOCKER BUILD (PALO)
<jar destfile="${build-palo.dir}/lib/scala-compiler.jar" manifest="${basedir}/META-INF/MANIFEST.MF">
<fileset dir="${build-locker.dir}/classes/compiler"/>
<!-- filemode / dirmode: see trac ticket #1294 -->
+ <zipfileset dirmode="755" filemode="644" src="${lib.dir}/fjbg.jar"/>
+ <zipfileset dirmode="755" filemode="644" src="${lib.dir}/msil.jar"/>
</jar>
+ <copy file="${jline.jar}" toDir="${build-palo.dir}/lib"/>
</target>
<target name="palo.done" depends="palo.comp">
@@ -459,6 +496,51 @@ PACKED LOCKER BUILD (PALO)
<delete dir="${build-palo.dir}" includeemptydirs="yes" quiet="yes" failonerror="no"/>
</target>
+ <target name="palo.pre-bin" depends="palo.comp">
+ <uptodate property="palo.bin.available" targetfile="${build-locker.dir}/bin.complete">
+ <srcfiles dir="${src.dir}">
+ <include name="compiler/scala/tools/ant/templates/**"/>
+ </srcfiles>
+ </uptodate>
+ </target>
+
+ <target name="palo.bin" depends="palo.pre-bin" unless="palo.bin.available">
+ <taskdef name="palo-bin" classname="scala.tools.ant.ScalaTool">
+ <classpath>
+ <pathelement location="${build-palo.dir}/lib/scala-library.jar"/>
+ <pathelement location="${build-palo.dir}/lib/scala-compiler.jar"/>
+ <pathelement location="${build-palo.dir}/lib/jline.jar"/>
+ </classpath>
+ </taskdef>
+ <mkdir dir="${build-palo.dir}/bin"/>
+ <palo-bin
+ file="${build-palo.dir}/bin/scala"
+ class="scala.tools.nsc.MainGenericRunner"
+ javaFlags="${java.flags}"/>
+ <palo-bin
+ file="${build-palo.dir}/bin/scalac"
+ class="scala.tools.nsc.Main"
+ javaFlags="${java.flags}"/>
+ <palo-bin
+ file="${build-palo.dir}/bin/scaladoc"
+ class="scala.tools.nsc.ScalaDoc"
+ javaFlags="${java.flags}"/>
+ <palo-bin
+ file="${build-palo.dir}/bin/fsc"
+ class="scala.tools.nsc.CompileClient"
+ javaFlags="${java.flags}"/>
+ <palo-bin
+ file="${build-palo.dir}/bin/scalap"
+ class="scala.tools.scalap.Main"
+ javaFlags="${java.flags}"/>
+ <chmod perm="ugo+rx" file="${build-palo.dir}/bin/scala"/>
+ <chmod perm="ugo+rx" file="${build-palo.dir}/bin/scalac"/>
+ <chmod perm="ugo+rx" file="${build-palo.dir}/bin/scaladoc"/>
+ <chmod perm="ugo+rx" file="${build-palo.dir}/bin/fsc"/>
+ <chmod perm="ugo+rx" file="${build-palo.dir}/bin/scalap"/>
+ <touch file="${build-locker.dir}/bin.complete" verbose="no"/>
+ </target>
+
<!-- ===========================================================================
QUICK BUILD (QUICK)
============================================================================ -->