从ant调用exe文件

时间:2019-09-02 10:45:16

标签: performance build ant zip call

我有一个ant build.xml文件,我想在其中调用exe文件。 7-Zip.exe是我要调用的文件,因为我要在构建过程中解压缩一个zip文件夹,并且该标签对我来说有点慢,因此我想尝试调用7-zip。我怎样才能做到这一点?到目前为止,这是我的build.xml文件:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <property environment="env"/>
<property name="ECLIPSE_HOME" value="../../eclipse/jee-oxygen/eclipse/"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.8"/>
<property name="source" value="1.8"/>
<!--property name="TST_TEST.input_sql" location="c:/share/tmp/input_sql"/-->
<path id="SevenZip.classpath">
    <pathelement location="bin"/>
</path>
<target name="init">
    <mkdir dir="bin"/>
    <copy includeemptydirs="false" todir="bin">
        <fileset dir="src">
            <exclude name="**/*.java"/>
        </fileset>
    </copy>
</target>
<target name="clean">
    <delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
    <echo message="${ant.project.name}: ${ant.file}"/>
    <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
        <src path="src"/>
        <classpath refid="SevenZip.classpath"/>
    </javac>
</target>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
    <copy todir="${ant.library.dir}">
        <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
    </copy>
    <unzip dest="${ant.library.dir}">
        <patternset includes="jdtCompilerAdapter.jar"/>
        <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
    </unzip>
</target>
<target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
    <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
    <antcall target="build"/>
</target>
<target name="SevenZip">
    <java classname="SevenZip" failonerror="true" fork="yes">
        <classpath refid="SevenZip.classpath"/>
    </java>
</target>

<target name="build-zip">
    <unzip dest="c:/share/tmp/test">
        <fileset dir="C:\svn_planio\TST\trunk\test\code\sql\input_sql\CSV">
            <include name="C:\Users\Ferid\Desktop\Real_Axpo_Test_Cases-staging-tables.zip"/>
        </fileset>
    </unzip>
</target>
</project>

0 个答案:

没有答案