android: gradle: how to copy a file? Issue to set a file readable, or to read it -
i blocked file reading in gradle.
i try set files readable way in gradle:
task readaccess(type: exec, description: 'set google-services.json readable.') { //--> check can read? --> can't read if (new file('src/google-services.json').canread()){ println 'readaccess > can read' } else { println 'readaccess > cant read' } //--> set readable. --> can't set readable if (new file('src/google-services.json').setreadable(true,false)) { println 'readaccess > access read modified' } else { println 'readaccess > access read not modified' } //--> check can read? --> can't read if (new file('src/google-services.json').canread()){ println 'readaccess > can read' } else { println 'readaccess > cant read' } } tasks.withtype(javacompile) { compiletask -> compiletask.dependson gcmreadaccess }
ps: file access set read & write everyone, in file system.
find solution real problem: how copy file gradle? . going in wrong way.
copy { 'src/' include '*.json' '..' }
you can find more details in enter link description here
this answer , if it's not related question, helped me.
Comments
Post a Comment