Gradle 2.13 Revision: 3b427b1481e46232107303c90be7b05079b05b1c OS: Linux 3.10.0-327.36.3.el7.x86_64 amd64
In linux on calling the clean task the contents of buildDir path are not deleted whereas the same in windows deletes the contents of buildDir(expected behaviour). Whats the reason ?
Code sample
apply plugin : 'java'
ant.importBuild 'build.xml'
sourceCompatibility = 1.8
def projVersion = ant.properties['version']
def projName = "xyz"
def buildPath = "/home/test/build"
def dependencyPath = "/home/test/dependency"
buildDir = new File("$buildPath","$projName")
def serviceDirBin = new File(buildDir , 'bin')
def serviceDirConf = new File(buildDir , 'conf')
def serviceDirThirdparty = new File(buildDir , 'thirdparty')
repositories {
flatDir {
dirs file("$dependencyPath"),
}
}
sourceSets{
main{
java{
srcDir 'src'
}
output.classesDir 'classes'
}
test{
java {
srcDir 'src/test'
}
}
}
dependencies {
/*Some compile dependencies*/
}
jar{
destinationDir = new File(serviceDirThirdparty, 'lib')
baseName='xyz'
manifest {
'Build-Timestamp': new Date().format('yyyy-dd-MM HH:mm:ss'),
'Specification-Version': '1.0',
'Implementation-Version': "$projVersion"
}
}
task xyzpackager << {
copy{
from ("$buildPath/sf/distribution/bin")
into file(serviceDirBin)
}
copy{
from ('conf')
into file(serviceDirConf)
}
copy{
from configurations.compile
from configurations.runtime
into new File(serviceDirThirdparty,'lib')
}
}
test {
reports {
html.enabled = false
junitXml.enabled = true
junitXml.destination = file("TestReport/xml")
}
}
jar.doLast {
delete "$buildDir/tmp","$buildDir/dependency-cache","$buildDir/classes","$buildDir/libs"
}
compileTestJava.doLast{
delete "TestReport"
}
the jar is copied to thirdparty folder and the bin/conf folders have some other files. SO basically i want to delete the buildDir before every new build