I am writing the below code to get the zip of my android project source code.
project.task("myTask", type:Zip){
baseName = "outputs"
from (project.rootDir){
include ('*')
from ('gradle/wrapper/'){ include ('*') }
exclude 'build/','.gradle/','.idea/','*.iml'
from (project.projectDir)
{
include ('libs/')
include ('*')
exclude ('build/','*.iml')
include ('src/**/*')
}
from ('gradle/')
{ include('*') }
}
destinationDir project.rootProject.buildDir
}
This produces a source zip containing all the files. However, there is one correction that is required here. I want the subproject to include all the files in it inside my zip as in the directory structure should remain intact. But right now I get the empty project folder and its content outside that folder which changes its directory structure. Can anyone tel how to get that. Thanks in advace!!