blob: e231c9dedfb2cbf573d247254f331531752602ce [file] [log] [blame]
<project name="Build Android plugin for IntelliJ IDEA" default="deploy.plugin">
<property name="android.plugin.version" value="1.0"/>
<property name="project.dir" value="."/>
<property name="project.lib" value="${project.dir}/lib"/>
<property name="project.dest" value="${project.dir}/out/production/android"/>
<property name="test.dest" value="${project.dir}/out/test/android"/>
<property name="output" value="${project.dir}/dist"/>
<property name="idea.home" value="${project.dir}/idea.home"/>
<property name="idea.pack" value="${project.dir}/idea_pack_9"/>
<property name="0" value="unknown"/>
<property name="build.vcs.number.android_svn" value="unknown"/>
<property name="plugin.revision" value="${build.vcs.number.android_svn}"/>
<property name="plugin.version" value="${android.plugin.version}.${plugin.revision}"/>
<path id="jdk.classpath">
<fileset dir="${java.home}" id="jdk.fileset">
<include name="jre/lib/*.jar"/>
</fileset>
</path>
<path id="idea.classpath">
<fileset dir="${idea.home}" id="idea.fileset">
<include name="lib/*.jar"/>
<include name="plugins/junit/lib/*.jar"/>
</fileset>
</path>
<path id="android.plugin.classpath">
<path refid="jdk.classpath"/>
<path refid="idea.classpath"/>
<fileset dir="lib"/>
</path>
<target name="unzip.last.successful.IDEA.build">
<mkdir dir="${idea.home}"/>
<unzip dest="${idea.home}">
<fileset dir="${idea.pack}">
<include name="*.zip"/>
</fileset>
</unzip>
</target>
<target name="init">
<mkdir dir="${project.dest}"/>
</target>
<target name="clean" depends="init">
<delete dir="build" includes="**/*"/>
</target>
<target name="make.plugin" depends="unzip.last.successful.IDEA.build">
<!--Copy descriptor-->
<copy todir="${project.dest}/META-INF">
<fileset dir="${project.dir}/src/META-INF"/>
</copy>
<!--Copy resources-->
<copy todir="${project.dest}">
<fileset dir="${project.dir}/resources/"/>
</copy>
<taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="idea.classpath"/>
<!--Compile project files-->
<javac2 srcdir="${project.dir}"
destdir="${project.dest}"
verbose="yes"
debug="true"
target="1.5">
<classpath refid="android.plugin.classpath"/>
<include name="src/**/*.java"/>
<include name="src/**/*.form"/>
</javac2>
<!--<replace file="${project.dest}/META-INF/plugin.xml" token="VERSION" value="${plugin.version}"/>-->
</target>
<target name="deploy.plugin" depends="clean, make.plugin">
<mkdir dir="${project.dir}/tempjar/android/lib"/>
<jar destfile="${project.dir}/tempjar/android/lib/android.jar">
<fileset dir="${project.dest}" includes="**/*"/>
<manifest>
<attribute name="Revision" value="${plugin.revision}"/>
<attribute name="Build" value="${plugin.version}"/>
</manifest>
</jar>
<copy todir="${project.dir}/tempjar/android/lib">
<fileset dir="${project.lib}">
<include name="ddmlib.jar"/>
<include name="androidprefs.jar"/>
<include name="sdklib.jar"/>
</fileset>
</copy>
<mkdir dir="${output}"/>
<zip destfile="${output}/android-${plugin.version}.zip" basedir="${project.dir}/tempjar"/>
<delete dir="${project.dir}/tempjar"/>
</target>
</project>