Commits

Marcus R. Brown committed 370233f

Initial work on packaging libraries (as bytecode) with jython-android.

Comments (0)

Files changed (1)

             includesfile="${jython.base.dir}/CoreExposed.includes"/>
     </target>
 
-    <target name="jar-complete-android" depends="jar-android">
+    <target name="jar-complete-android" depends="jar-android,pycompile-android">
+        <jar destfile="${dist.dir}/jython-lib.jar">
+            <fileset dir="${dist.dir}" includes="Lib/**" excludes="Lib/**/*.py"/>
+        </jar>
         <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="extlibs/jarjar-0.7.jar"/>
         <jarjar destfile="${dist.dir}/${jython.deploy.jar}">
             <zipfileset src="${dist.dir}/${jython.dev.jar}"/>
+            <zipfileset src="${dist.dir}/jython-lib.jar"/>
             <zipfileset src="extlibs/antlr-runtime-3.1.3.jar"/>
             <rule pattern="org.antlr.runtime.**" result="org.python.antlr.runtime.@1"/>
             <zipfileset src="extlibs/asm-3.1.jar"/>
         <jycompile srcdir="${dist.dir}/Lib" destdir="${dist.dir}/Lib" excludes="test/**"/>
     </target>
 
+    <target name="pycompile-android" depends="jar-android,copy-lib">
+        <taskdef name="jycompile" classname="org.python.util.JycompileAntTask">
+            <classpath path="${dist.dir}/Lib"/>
+            <classpath path="${dist.dir}/${jython.dev.jar}" />
+            <classpath refid="main.classpath" />
+        </taskdef>
+        <jycompile srcdir="${dist.dir}/Lib" destdir="${dist.dir}/Lib" excludes="test/**"/>
+    </target>
+
     <target name="copy-lib" depends="init, copy-javalib, copy-cpythonlib">
         <!-- XXX untested and most likely broken in 2.5
         <copy todir="${dist.dir}" preservelastmodified="true">