<project name="buildZ" default="build">
  <!-- Generated by MPS -->
  <property name="build.dir" location="build" />
  <property name="build.tmp" location="${build.dir}/tmp/buildZ" />
  <property name="build.layout" location="${build.dir}/artifacts/buildZ" />
  <property name="artifacts.buildY" location="${build.dir}/artifacts/buildY" />
  <property name="environment" value="env" />
  <property name="env.JAVA_HOME" value="${java.home}/.." />
  <property name="jdk.home" value="${env.JAVA_HOME}" />
  
  <target name="assemble" depends="classes, fetchDependencies">
    <mkdir dir="${build.layout}" />
    <jar destfile="${build.layout}/modB.jar" duplicate="preserve">
      <fileset dir="${build.tmp}/java/out/module-B-in-Z" />
    </jar>
    <mkdir dir="${build.layout}/Aa" />
    <copy file="${artifacts.buildY}/Aa.jar" todir="${build.layout}/Aa" />
    <copy file="${artifacts.buildY}/AaLibs.zip" todir="${build.layout}/Aa" />
  </target>
  
  <target name="buildDependents">
    <ant antfile="buildY.xml" inheritAll="false" useNativeBasedir="true" />
  </target>
  
  <target name="fetchDependencies">
    <mkdir dir="${build.tmp}/deps/buildY/AaLibs.zip" />
    <unzip src="${artifacts.buildY}/AaLibs.zip" dest="${build.tmp}/deps/buildY/AaLibs.zip" />
  </target>
  
  <target name="build" depends="assemble" />
  
  <target name="clean">
    <delete dir="${build.tmp}" />
    <delete dir="${build.layout}" />
  </target>
  
  <target name="compileJava" depends="java.compile.module-B-in-Z" />
  
  <target name="processResources" />
  
  <target name="classes" depends="compileJava, processResources" />
  
  <target name="test" depends="classes" />
  
  <target name="check" depends="test" />
  
  <target name="java.compile.module-B-in-Z" depends="fetchDependencies">
    <mkdir dir="${basedir}/subprojects/buildB/moduleB" />
    <mkdir dir="${build.tmp}/java/out/module-B-in-Z" />
    <javac destdir="${build.tmp}/java/out/module-B-in-Z" fork="true" encoding="utf8" includeantruntime="false" debug="true">
      <compilerarg value="-Xlint:none" />
      <src>
        <path location="${basedir}/subprojects/buildB/moduleB" />
      </src>
      <classpath>
        <fileset file="${artifacts.buildY}/Aa.jar" />
        <fileset file="${build.tmp}/deps/buildY/AaLibs.zip/abcde.jar" />
      </classpath>
    </javac>
  </target>
</project>