ccomeaux / boardgamegeek4android

BoardGameGeek application for Android (unofficial)
GNU General Public License v3.0
228 stars 47 forks source link

Building Boardgamegeek4Android git command fails in Android Studio on windows #53

Closed nibuen closed 9 years ago

nibuen commented 9 years ago

When attempting to build from scratch in android studio 1.2.1 I had issue with this task in app build.gradle:

def getBranchName = { ->
    def stdout = new ByteArrayOutputStream()
    exec {
        commandLine 'git', 'rev-parse', '--abbrev-ref', 'HEAD'
        standardOutput = stdout
    }
    return stdout.toString().trim()
}

I was able to get working by doing this:

def getBranchName = { ->
    def stdout = new ByteArrayOutputStream()
    exec {
        commandLine 'git.cmd', 'rev-parse', '--abbrev-ref', 'HEAD'
        standardOutput = stdout
    }
    return stdout.toString().trim()
}

Seems to be issue with gradle not using path and instead just directly running executable. Which doesn't have git command in windows.

nibuen commented 9 years ago

I have seen platform specific command calls. Infact the commandline documentation page provides examples of different commands, but wanted to see what you think @ccomeaux

ccomeaux commented 9 years ago

@nibuen, this works both on my Windows machine and Macbook. I just tried your proposed change on my Mac and it doesn't work. I'm not sure if I did anything special on my Windows machine or not.

nibuen commented 9 years ago

looks like issue with my git install from an early version of git for windows. I think just close this.