Skip to content
This repository
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 155 lines (140 sloc) 5.376 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
<?xml version="1.0"?>
<project name="kilim" default="all">
  <path id="kilim.classpath">
    <pathelement location="classes/" />
    <fileset dir="./libs">
      <include name="**/*.jar"/>
    </fileset>
    <pathelement path="${java.class.path}" />
  </path>
  <path id="kilim.testwovenclasspath">
    <pathelement location="testclasses/" />
    <pathelement location="classes/" />
    <fileset dir="./libs">
      <include name="**/*.jar"/>
    </fileset>
    <pathelement path="${java.class.path}" />
  </path>

  <target name="all" depends="clean,weave" />
  <target name="test" depends="testnotwoven,testwoven" />
  
  <target name="compile">
    <echo message="Compiling src ===================" />
    <javac includeantruntime="false" debug="on" srcdir="src" destdir="classes"
           classpathref="kilim.classpath"/>
    <echo message="Compiling examples ===================" />
    <javac includeantruntime="false" debug="on" srcdir="examples" destdir="classes"
           classpathref="kilim.classpath"/>
    <echo message="Compiling benchmarks ===================" />
    <javac includeantruntime="false" debug="on" srcdir="bench" destdir="classes"
           classpathref="kilim.classpath"/>
  </target>
  
  <!-- Glob a list of .j files into a space-separated list -->
  <pathconvert property="dotjfiles" pathsep=" ">
    <path>
      <fileset dir="." includes="**/*.j" />
    </path>
  </pathconvert>
  
  <target name="asm" depends="compile">
    <echo message="Assembling test .j files ===================" />
    <java classname="kilim.tools.Asm" classpathref="kilim.classpath" fork="yes">
      <arg line="-nf -d ./classes" />
      <arg line="${dotjfiles}" />
    </java>
  </target>
  
  <target name="testcompile" depends="asm">
    <echo message="Compiling test ===================" />
    <javac includeantruntime="false" debug="on" srcdir="test" destdir="classes"
           classpathref="kilim.classpath"/>
  </target>
  

  <target name="weave" depends="testcompile">
    <echo message="Weaving files ===================" />
    <java classname="kilim.tools.Weaver" fork ="yes">
      <classpath refid="kilim.classpath"/>
      <assertions>
<enable/>
      </assertions>
      <arg value="-x" />
       <!-- Skip classes that match ExInvalid. These are negative tests
for the weaver. Also skip tests for this pass-->
      <arg value="ExInvalid|test" />
      <arg value="-d" />
      <arg value="./classes" />
      <arg line="./classes" />
    </java>
    <echo message="Weaving test classes ==============" />
    <java classname="kilim.tools.Weaver" fork ="yes">
      <classpath refid="kilim.classpath"/>
      <assertions>
<enable/>
      </assertions>
      <arg value="-x" />
       <!-- Weave tests separately into testclasses -->
      <arg value="ExInvalid" />
      <arg value="-d" />
      <arg value="./testclasses" />
      <arg line="./classes" />
    </java>

  </target>
    
  <target name="clean">
    <echo message="deleting files" />
    <delete>
      <fileset defaultexcludes="no" dir="." includes="*~,#*,foo,bar,x,y" />
    </delete>
    <delete dir="./classes" />
    <delete dir="./testclasses" />
    <mkdir dir="./classes" />
    <mkdir dir="./testclasses" />
  </target>
  
  
  <!-- This runs those tests that do not depend on generated classes
present in testclasses. For those, see "testwoven" -->
  <target name="testnotwoven" >
    <echo message="Testing =========================" />
    <java classname="junit.textui.TestRunner" fork="yes">
      <classpath refid="kilim.classpath"/>
      <assertions>
        <enable/>
      </assertions>
      <arg value="kilim.test.AllNotWoven" />
    </java>
  </target>
  
  <!-- This runs those tests depend on generated classes in testclasses-->
  <target name="testwoven" >
    <echo message="Testing Tasks ======================" />
    <java classname="junit.textui.TestRunner" fork="yes">
      <classpath refid="kilim.testwovenclasspath"/>
      <assertions>
        <enable/>
      </assertions>
      <arg value="kilim.test.AllWoven" />
    </java>
  </target>

  <target name="jar" description="generate the distribution">
    <copy file="License" todir="classes/kilim" />
    <jar jarfile="kilim.jar" basedir="classes">
      <zipgroupfileset dir="libs" includes="*.jar">
<exclude name="junit.jar" />
      </zipgroupfileset>
      <exclude name="kilim/test/**" />
      <exclude name="kilim/examples/**" />
      <exclude name="kilim/bench/**" />
      <manifest>
<attribute name="Main-Class" value="kilim.tools.Weaver"/>
      </manifest>
    </jar>

    <jar jarfile="kilim-runtime.jar" basedir="classes">
      <exclude name="kilim/test/**" />
      <exclude name="kilim/examples/**" />
      <exclude name="kilim/bench/**" />
      <exclude name="kilim/tools/**" />
      <exclude name="kilim/analysis/**" />
    </jar>
  </target>

  <target name="maven" depends="all,test" description="generate the maven jar">
    <copy file="License" todir="classes/kilim" />
<jar jarfile="kilim.jar" basedir="classes">
      <exclude name="kilim/test/**" />
      <exclude name="kilim/examples/**" />
      <exclude name="kilim/bench/**" />
    </jar>
  </target>
</project>
Something went wrong with that request. Please try again.