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>
<buildFile url="file://$PROJECT_DIR$/update_dependencies.xml" /> <buildFile url="file://$PROJECT_DIR$/update_dependencies.xml" />
<buildFile url="file://$PROJECT_DIR$/TeamCityBuild.xml" /> <buildFile url="file://$PROJECT_DIR$/TeamCityBuild.xml" />
<buildFile url="file://$PROJECT_DIR$/pluginPublisher/TeamCityPluginPublisher.xml" />
</component> </component>
</project> </project>
+43 -14
View File
@@ -4,12 +4,33 @@
eap - for getting idea from eap page eap - for getting idea from eap page
release - for getting idea from download site release - for getting idea from download site
version - idea version version - idea version
actual.branch - current branch name expected.branch - "verifyAndPublish" target will work only if expected branches is equal to teamcity current branch
expected.branch - "verifyAndPublish" target will work only if actual and expected branches is equal
--> -->
<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"> <condition property="is.expected.branch">
<equals arg1="${actual.branch}" arg2="${expected.branch}" /> <equals arg1="${teamcity.build.branch}" arg2="${expected.branch}" />
</condition> </condition>
<property name="idea.eap.download.page.url" value="http://confluence.jetbrains.com/display/IDEADEV/IDEA+${version}+EAP"/> <property name="idea.eap.download.page.url" value="http://confluence.jetbrains.com/display/IDEADEV/IDEA+${version}+EAP"/>
@@ -36,7 +57,7 @@
</sequential> </sequential>
</macrodef> </macrodef>
<target name="setEapDownload" if="eap"> <target name="setEapDownload" if="download.eap">
<loadresource property="download.url"> <loadresource property="download.url">
<url url="${idea.eap.download.page.url}"/> <url url="${idea.eap.download.page.url}"/>
<filterchain> <filterchain>
@@ -49,24 +70,28 @@
</loadresource> </loadresource>
</target> </target>
<target name="setReleasedDownload" if="release"> <target name="setReleasedDownload" if="download.release">
<property name="download.url" value="${idea.release.download.page.url}" /> <property name="download.url" value="${idea.release.download.page.url}" />
</target> </target>
<target name="verifyAndPublish" depends="setEapDownload, setReleasedDownload" if="is.expected.branch"> <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 --> <!-- Download and extract IDEA -->
<echo message="Downloading IDEA from ${download.url}"/> <echo message="Downloading IDEA from ${download.url}"/>
<get src="${download.url}" dest="ideaIC.tar.gz" verbose="on" usetimestamp="true"/> <get src="${download.url}" dest="${verify.dir}/ideaIC.tar.gz" verbose="on" usetimestamp="true"/>
<untar src="ideaIC.tar.gz" dest="${basedir}" overwrite="on" compression="gzip"/> <untar src="${verify.dir}/ideaIC.tar.gz" dest="${verify.dir}" overwrite="on" compression="gzip"/>
<!-- Get extracted IDEA directory --> <!-- Get extracted IDEA directory -->
<pathconvert property="idea.dir"> <pathconvert property="idea.dir">
<dirset dir="${basedir}"> <dirset dir="${verify.dir}">
<include name="idea-IC-*"/> <include name="idea-IC-*"/>
</dirset> </dirset>
</pathconvert> </pathconvert>
<!--suppress AntResolveInspection -->
<loadfile property="idea.version" srcfile="${idea.dir}/build.txt" /> <loadfile property="idea.version" srcfile="${idea.dir}/build.txt" />
<echo message="IDEA version is ${idea.version} located ${idea.dir}"/> <echo message="IDEA version is ${idea.version} located ${idea.dir}"/>
@@ -74,15 +99,16 @@
<!-- Get plugin verifier --> <!-- Get plugin verifier -->
<delete file="plugin-verifier.jar" failonerror="false"/> <delete file="plugin-verifier.jar" failonerror="false"/>
<get src="http://teamcity.jetbrains.com/guestAuth/repository/download/bt351/.lastPinned/plugin-verifier-1.0-SNAPSHOT.jar" <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 --> <!-- Get kotlin plugin -->
<pathconvert property="kotlin.plugin.path"> <pathconvert property="kotlin.plugin.path">
<fileset dir="${basedir}"> <fileset dir="${kotlin.plugin.dir}">
<include name="kotlin-plugin-*"/> <include name="kotlin-plugin-*"/>
</fileset> </fileset>
</pathconvert> </pathconvert>
<basename property="kotlin.plugin.filename" file="${kotlin.plugin.path}"/> <basename property="kotlin.plugin.filename" file="${kotlin.plugin.path}"/>
<loadresource property="kotlin.plugin.version"> <loadresource property="kotlin.plugin.version">
<string value="${kotlin.plugin.filename}"/> <string value="${kotlin.plugin.filename}"/>
<filterchain> <filterchain>
@@ -93,11 +119,12 @@
</filterchain> </filterchain>
</loadresource> </loadresource>
<!--suppress AntResolveInspection -->
<echo message="Kotlin Plugin version is ${kotlin.plugin.version} located ${kotlin.plugin.path}"/> <echo message="Kotlin Plugin version is ${kotlin.plugin.version} located ${kotlin.plugin.path}"/>
<!-- Get kannotator plugin --> <!-- Get kannotator plugin -->
<pathconvert property="kannotator.plugin.path"> <pathconvert property="kannotator.plugin.path">
<fileset dir="${basedir}"> <fileset dir="${kannotator.plugin.dir}">
<include name="kannotator-plugin-*"/> <include name="kannotator-plugin-*"/>
</fileset> </fileset>
</pathconvert> </pathconvert>
@@ -112,13 +139,15 @@
</filterchain> </filterchain>
</loadresource> </loadresource>
<!--suppress AntResolveInspection -->
<echo message="Kannotator Plugin version is ${kannotator.plugin.version} located ${kannotator.plugin.path}"/> <echo message="Kannotator Plugin version is ${kannotator.plugin.version} located ${kannotator.plugin.path}"/>
<!-- Verify both plugins --> <!-- Verify both plugins -->
<verifyPlugin verifier.jar="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="${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="${kannotator.plugin.path}" />
<!-- Everything is ok, publish plugin and xml descriptor --> <!-- 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[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 '${kotlin.plugin.path}']"/>
<echo message="##teamcity[publishArtifacts '${kannotator.plugin.path}']"/> <echo message="##teamcity[publishArtifacts '${kannotator.plugin.path}']"/>