Ant build scripts, antcall, dependencies, etc

后端 未结 3 977
野性不改
野性不改 2021-01-31 17:56

I have a build script and as part of that script it copies a jar file to a directory, for ease lets call it the utils jar. the utils jar is built by another build script sittin

相关标签:
3条回答
  • 2021-01-31 18:02

    You can pass params down to antcall using nested in the antcall block. So, you can pass the properties down that way (probably even basedir since properties are immutable).

    0 讨论(0)
  • 2021-01-31 18:16

    Try using the "ant" task instead of the "antcall" task, which runs the imported build directly instead of importing it into the current build file. It has a "dir" parameter:

    the directory to use as a basedir for the new Ant project. Defaults to the current project's basedir, unless inheritall has been set to false, in which case it doesn't have a default value. This will override the basedir setting of the called project.

    So you could do:

    <ant antfile="${baseDirUpOne}/utils/build/build.xml" dir="../utils/build" />
    

    or something like that.

    0 讨论(0)
  • 2021-01-31 18:22

    I've got something similar set up: I have a main Ant build.xml which calls a separate build.xml that takes care of building my tests. This is how I do it:

    <target name="build-tests">
        <subant target="build">
          <fileset dir="${test.home}" includes="build.xml"/>
        </subant>
    </target>
    

    The trick is to use subant instead of antcall. You don't have to import the other build file.

    0 讨论(0)
提交回复
热议问题