Git rev-list not working in Android Studio build.gradle

前端 未结 5 518
清歌不尽
清歌不尽 2020-12-20 01:36

I\'ve setup my Android Studio Project to work with Github. Here is my Manifext

apply plugin: \'com.android.application\'


def gitVersion() {
    def counter         


        
5条回答
  •  庸人自扰
    2020-12-20 02:13

    I found the problem. Android studio performs command line operations in the project folder by default. I had made my project such that the git repo lived inside my app directory instead of in my project directory, so any git commands on the project level would error, since it didn't know about the git repo one directory down.

    My solution was to move my git repo out of the app directory and into the project directory. Once I did that, the script worked perfectly.

提交回复
热议问题