view build.xml @ 379:55c2c88a2d82 Eluru-6.5.x

TW-17630, TW-18815 fix encoding for hg log command Mercurial stores commit messages in UTF-8. During commit it tries to guess a system encoding and transcode message from system encoding to UTF-8. When it prints to output it transcodes from UTF-8 to the system encoding and replace characters which cannot be represented in the system encoding with the symbol of '?'. Default console encoding on windows is cp437, and it cannot represent non-latin symbols, see http://mercurial.selenic.com/wiki/CharacterEncodingOnWindows for details. The fix is to not use a console to run hg, and tell mercurial to do the output in UTF-8.
author Dmitry Neverov <dmitry.neverov@jetbrains.com>
date Wed, 15 Feb 2012 12:07:12 +0400
parents dbb5b9f3069b
children 643fa1236f4e
line wrap: on
line source
<project name="Mercurial VCS Support" default="dist" basedir=".">
  <property file="mercurial.properties"/>
  <import file="mercurial.xml"/>

  <property name="distPath" value="${basedir}/dist"/>

  <property name="plugin.name" value="mercurial"/>

  <property name="build.number" value=""/>
  <tstamp>
    <format property="timestamp" pattern="yyyyMMddhhmmss"/>
  </tstamp>
  <property name="snapshot.build.number" value="SNAPSHOT-${timestamp}"/>
  <property name="build.vcs.number" value=""/>

  <condition property="plugin.version" value="${snapshot.build.number}" else="${build.number}">
    <matches pattern="snapshot-.*" string="${build.number}" casesensitive="false"/>
  </condition>

  <import file="teamcity-common.xml"/>

  <target name="package" depends="define.version">
    <package.teamcity.plugin name="${plugin.name}"
                             server.output="${mercurial-server.output.dir}"
                             agent.output="${mercurial-agent.output.dir}"
                             common.output="${mercurial-common.output.dir}"
                             plugin.descriptor.file="${basedir}/teamcity-plugin.xml"
                             plugin.version="${plugin.version}"/>
  </target>

  <target name="define.version" depends="define.version.if.under.teamcity">
    <tstamp>
      <format property="current.time" pattern="yyyyMMddHHmm"/>
    </tstamp>
    <property name="plugin.version" value="SNAPSHOT-${current.time}"/>
  </target>

  <target name="define.version.if.under.teamcity" if="build.number">
    <property name="plugin.version" value="${build.number}"/>
  </target>

  <target name="dist" depends="check.teamcitydistribution,all,package"/>

  <target name="deploy" depends="dist">
    <deploy.teamcity.plugin name="${plugin.name}"/>
  </target>

  <taskdef name="testng" classname="org.testng.TestNGAntTask" classpath="${basedir}/mercurial-tests/lib/testng-5.7-jdk15.jar"/>

  <path id="tests_classpath">
    <pathelement location="${agent.home.dir}/lib/runtime-util.jar"/>
    <pathelement location="${agent.home.dir}/lib/buildServerRuntimeUtil.jar"/>
    <path refid="mercurial-tests.runtime.module.classpath"/>
  </path>

  <target name="run-tests" depends="clean, init, compile.module.mercurial-tests">
    <property name="suspend" value="n"/>

    <testng haltonfailure="no" failureProperty="failure_found" listener="org.testng.reporters.TestHTMLReporter"
            outputdir="${basedir}/test-output" classpathref="tests_classpath" dumpcommand="true" workingDir="${basedir}">

      <jvmarg value="-ea"/>
      <!--<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=${suspend},address=5555"/>-->

      <sysproperty key="java.awt.headless" value="true"/>

      <xmlfileset dir="${basedir}/mercurial-tests/src">
        <include name="testng.xml"/>
      </xmlfileset>
    </testng>
  </target>
</project>