DISQUS

tlrobinson.net / blog: Ant Tasks for Git

  • Markus · 10 months ago
    is there going to be an appstore / cydia / installer app with your wifi-acelerometer transmittance thing? That looks really cool, and I am sure people would appreciate it. I certainly would, there's nothing like this around yet!! Been looking a while, though.

    Thanks,

    Markus
  • Laurent Pireyn · 6 months ago
    Nice post!

    My two cents:
    - What if you need to authenticate with the remote repository? There is no parameter to do that - and that would not be secure anyway. A SSH agent would work but only if the server authorizes your public key. At the very least, you could have Ant ask input from the user, but that prevents unattended runs.
    - An Ant task would either call the git executable, with all the issues that it implies (differences between platforms, availability of the executable, etc.), or it could use the only Java (partial) implementation of git I'm aware of at this time: egit.
    - Some CI programs (Hudson, Cruise Control) have a git plugin. Since they're open source, it might be worth a look... My guess is that they simply call the executable.
  • Tech Support · 5 months ago
    I am able to use svn checkout from commandline from a url. But the same task when i add in my ant build file, the build file fails telling me that the url@HEAD does not exist.
  • Timo · 1 day ago
    I have thrown together something similar, a macro for figuring out the revision and whether the working copy is clean:

    <macrodef name="git-revision">
    <attribute name="output" />
    <sequential>
    <exec executable="git" outputproperty="head">
    <arg value="rev-parse" />
    <arg value="HEAD" />
    </exec>
    <echo message="Found revision: ${head}"/>
    <exec executable="git" outputproperty="dirty">
    <arg value="diff" />
    <arg value="--shortstatt" />
    </exec>
    <condition property="@{output}" value="${head}" else="${head} (dirty)">
    <equals arg1="${dirty}" arg2="" />
    </condition>
    </sequential>
    </macrodef>