<project name="buildTest2" default="build" basedir="../../../">
  <!-- Generated by MPS -->
  <property name="build.dir" location="build" />
  <property name="build.tmp" location="${build.dir}/tmp/buildTest2" />
  <property name="build.layout" location="${build.dir}/artifacts/buildTest2" />
  <property name="artifacts.mps" location="../../../../build/artifacts/mps" />
  <property file="${artifacts.mps}/build.properties" prefix="import.mps" />
  <property name="mps.build.number" value="${import.mps.mps.build.number}" />
  <property name="mps.date" value="${import.mps.mps.date}" />
  <property name="mps.build.vcs.number" value="${import.mps.mps.build.vcs.number}" />
  <property name="mps.teamcity.buildConfName" value="${import.mps.mps.teamcity.buildConfName}" />
  <property name="mps.idea.platform.build.number" value="${import.mps.mps.idea.platform.build.number}" />
  <property name="mps.mps.build.counter" value="${import.mps.mps.mps.build.counter}" />
  <property name="mpsBootstrapCore.version" value="${import.mps.mpsBootstrapCore.version}" />
  <property name="environment" value="env" />
  <property name="env.JAVA_HOME" value="${java.home}/.." />
  <property name="jdk.home" value="${env.JAVA_HOME}" />
  
  <path id="path.mps.ant.path">
    <pathelement location="${artifacts.mps}/lib/ant/lib/ant-mps.jar" />
    <pathelement location="${artifacts.mps}/lib/jdom.jar" />
    <pathelement location="${artifacts.mps}/lib/log4j.jar" />
  </path>
  
  <target name="assemble" depends="classes, declare-mps-tasks">
    <mkdir dir="${build.layout}/plugins" />
    <mkdir dir="${build.layout}/plugins/mps-buildTest2" />
    <mkdir dir="${build.layout}/plugins/mps-buildTest2/META-INF" />
    <echoxml file="${build.layout}/plugins/mps-buildTest2/META-INF/plugin.xml">
      <idea-plugin version="2" xmlns:xi="http://www.w3.org/2001/XInclude">
        <id>jetbrains.mps.buildTest2</id>
        <name>Build Test SandBox</name>
        <version>1.0.0</version>
        <depends>jetbrains.mps.core</depends>
        
        <extensions defaultExtensionNs="com.intellij">
          <mps.LanguageLibrary dir="/languages" />
        </extensions>
      </idea-plugin>
    </echoxml>
    <mkdir dir="${build.layout}/plugins/mps-buildTest2/languages" />
    <mkdir dir="${build.tmp}/default/jetbrains.mps.build.sandbox.jar" />
    <mkdir dir="${build.tmp}/default/jetbrains.mps.build.sandbox.jar/META-INF" />
    <echoxml file="${build.tmp}/default/jetbrains.mps.build.sandbox.jar/META-INF/module.xml">
      <module namespace="jetbrains.mps.build.sandbox" type="solution" uuid="d029512f-7357-432e-b758-ecdc37cc94f5">
        <dependencies>
          <module ref="6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)" />
          <module ref="6ed54515-acc8-4d1e-a16c-9fd6cfe951ea(MPS.Core)" />
          <module ref="8865b7a8-5271-43d3-884c-6fd1d9cfdd34(MPS.OpenAPI)" />
          <module ref="4c6a28d1-2c60-478d-b36e-db9b3cbb21fb(closures.runtime)" />
          <module ref="9b80526e-f0bf-4992-bdf5-cee39c1833f3(collections.runtime)" />
          <module ref="d936855b-48da-4812-a8a0-2bfddd633ac5(jetbrains.mps.lang.behavior.api)" />
          <module ref="d936855b-48da-4812-a8a0-2bfddd633ac4(jetbrains.mps.lang.behavior.runtime)" />
          <module ref="d7eb0a2a-bd50-4576-beae-e4a89db35f20(jetbrains.mps.lang.scopes.runtime)" />
          <module ref="9a4afe51-f114-4595-b5df-048ce3c596be(jetbrains.mps.runtime)" />
        </dependencies>
        <classpath>
          <entry path="." />
        </classpath>
        <sources jar="jetbrains.mps.build.sandbox-src.jar" descriptor="jetbrains.mps.build.sandbox.msd" />
      </module>
    </echoxml>
    <jar destfile="${build.layout}/plugins/mps-buildTest2/languages/jetbrains.mps.build.sandbox.jar" duplicate="preserve">
      <fileset dir="${build.tmp}/java/out/jetbrains.mps.build.sandbox" />
      <fileset dir="${basedir}/jetbrains.mps.build.sandbox" includes="icons/**, resources/**" />
      <fileset dir="${basedir}/jetbrains.mps.build.sandbox/source_gen" includes="**/trace.info, **/exports, **/*.mps, **/checkpoints" />
      <fileset dir="${build.tmp}/default/jetbrains.mps.build.sandbox.jar" />
    </jar>
    <copyModels todir="${build.tmp}/customProcessors/copyModels/jetbrains.mps.build.sandbox-models">
      <fileset dir="${basedir}/jetbrains.mps.build.sandbox/models" includes="**/*.mps, **/*.metadata, **/*.history, **/*.mpsr, **/.model" />
    </copyModels>
    <jar destfile="${build.layout}/plugins/mps-buildTest2/languages/jetbrains.mps.build.sandbox-src.jar" duplicate="preserve">
      <fileset dir="${basedir}/jetbrains.mps.build.sandbox/source_gen">
        <exclude name="**/trace.info" />
        <exclude name="**/exports" />
        <exclude name="**/checkpoints" />
        <exclude name="**/*.mps" />
      </fileset>
      <zipfileset file="${basedir}/jetbrains.mps.build.sandbox/jetbrains.mps.build.sandbox.msd" prefix="module" />
      <zipfileset dir="${build.tmp}/customProcessors/copyModels/jetbrains.mps.build.sandbox-models" prefix="module/models" />
    </jar>
    <echo file="${build.layout}/build.properties">mps.build.number=${mps.build.number}${line.separator}mps.date=${mps.date}${line.separator}mps.build.vcs.number=${mps.build.vcs.number}${line.separator}mps.teamcity.buildConfName=${mps.teamcity.buildConfName}${line.separator}mps.idea.platform.build.number=${mps.idea.platform.build.number}${line.separator}mps.mps.build.counter=${mps.mps.build.counter}${line.separator}mpsBootstrapCore.version=${mpsBootstrapCore.version}</echo>
  </target>
  
  <target name="buildDependents">
    <ant antfile="../../../../build/mpsBootstrapCore.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsCore.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsBuild.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsTroveCollections.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsTesting.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsWorkbench.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsStandalone.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsDevKit.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsJavaPlatform.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsJavaWorkbench.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsMakePlugin.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsPlugins.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsHttpSupportPlugin.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsDebuggerPlugin.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsExecutionPlugin.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsBuildUI.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsVcsCore.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsVcs.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/jetpad.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsDiagramEditor.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mpsContextActionsTool.xml" inheritAll="false" useNativeBasedir="true" />
    <ant antfile="../../../../build/mps.xml" inheritAll="false" useNativeBasedir="true" />
  </target>
  
  <target name="fetchDependencies" />
  
  <target name="build" depends="assemble" />
  
  <target name="clean">
    <delete dir="${build.tmp}" />
    <delete dir="${build.layout}" />
  </target>
  
  <target name="compileJava" depends="java.compile.jetbrains.mps.build.sandbox" />
  
  <target name="processResources" />
  
  <target name="classes" depends="compileJava, processResources" />
  
  <target name="test" depends="classes" />
  
  <target name="check" depends="test" />
  
  <target name="generate" depends="declare-mps-tasks, fetchDependencies">
    <echo message="generating" />
    <generate strictMode="true" parallelMode="true" parallelThreads="8" useInplaceTransform="false" hideWarnings="false" createStaticRefs="true" fork="true">
      <plugin path="${artifacts.mps}/plugins/mps-core/META-INF/plugin.xml/../.." />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.blTypes.jar" />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.classifiers.jar" />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.closures.jar" />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.collections.jar" />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.extensionMethods.jar" />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.jar" />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.javadoc.jar" />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.jdk7.jar" />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.logging.jar" />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.regexp.jar" />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.regexp.runtime.jar" />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.scopes.jar" />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.tuples.jar" />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.unitTest.libs/jetbrains.mps.baseLanguage.unitTest.libs.jar" />
      <library file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguageInternal.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.baseLanguage.lightweightdsl.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.actions.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.behavior.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.checkedName.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.constraints.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.core.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.dataFlow.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.editor.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.extension.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.findUsages.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.generator.generationContext.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.generator.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.intentions.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.migration.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.migration.runtime.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.pattern.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.plugin.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.project.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.quotation.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.refactoring.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.resources.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.scopes.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.scopes.runtime.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.script.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.sharedConcepts.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.smodel.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.smodel.query.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.structure.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.textGen.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.traceable.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.typesystem.jar" />
      <library file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.refactoring.participant.jar" />
      <library file="${artifacts.mps}/languages/make/jetbrains.mps.make.reduced.jar" />
      <library file="${artifacts.mps}/languages/make/jetbrains.mps.tool.gentest.jar" />
      <library file="${artifacts.mps}/languages/xml/jetbrains.mps.core.xml.jar" />
      <library file="${artifacts.mps}/lib/mps-behavior-api.jar" />
      <library file="${artifacts.mps}/lib/mps-behavior-runtime.jar" />
      <library file="${artifacts.mps}/lib/mps-closures.jar" />
      <library file="${artifacts.mps}/lib/mps-collections.jar" />
      <library file="${artifacts.mps}/lib/mps-core.jar" />
      <library file="${artifacts.mps}/lib/mps-editor.jar" />
      <library file="${artifacts.mps}/lib/mps-environment.jar" />
      <library file="${artifacts.mps}/lib/mps-openapi.jar" />
      <library file="${artifacts.mps}/lib/mps-platform.jar" />
      <library file="${artifacts.mps}/lib/mps-test.jar" />
      <library file="${artifacts.mps}/lib/mps-tool.jar" />
      <library file="${artifacts.mps}/lib/mps-tuples.jar" />
      <library file="${artifacts.mps}/lib/mps-workbench.jar" />
      <library file="${artifacts.mps}/plugins/mps-build/languages/build/jetbrains.mps.build.jar" />
      <library file="${artifacts.mps}/plugins/mps-build/languages/build/jetbrains.mps.build.mps.jar" />
      <library file="${artifacts.mps}/plugins/mps-build/languages/build/jetbrains.mps.build.workflow.jar" />
      <library file="${artifacts.mps}/plugins/mps-build/languages/build/jetbrains.mps.ide.build.jar" />
      <chunk>
        <module file="${basedir}/jetbrains.mps.build.sandbox/jetbrains.mps.build.sandbox.msd" />
      </chunk>
      <jvmargs>
        <arg value="-Xmx512m" />
      </jvmargs>
    </generate>
  </target>
  
  <target name="declare-mps-tasks">
    <taskdef resource="jetbrains/mps/build/ant/antlib.xml" classpathref="path.mps.ant.path" />
  </target>
  
  <target name="makeDependents">
    <ant antfile="../../../../build/mpsBootstrapCore.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsCore.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsBuild.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsTroveCollections.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsTesting.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsWorkbench.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsStandalone.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsDevKit.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsJavaPlatform.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsJavaWorkbench.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsMakePlugin.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsPlugins.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsHttpSupportPlugin.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsDebuggerPlugin.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsExecutionPlugin.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsBuildUI.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsVcsCore.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsVcs.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/jetpad.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsDiagramEditor.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mpsContextActionsTool.xml" inheritAll="false" useNativeBasedir="true">
      <target name="generate" />
      <target name="assemble" />
    </ant>
    <ant antfile="../../../../build/mps.xml" inheritAll="false" useNativeBasedir="true">
      <target name="assemble" />
    </ant>
  </target>
  
  <target name="java.compile.jetbrains.mps.build.sandbox" depends="fetchDependencies">
    <mkdir dir="${basedir}/jetbrains.mps.build.sandbox/source_gen" />
    <mkdir dir="${build.tmp}/java/out/jetbrains.mps.build.sandbox" />
    <javac destdir="${build.tmp}/java/out/jetbrains.mps.build.sandbox" fork="false" encoding="utf8" includeantruntime="false">
      <compilerarg value="-Xlint:none" />
      <src>
        <path location="${basedir}/jetbrains.mps.build.sandbox/source_gen" />
      </src>
      <classpath>
        <fileset file="${artifacts.mps}/lib/mps-behavior-api.jar" />
        <fileset file="${artifacts.mps}/lib/mps-behavior-runtime.jar" />
        <fileset file="${artifacts.mps}/lib/mps-closures.jar" />
        <fileset file="${artifacts.mps}/lib/mps-collections.jar" />
        <fileset file="${artifacts.mps}/lib/mps-annotations.jar" />
        <fileset file="${artifacts.mps}/lib/mps-openapi.jar" />
        <fileset file="${artifacts.mps}/lib/mps-core.jar" />
        <fileset file="${artifacts.mps}/lib/mps-logging.jar" />
        <fileset file="${artifacts.mps}/lib/mps-tuples.jar" />
        <fileset file="${artifacts.mps}/lib/mps-messaging.jar" />
        <fileset file="${artifacts.mps}/lib/mps-boot-util.jar" />
        <fileset file="${artifacts.mps}/lib/mps-editor.jar" />
        <fileset file="${artifacts.mps}/lib/mps-editor-api.jar" />
        <fileset file="${artifacts.mps}/lib/mps-editor-runtime.jar" />
        <fileset file="${artifacts.mps}/lib/mps-environment.jar" />
        <fileset file="${artifacts.mps}/lib/mps-platform.jar" />
        <fileset file="${artifacts.mps}/lib/mps-icons.jar" />
        <fileset file="${artifacts.mps}/lib/mps-workbench.jar" />
        <fileset file="${artifacts.mps}/lib/annotations.jar" />
        <fileset file="${artifacts.mps}/lib/log4j.jar" />
        <fileset file="${artifacts.mps}/lib/jdom.jar" />
        <fileset file="${artifacts.mps}/lib/trove4j.jar" />
        <fileset file="${artifacts.mps}/lib/ecj-4.6.2.jar" />
        <fileset dir="${artifacts.mps}/lib" includes="*.jar" />
        <fileset file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.jar" />
        <fileset file="${artifacts.mps}/languages/baseLanguage/jetbrains.mps.baseLanguage.scopes.jar" />
        <fileset file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.core.jar" />
        <fileset file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.scopes.runtime.jar" />
        <fileset file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.structure.jar" />
        <fileset file="${artifacts.mps}/languages/languageDesign/jetbrains.mps.lang.traceable.jar" />
      </classpath>
    </javac>
    <copy todir="${build.tmp}/java/out/jetbrains.mps.build.sandbox">
      <fileset dir="${basedir}/jetbrains.mps.build.sandbox/source_gen" excludes="**/*.java" />
    </copy>
  </target>
  
  <target name="cleanSources">
    <delete dir="${basedir}/jetbrains.mps.build.sandbox/source_gen" />
  </target>
</project>