Creating zip of android project along with its dependencies through gradle

谁说胖子不能爱 提交于 2019-12-11 10:49:47

问题


I have an android project which have three different dependencies (library projects) and I want to create a zip of each project src folder after we are finished with the builds. I did the following,

task srcZip(type: Zip) {
    from projectDir
    println "SOURCE THE ZIP"
    exclude 'build'
    exclude 'gen'
    exclude 'bin'
}

In order to make a zip however I have to call this task manually. This works only if I have to create a zip file of one project which does not include the sources of other dependencies (library projects). How can I create a zip of all the sources at once?

Thanks in advance.


回答1:


So I was able to fix the problem on my own,

Copying the following to all the dependent projects,

task srcZip(type: Zip) {
    from projectDir
    println "SOURCE THE ZIP"
    exclude 'build'
    exclude 'gen'
    exclude 'bin'
}


来源:https://stackoverflow.com/questions/26303863/creating-zip-of-android-project-along-with-its-dependencies-through-gradle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!