105 lines
3.8 KiB
XML
105 lines
3.8 KiB
XML
<project name="Jet CI Steps" default="none">
|
|
<import file="build.xml" optional="false"/>
|
|
|
|
<property name="build.number" value="snapshot"/>
|
|
<property name="jdk16.home" value="${java.home}"/>
|
|
<property name="fail.on.plugin.verifier.error" value="true"/>
|
|
|
|
<property name="artifact.output.path" value="${basedir}/out/artifacts"/>
|
|
<property name="plugin.xml" value="idea/src/META-INF/plugin.xml"/>
|
|
<property name="plugin.xml.bk" value="${plugin.xml}.bk"/>
|
|
<property name="plugin.xml.versioned" value="${plugin.xml}.versioned.bk" />
|
|
|
|
<property name="plugin.verifier" value="${basedir}/PluginVerifier/plugin-verifier-1.0-SNAPSHOT.jar"/>
|
|
<property name="plugin.zip" value="${artifact.output.path}/kotlin-plugin-${build.number}.zip" />
|
|
|
|
<macrodef name="echoprop">
|
|
<attribute name="prop"/>
|
|
<sequential>
|
|
<echo>@{prop}=${@{prop}}</echo>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<echoprop prop="os.name"/>
|
|
<echoprop prop="os.version"/>
|
|
<echoprop prop="os.arch"/>
|
|
<echoprop prop="java.home"/>
|
|
<echoprop prop="java.vendor"/>
|
|
<echoprop prop="java.version"/>
|
|
<echoprop prop="user.name"/>
|
|
<echoprop prop="user.home"/>
|
|
<echoprop prop="user.dir"/>
|
|
|
|
<target name="unzipDependencies">
|
|
<unzip dest="ideaSDK">
|
|
<fileset dir="ideaSDK" includes="ideaIC*.zip"/>
|
|
</unzip>
|
|
|
|
<delete dir="ideaSDK" includes="ideaIC*.zip"/>
|
|
</target>
|
|
|
|
<target name="cleanupArtifacts">
|
|
<delete dir="${artifact.output.path}" includes="*"/>
|
|
</target>
|
|
|
|
<target name="writeVersionToPluginXml">
|
|
<!-- Create backup. Backup will be restored after build end. This will allow to rebuild project without renew
|
|
plugin.xml from repository. -->
|
|
<copy file="${plugin.xml}" tofile="${plugin.xml.bk}" />
|
|
|
|
<!-- Check that version has correct pattern for substitution -->
|
|
<copy todir="">
|
|
<fileset file="${plugin.xml.bk}">
|
|
<contains text="<version>@snapshot@</version>"/>
|
|
</fileset>
|
|
<filterchain>
|
|
<replacetokens>
|
|
<token key="snapshot" value="${build.number}"/>
|
|
</replacetokens>
|
|
</filterchain>
|
|
<mergemapper to="${plugin.xml.versioned}"/>
|
|
</copy>
|
|
|
|
<!-- If file doesn't exist - there's a problem with original plugin.xml. Probably there's a bad pattern used for version -->
|
|
<copy file="${plugin.xml.versioned}" tofile="${plugin.xml}" overwrite="true"/>
|
|
|
|
<delete file="${plugin.xml.versioned}" quiet="true"/>
|
|
</target>
|
|
|
|
<target name="revertPluginXml">
|
|
<copy file="${plugin.xml.bk}" tofile="${plugin.xml}" overwrite="true"/>
|
|
<delete file="${plugin.xml.bk}" quiet="true"/>
|
|
</target>
|
|
|
|
<target name="pre_build" depends="cleanupArtifacts, unzipDependencies, dist, writeVersionToPluginXml, generateInjectors">
|
|
</target>
|
|
|
|
<target name="zipArtifact">
|
|
<zip destfile="${plugin.zip}">
|
|
<zipfileset prefix="Kotlin" dir="${artifact.output.path}/Kotlin"/>
|
|
</zip>
|
|
<delete dir="${artifact.output.path}/Kotlin" quiet="true"/>
|
|
</target>
|
|
|
|
<target name="verifyPlugin">
|
|
<!--
|
|
disabled plugin-verifier for now, waiting
|
|
for better plugin dependencies handling in it
|
|
-->
|
|
<!--
|
|
<java fork="true" failonerror="${fail.on.plugin.verifier.error}" jar="${plugin.verifier}">
|
|
<arg value="-r" />
|
|
<arg value="${jdk16.home}" />
|
|
<arg value="${plugin.zip}" />
|
|
<arg value="${basedir}/ideaSDK" />
|
|
</java>
|
|
-->
|
|
</target>
|
|
|
|
<target name="post_build" depends="zipArtifact, revertPluginXml, verifyPlugin"/>
|
|
|
|
<target name="none">
|
|
<fail message="Either specify pre_build or post_build"/>
|
|
</target>
|
|
</project>
|