Simplify running verify locally and remove errors.

This commit is contained in:
Nikolay Krasko
2013-09-11 16:42:08 +04:00
parent e4c1fe7c3a
commit 053fc31021
2 changed files with 44 additions and 14 deletions
Generated
+1
View File
@@ -8,6 +8,7 @@
</buildFile>
<buildFile url="file://$PROJECT_DIR$/update_dependencies.xml" />
<buildFile url="file://$PROJECT_DIR$/TeamCityBuild.xml" />
<buildFile url="file://$PROJECT_DIR$/pluginPublisher/TeamCityPluginPublisher.xml" />
</component>
</project>
+43 -14
View File
@@ -4,12 +4,33 @@
eap - for getting idea from eap page
release - for getting idea from download site
version - idea version
actual.branch - current branch name
expected.branch - "verifyAndPublish" target will work only if actual and expected branches is equal
expected.branch - "verifyAndPublish" target will work only if expected branches is equal to teamcity current branch
-->
<property name="version" value="undefined-version"/>
<property name="expected.branch" value="master"/>
<property name="teamcity.build.branch" value="master"/>
<property name="verify.dir" value="${basedir}/verify"/>
<property name="kotlin.plugin.dir" value="${basedir}"/>
<property name="kannotator.plugin.dir" value="${basedir}"/>
<condition property="download.eap">
<isset property="eap"/>
</condition>
<condition property="download.release">
<or>
<isset property="release"/>
<not>
<isset property="download.eap"/>
</not>
</or>
</condition>
<condition property="is.expected.branch">
<equals arg1="${actual.branch}" arg2="${expected.branch}" />
<equals arg1="${teamcity.build.branch}" arg2="${expected.branch}" />
</condition>
<property name="idea.eap.download.page.url" value="http://confluence.jetbrains.com/display/IDEADEV/IDEA+${version}+EAP"/>
@@ -36,7 +57,7 @@
</sequential>
</macrodef>
<target name="setEapDownload" if="eap">
<target name="setEapDownload" if="download.eap">
<loadresource property="download.url">
<url url="${idea.eap.download.page.url}"/>
<filterchain>
@@ -49,24 +70,28 @@
</loadresource>
</target>
<target name="setReleasedDownload" if="release">
<target name="setReleasedDownload" if="download.release">
<property name="download.url" value="${idea.release.download.page.url}" />
</target>
<target name="verifyAndPublish" depends="setEapDownload, setReleasedDownload" if="is.expected.branch">
<echo message="External parameters: ${eap} Release ${release} Version ${version}" />
<echo message="From external parameters: ${download.eap} Release ${download.release} Version ${version}" />
<mkdir dir="${verify.dir}" />
<!-- Download and extract IDEA -->
<echo message="Downloading IDEA from ${download.url}"/>
<get src="${download.url}" dest="ideaIC.tar.gz" verbose="on" usetimestamp="true"/>
<untar src="ideaIC.tar.gz" dest="${basedir}" overwrite="on" compression="gzip"/>
<get src="${download.url}" dest="${verify.dir}/ideaIC.tar.gz" verbose="on" usetimestamp="true"/>
<untar src="${verify.dir}/ideaIC.tar.gz" dest="${verify.dir}" overwrite="on" compression="gzip"/>
<!-- Get extracted IDEA directory -->
<pathconvert property="idea.dir">
<dirset dir="${basedir}">
<dirset dir="${verify.dir}">
<include name="idea-IC-*"/>
</dirset>
</pathconvert>
<!--suppress AntResolveInspection -->
<loadfile property="idea.version" srcfile="${idea.dir}/build.txt" />
<echo message="IDEA version is ${idea.version} located ${idea.dir}"/>
@@ -74,15 +99,16 @@
<!-- Get plugin verifier -->
<delete file="plugin-verifier.jar" failonerror="false"/>
<get src="http://teamcity.jetbrains.com/guestAuth/repository/download/bt351/.lastPinned/plugin-verifier-1.0-SNAPSHOT.jar"
dest="plugin-verifier.jar"/>
dest="${verify.dir}/plugin-verifier.jar"/>
<!-- Get kotlin plugin -->
<pathconvert property="kotlin.plugin.path">
<fileset dir="${basedir}">
<fileset dir="${kotlin.plugin.dir}">
<include name="kotlin-plugin-*"/>
</fileset>
</pathconvert>
<basename property="kotlin.plugin.filename" file="${kotlin.plugin.path}"/>
<loadresource property="kotlin.plugin.version">
<string value="${kotlin.plugin.filename}"/>
<filterchain>
@@ -93,11 +119,12 @@
</filterchain>
</loadresource>
<!--suppress AntResolveInspection -->
<echo message="Kotlin Plugin version is ${kotlin.plugin.version} located ${kotlin.plugin.path}"/>
<!-- Get kannotator plugin -->
<pathconvert property="kannotator.plugin.path">
<fileset dir="${basedir}">
<fileset dir="${kannotator.plugin.dir}">
<include name="kannotator-plugin-*"/>
</fileset>
</pathconvert>
@@ -112,13 +139,15 @@
</filterchain>
</loadresource>
<!--suppress AntResolveInspection -->
<echo message="Kannotator Plugin version is ${kannotator.plugin.version} located ${kannotator.plugin.path}"/>
<!-- Verify both plugins -->
<verifyPlugin verifier.jar="plugin-verifier.jar" verify.against.idea.dir="${idea.dir}" verify.plugin.path="${kotlin.plugin.path}" />
<verifyPlugin verifier.jar="plugin-verifier.jar" verify.against.idea.dir="${idea.dir}" verify.plugin.path="${kannotator.plugin.path}" />
<verifyPlugin verifier.jar="${verify.dir}/plugin-verifier.jar" verify.against.idea.dir="${idea.dir}" verify.plugin.path="${kotlin.plugin.path}" />
<verifyPlugin verifier.jar="${verify.dir}/plugin-verifier.jar" verify.against.idea.dir="${idea.dir}" verify.plugin.path="${kannotator.plugin.path}" />
<!-- Everything is ok, publish plugin and xml descriptor -->
<!--suppress AntResolveInspection -->
<echo message="##teamcity[buildStatus text='kotlin-${kotlin.plugin.version} and kannotator-${kannotator.plugin.version} have been verified against ${idea.version}']"/>
<echo message="##teamcity[publishArtifacts '${kotlin.plugin.path}']"/>
<echo message="##teamcity[publishArtifacts '${kannotator.plugin.path}']"/>