Commits

Marcus R. Brown  committed 90d58b8

Add Android-specific duplicates of the jar targets.

  • Participants
  • Parent commits a630dc5

Comments (0)

Files changed (1)

         </jar>
     </target>
 
+    <target name="expose-android" depends="init">
+        <taskdef name="expose" classname="org.python.expose.generate.ExposeTask">
+            <classpath>
+                <path refid="main.classpath" />
+                <pathelement path="${out.classes.dir}" />
+            </classpath>
+        </taskdef>
+        <expose srcdir="${out.classes.dir}"
+            destdir="${exposed.dir}" 
+            includesfile="${jython.base.dir}/CoreExposed.includes"/>
+    </target>
+
+    <target name="jar-complete-android" depends="jar-android">
+        <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="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"/>
+            <zipfileset src="extlibs/asm-commons-3.1.jar"/>
+            <zipfileset src="extlibs/asm-util-3.1.jar"/>
+            <rule pattern="org.objectweb.asm.**" result="org.python.objectweb.asm.@1"/>
+            <zipfileset src="extlibs/guava-r07.jar"/>
+            <rule pattern="com.google.**" result="org.python.google.@1"/>
+            <zipfileset src="extlibs/jaffl.jar"/>
+            <zipfileset src="extlibs/jffi-Darwin.jar"/>
+            <zipfileset src="extlibs/jffi-i386-FreeBSD.jar"/>
+            <zipfileset src="extlibs/jffi-i386-Linux.jar"/>
+            <zipfileset src="extlibs/jffi-i386-OpenBSD.jar"/>
+            <zipfileset src="extlibs/jffi-i386-SunOS.jar"/>
+            <zipfileset src="extlibs/jffi-i386-Windows.jar"/>
+            <zipfileset src="extlibs/jffi-ppc-AIX.jar"/>
+            <zipfileset src="extlibs/jffi-ppc-Linux.jar"/>
+            <zipfileset src="extlibs/jffi-ppc64-Linux.jar"/>
+            <zipfileset src="extlibs/jffi-s390x-Linux.jar"/>
+            <zipfileset src="extlibs/jffi-sparc-SunOS.jar"/>
+            <zipfileset src="extlibs/jffi-sparcv9-SunOS.jar"/>
+            <zipfileset src="extlibs/jffi-x86_64-FreeBSD.jar"/>
+            <zipfileset src="extlibs/jffi-x86_64-Linux.jar"/>
+            <zipfileset src="extlibs/jffi-x86_64-OpenBSD.jar"/>
+            <zipfileset src="extlibs/jffi-x86_64-SunOS.jar"/>
+            <zipfileset src="extlibs/jffi-x86_64-Windows.jar"/>
+            <zipfileset src="extlibs/jffi.jar"/>
+            <zipfileset src="extlibs/jnr-posix.jar"/>
+            <zipfileset src="extlibs/jnr-netdb-0.4.jar"/>
+            <!-- <rule pattern="com.sun.jna.**" result="org.python.jna.@1"/> -->
+            <rule pattern="org.jruby.ext.posix.**" result="org.python.posix.@1"/>
+            <zipfileset src="extlibs/constantine.jar"/>
+            <rule pattern="com.kenai.constantine.**" result="org.python.constantine.@1"/>
+            <zipfileset src="extlibs/xercesImpl-2.9.1.jar" excludes="META-INF/services/*"/>
+            <rule pattern="org.apache.xml.**" result="org.python.apache.xml.@1"/>
+            <rule pattern="org.apache.xerces.**" result="org.python.apache.xerces.@1"/>
+            <rule pattern="org.apache.wml.**" result="org.python.apache.wml.@1"/>
+            <rule pattern="org.apache.html.**" result="org.python.apache.html.@1"/>
+            <zipfileset src="extlibs/jline-0.9.95-SNAPSHOT.jar"/>
+            <!--
+            <rule pattern="jline.**" result="org.python.jline.@1"/>
+            -->
+            <manifest>
+                <attribute name="Main-Class" value="org.python.util.jython" />
+                <attribute name="Built-By" value="${user.name}" />
+                <!-- info section. ATTN: no blanks, no '.' in the names -->
+                <section name="Build-Info">
+                    <attribute name="version" value="${jython.version}" />
+                    <attribute name="svn-build" value="${do.checkout}" />
+                    <attribute name="oracle" value="${oracle.present}" />
+                    <attribute name="informix" value="${informix.present}" />
+                    <attribute name="build-compiler" value="${build.compiler}" />
+                    <attribute name="jdk-target-version" value="${jdk.target.version}" />
+                    <attribute name="debug" value="true" />
+                </section>
+            </manifest>
+        </jarjar>
+    </target>
+
+    <target name="jar-android" depends="compile-android,expose-android">
+       <typedef name="nameunion" classname="org.python.util.NameUnionAntType">
+           <classpath>
+               <path refid="main.classpath" />
+               <pathelement path="${out.classes.dir}" />
+           </classpath>
+       </typedef>
+       <jar destfile="${dist.dir}/callbacker_test.jar">
+           <fileset dir="${out.classes.dir}" includes="org/python/tests/Callbacker*"/>
+       </jar>
+       <jar destfile="${dist.dir}/${jython.dev.jar}" duplicate="fail">
+          <!-- If only nameunion is used, ant issues a spurious warning about no files being
+               included.  Use a fileset for version.properties just to shut that up. -->
+          <fileset dir="${compile.dir}" includes="org/python/version.properties"/>
+          <nameunion>
+             <fileset dir="${exposed.dir}"/>
+             <fileset dir="${out.classes.dir}"
+                 excludes="org/python/expose/generate/**,org/python/version.properties"/>   
+          </nameunion>
+          <manifest>
+              <attribute name="Main-Class" value="org.python.util.jython" />
+              <attribute name="Built-By" value="${user.name}" />
+              <!-- info section. ATTN: no blanks, no '.' in the names -->
+              <section name="Build-Info">
+                  <attribute name="version" value="${jython.version}" />
+                  <attribute name="svn-build" value="${do.checkout}" />
+                  <attribute name="oracle" value="${oracle.present}" />
+                  <attribute name="informix" value="${informix.present}" />
+                  <attribute name="build-compiler" value="${build.compiler}" />
+                  <attribute name="jdk-target-version" value="${jdk.target.version}" />
+                  <attribute name="debug" value="true" />
+              </section>
+          </manifest>
+        </jar>
+    </target>
+
     <target name="javadoc" depends="compile">
         <path id="javadoc.classpath">
             <pathelement path="${java.class.path}" />