Permalink
Fetching contributors…
Cannot retrieve contributors at this time
348 lines (302 sloc) 16 KB
<?xml version="1.0" encoding="UTF-8"?>
<project name="module_intellij-elixir" default="compile.module.intellij-elixir">
<dirname property="module.intellij-elixir.basedir" file="${ant.file.module_intellij-elixir}"/>
<import file="${module.intellij-elixir.basedir}/idea.xml"/>
<import file="${module.intellij-elixir.basedir}/elixir.xml"/>
<property name="module.jdk.home.intellij-elixir" value="${project.jdk.home}"/>
<property name="module.jdk.bin.intellij-elixir" value="${project.jdk.bin}"/>
<property name="module.jdk.classpath.intellij-elixir" value="${project.jdk.classpath}"/>
<property name="compiler.args.intellij-elixir" value="-encoding UTF-8 -source 1.6 ${compiler.args}"/>
<property name="intellij-elixir.bin.dir" value="${module.intellij-elixir.basedir}/bin" />
<property name="intellij-elixir.jps-shared.output.dir" value="${module.intellij-elixir.basedir}/out/production/jps-shared" />
<property name="intellij-elixir.jps-builder.output.dir" value="${module.intellij-elixir.basedir}/out/production/jps-builder" />
<property name="intellij-elixir.output.dir" value="${module.intellij-elixir.basedir}/out/production/intellij-elixir"/>
<property name="intellij-elixir.testoutput.dir" value="${module.intellij-elixir.basedir}/out/test/intellij-elixir"/>
<path id="intellij-elixir.module.bootclasspath">
<!-- Paths to be included in compilation bootclasspath -->
</path>
<path id="intellij-elixir.module.production.classpath">
<path refid="${module.jdk.classpath.intellij-elixir}"/>
<path refid="library.junit.classpath"/>
<pathelement location="${idea.cache}/lib/hamcrest-core-1.3.jar"/>
<pathelement location="${idea.cache}/lib/hamcrest-library-1.3.jar"/>
<pathelement location="${idea.cache}/lib/junit-4.11.jar"/>
</path>
<path id="intellij-elixir.runtime.production.module.classpath">
<pathelement location="${intellij-elixir.output.dir}"/>
<path refid="library.junit.classpath"/>
<pathelement location="${idea.cache}/lib/hamcrest-core-1.3.jar"/>
<pathelement location="${idea.cache}/lib/hamcrest-library-1.3.jar"/>
<pathelement location="${idea.cache}/lib/junit-4.11.jar"/>
</path>
<path id="intellij-elixir.module.classpath">
<path refid="${module.jdk.classpath.intellij-elixir}"/>
<pathelement location="${intellij-elixir.output.dir}"/>
<path refid="library.junit.classpath"/>
<pathelement location="#{basedir}/tests/objenesis-2.1.jar"/>
<pathelement location="#{basedir}/tests/mockito-2.1.jar"/>
<pathelement location="${idea.cache}/lib/hamcrest-core-1.3.jar"/>
<pathelement location="${idea.cache}/lib/hamcrest-library-1.3.jar"/>
<pathelement location="${idea.cache}/lib/junit-4.11.jar"/>
</path>
<path id="intellij-elixir.runtime.module.classpath">
<pathelement location="${intellij-elixir.testoutput.dir}"/>
<pathelement location="${intellij-elixir.output.dir}"/>
<path refid="library.junit.classpath"/>
<pathelement location="${idea.cache}/lib/hamcrest-core-1.3.jar"/>
<pathelement location="${idea.cache}/lib/hamcrest-library-1.3.jar"/>
<pathelement location="${idea.cache}/lib/junit-4.11.jar"/>
</path>
<patternset id="excluded.from.module.intellij-elixir">
<patternset refid="ignored.files"/>
</patternset>
<patternset id="excluded.from.compilation.intellij-elixir">
<patternset refid="excluded.from.module.intellij-elixir"/>
</patternset>
<path id="intellij-elixir.module.jps-shared.sourcepath">
<dirset dir="${module.intellij-elixir.basedir}/jps-shared">
<include name="src"/>
</dirset>
</path>
<path id="intellij-elixir.module.jps-builder.sourcepath">
<dirset dir="${module.intellij-elixir.basedir}/jps-builder">
<include name="src"/>
</dirset>
</path>
<path id="intellij-elixir.module.sourcepath">
<dirset dir="${module.intellij-elixir.basedir}">
<include name="src"/>
<include name="gen"/>
<include name="res"/>
</dirset>
</path>
<path id="intellij-elixir.module.test.sourcepath">
<dirset dir="${module.intellij-elixir.basedir}">
<include name="tests"/>
<include name="testData"/>
</dirset>
</path>
<target name="compile.module.intellij-elixir" depends="compile.module.intellij-elixir.production,compile.module.intellij-elixir.tests" description="Compile module intellij-elixir"/>
<target name="compile.module.jps-shared.production" depends="register.custom.compilers,set.elixir.code.lib.dir" description="Compile module jps-shared; production classes">
<mkdir dir="${intellij-elixir.jps-shared.output.dir}"/>
<javac2 destdir="${intellij-elixir.jps-shared.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.intellij-elixir}/javac">
<compilerarg line="${compiler.args.intellij-elixir}"/>
<bootclasspath refid="intellij-elixir.module.bootclasspath"/>
<classpath>
<path refid="intellij-elixir.module.production.classpath"/>
<path>
<fileset dir="${elixir.code.lib.dir}">
<include name="jinterface-*/priv/OtpErlang.jar"/>
</fileset>
</path>
</classpath>
<src refid="intellij-elixir.module.jps-shared.sourcepath"/>
<patternset refid="excluded.from.compilation.intellij-elixir"/>
</javac2>
<copy todir="${intellij-elixir.jps-shared.output.dir}">
<fileset dir="${module.intellij-elixir.basedir}/jps-shared/src">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
<target name="compile.module.jps-builder.production" depends="register.custom.compilers,compile.module.jps-shared.production,set.elixir.code.lib.dir" description="Compile module jps-builder; production classes">
<mkdir dir="${intellij-elixir.jps-builder.output.dir}"/>
<javac2 destdir="${intellij-elixir.jps-builder.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.intellij-elixir}/javac">
<compilerarg line="${compiler.args.intellij-elixir}"/>
<bootclasspath refid="intellij-elixir.module.bootclasspath"/>
<classpath refid="intellij-elixir.module.production.classpath"/>
<classpath path="${intellij-elixir.jps-shared.output.dir}"/>
<src refid="intellij-elixir.module.jps-builder.sourcepath"/>
<patternset refid="excluded.from.compilation.intellij-elixir"/>
</javac2>
<copy todir="${intellij-elixir.jps-builder.output.dir}">
<fileset dir="${module.intellij-elixir.basedir}/jps-builder/src">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
<target name="compile.module.intellij-elixir.production" depends="register.custom.compilers,compile.module.jps-shared.production,compile.module.jps-builder.production,set.elixir.code.lib.dir" description="Compile module intellij-elixir; production classes">
<mkdir dir="${intellij-elixir.output.dir}"/>
<javac2 destdir="${intellij-elixir.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.intellij-elixir}/javac">
<compilerarg line="${compiler.args.intellij-elixir}"/>
<bootclasspath refid="intellij-elixir.module.bootclasspath"/>
<classpath refid="intellij-elixir.module.production.classpath"/>
<classpath path="${intellij-elixir.jps-shared.output.dir}"/>
<classpath path="${intellij-elixir.jps-builder.output.dir}"/>
<classpath>
<path>
<fileset dir="${elixir.code.lib.dir}">
<include name="jinterface-*/priv/OtpErlang.jar"/>
</fileset>
</path>
</classpath>
<src refid="intellij-elixir.module.sourcepath"/>
<patternset refid="excluded.from.compilation.intellij-elixir"/>
</javac2>
<copy todir="${intellij-elixir.output.dir}">
<fileset dir="${module.intellij-elixir.basedir}/src">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
<fileset dir="${module.intellij-elixir.basedir}/gen">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
<fileset dir="${module.intellij-elixir.basedir}/res">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
<target name="compile.module.intellij-elixir.tests" depends="register.custom.compilers,compile.module.intellij-elixir.production,set.elixir.code.lib.dir" description="compile module intellij-elixir; test classes" unless="skip.tests">
<mkdir dir="${intellij-elixir.testoutput.dir}"/>
<javac2 destdir="${intellij-elixir.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.intellij-elixir}/javac">
<compilerarg line="${compiler.args.intellij-elixir}"/>
<bootclasspath refid="intellij-elixir.module.bootclasspath"/>
<classpath refid="intellij-elixir.module.classpath"/>
<classpath>
<path>
<fileset dir="${elixir.code.lib.dir}">
<include name="jinterface-*/priv/OtpErlang.jar"/>
</fileset>
</path>
</classpath>
<src refid="intellij-elixir.module.test.sourcepath"/>
<patternset refid="excluded.from.compilation.intellij-elixir"/>
</javac2>
<copy todir="${intellij-elixir.testoutput.dir}">
<fileset dir="${module.intellij-elixir.basedir}/tests">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
<fileset dir="${module.intellij-elixir.basedir}/testData">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
<target name="clean.module.intellij-elixir" description="cleanup module">
<delete dir="${intellij-elixir.jps-shared.output.dir}"/>
<delete dir="${intellij-elixir.jps-builder.output.dir}"/>
<delete dir="${intellij-elixir.output.dir}"/>
<delete dir="${intellij-elixir.testoutput.dir}"/>
</target>
<path id="classpath.test">
<path refid="intellij-elixir.module.production.classpath"/>
<pathelement location="${intellij-elixir.output.dir}"/>
<pathelement location="${intellij-elixir.testoutput.dir}"/>
<pathelement location="${idea.cache}/lib/guava-17.0.jar"/>
</path>
<property name="test" value="tests"/>
<import file="${module.intellij-elixir.basedir}/elixir.xml"/>
<import file="${module.intellij-elixir.basedir}/intellij_elixir.xml"/>
<target name="test.module.intellij-elixir" depends="compile.module.intellij-elixir,release.intellij_elixir,set.elixir.code.lib.dir,unpack.elixir.zip" description="test module">
<mkdir dir="tmp"/>
<mkdir dir="tmp/results"/>
<property environment="env"/>
<exec executable="${intellij_elixir.executable}">
<arg value="start"/>
<env key="PATH" value="${env.PATH}:${elixir.output.zip.root.dir}/bin"/>
</exec>
<!-- must fork or env won't work -->
<junit failureproperty="failure_found"
fork="true"
forkmode="once"
haltonfailure="no"
printsummary="on"
showoutput="yes">
<env key="ELIXIR_LANG_ELIXIR_PATH" value="${elixir.output.zip.root.dir}"/>
<env key="INTELLIJ_ELIXIR_PATH" value="${module.intellij-elixir.basedir}"/>
<env key="ELIXIR_EBIN_DIRECTORY" value="${elixir.output.zip.root.dir}/lib/elixir/ebin/"/>
<classpath>
<path refid="classpath.test" />
<path>
<fileset dir="${elixir.code.lib.dir}">
<include name="jinterface-*/priv/OtpErlang.jar"/>
</fileset>
</path>
<pathelement location="${basedir}/tests/mockito-core-2.0.7-beta.jar"/>
<pathelement location="${basedir}/tests/objenesis-2.1.jar"/>
<pathelement location="${test.build}"/>
<pathelement location="${idea.cache}/lib/junit-4.11.jar"/>
</classpath>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<batchtest todir="tmp/results">
<fileset dir="${test}">
<include name="**/*Test*.java"/>
<!-- Marked with @Ignore annotation, but not ignored for unknown reason -->
<exclude name="org/elixir_lang/parser_definition/ParsingTestCase.java"/>
<exclude name="org/elixir_lang/parser_definition/**/ParsingTestCase.java"/>
<!-- TODO get inspection tests to work with ant -->
<exclude name="org/elixir_lang/inspection/*TestCase.java"/>
<!-- Causes ERROR: Problems during index shutdown. TODO get fix from https://devnet.jetbrains.com/message/5539376#5539376 -->
<exclude name="org/elixir_lang/action/*Test.java"/>
<exclude name="org/elixir_lang/mix/importWizard/*Test.java"/>
</fileset>
</batchtest>
</junit>
<exec executable="${intellij_elixir.executable}">
<arg value="stop"/>
</exec>
<!-- generate report with junitreport -->
<junitreport todir="tmp">
<fileset dir="tmp/results" />
<report todir="tmp/report" />
</junitreport>
<!-- concat the report through a filter chain to extract what you want -->
<concat>
<fileset file="tmp/report/overview-summary.html" />
<filterchain>
<linecontainsregexp>
<regexp pattern='title="Display all tests"' />
</linecontainsregexp>
<tokenfilter>
<replaceregex pattern='&lt;td&gt;&lt;a title="Display all tests" href="all-tests.html"&gt;(\d+)&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;a title="Display all failures" href="alltests-fails.html"&gt;(\d+)&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;a title="Display all errors" href="alltests-errors.html"&gt;(\d+).*$' replace="Run: \1, Failed: \2, Errors: \3" />
</tokenfilter>
</filterchain>
</concat>
<antcall target="check_test"/>
</target>
<target name="check_test" if="failure_found">
<fail message="Failures found"/>
</target>
<property name="intellij-elixir.plugin.path.jar" value="${module.intellij-elixir.basedir}/intellij-elixir.zip"/>
<!-- Build archive for plugin 'intellij-elixir' -->
<target name="plugin.build.jar.intellij-elixir" depends="compile.module.intellij-elixir" description="Build plugin archive for module &#39;intellij-elixir&#39;">
<property name="tmp.dir.intellij-elixir" value="${module.intellij-elixir.basedir}/../temp"/>
<mkdir dir="${tmp.dir.intellij-elixir}"/>
<mkdir dir="${tmp.dir.intellij-elixir}/lib"/>
<mkdir dir="${tmp.dir.intellij-elixir}/lib/jps"/>
<jar destfile="${tmp.dir.intellij-elixir}/lib/jps-shared.jar" duplicate="preserve">
<zipfileset dir="${intellij-elixir.jps-shared.output.dir}"/>
<manifest>
<attribute name="Created-By" value="IntelliJ IDEA"/>
<attribute name="Manifest-Version" value="1.0"/>
</manifest>
</jar>
<jar destfile="${tmp.dir.intellij-elixir}/lib/jps/jps-builder.jar" duplicate="preserve">
<zipfileset dir="${intellij-elixir.jps-builder.output.dir}"/>
<manifest>
<attribute name="Created-By" value="IntelliJ IDEA"/>
<attribute name="Manifest-Version" value="1.0"/>
</manifest>
</jar>
<jar destfile="${tmp.dir.intellij-elixir}/lib/intellij-elixir.jar" duplicate="preserve">
<zipfileset dir="${intellij-elixir.output.dir}"/>
<manifest>
<attribute name="Created-By" value="IntelliJ IDEA"/>
<attribute name="Manifest-Version" value="1.0"/>
</manifest>
</jar>
<copy file="${idea.cache}/lib/junit-4.11.jar" tofile="${tmp.dir.intellij-elixir}/lib/junit-4.11.jar"/>
<copy file="${idea.cache}/lib/hamcrest-core-1.3.jar" tofile="${tmp.dir.intellij-elixir}/lib/hamcrest-core-1.3.jar"/>
<copy file="${idea.cache}/lib/hamcrest-library-1.3.jar" tofile="${tmp.dir.intellij-elixir}/lib/hamcrest-library-1.3.jar"/>
<zip destfile="${intellij-elixir.plugin.path.jar}">
<fileset dir="${module.intellij-elixir.basedir}/../temp"/>
</zip>
<delete dir="${tmp.dir.intellij-elixir}"/>
</target>
</project>