Creating Directory in gradle script

I have a project,after compilation through gradle build,class files are generated in build folder.i want those files should be copied to classes folder under build folder.

Please provide me the code so that i can create a directory while building through gradle.

Thanks in advance

Regards, Ananta

I don’t understand what you are trying to do, but you can create a directory with ‘mkdir “some/path”’.

I mean to say,i need to create a directory under build folder .suppose my project is under myproject…after compilation i need to move the class files to build/MyFolder folder under project myproject.

So you want to copy class files from ‘build/classes/main’ to ‘build/MyFolder’?

task copyClasses(type: Copy) {
    from compileJava.outputs.files
    from processResources.outputs.files // if you need resources too
    into "build/MyFolder"
}

yes i want to move the code from ‘build/classes/main’ to ‘build/MyFolder’?

task copyClasses(type: Copy) {

from compileJava.outputs.files

from processResources.outputs.files // if you need resources too

into “build/MyFolder”

}

but MyFolder is not there ,1st i need to create one folder named MyFolder than i will copy

It will be created automatically.

So if i write only folder name like from build/RUSSAI then RUSSIA folder will be created under build…

Please correct me if i am wrong

Yes. Why not just give it a try.

Thanks a lot Peter.,thaanks once again…i am ooo office,i will try and definitely responding to your post…

can you please give me your email id…my self is ananta.cet@gmail.com.

I really wants to be your friend…if you dont mind…

regards, Ananta

Hi peter,

Still i am unable to create a new folder in unix machine through gradle . As far as local is concerned yes the directory is created successfully…but it’s failing in unix machine.

mkdir(‘build/MyFolder’) doesn’t work on unix machine