groovy - How to copy files from some source path with gradle script? -


i trying copy images javadocs gradle. currenly images located under

myproject/src/main/resources/doc-files/images/ 

i refer these images this

<img src="{@docroot}/doc-files/images/myimage.jpg"> 

now wish copy content under myproject/src/main/resources/doc-files/ myproject/build/docs/javadoc/doc-files/ , write in build.gradle:

javadoc << {      filetree docfilestree = filetree(dir: 'src/main/resources/doc-files')      copy {         docfilestree         destinationdir     }  } 

this has 2 problems:

1) nothing :)

2) refers resources/doc-files/images/ explicitly, while deduce parameters. failed know how use here: https://docs.gradle.org/current/userguide/java_plugin.html

i'm not sure mean want deduce resources/doc-files/images parameters.

however, if want copy files 1 directory another, can create task such as:

filetree docfilestree = filetree(dir: 'src/main/resources/doc-files')  task copyjavadocsupportfiles(type: copy) {     docfilestree     'build/docs/javadoc/doc-files/' } 

you can add dependency javadoc task such as:

task generatejavadocs(type: javadoc, dependson: ['copyjavadocsupportfiles']) {     source = sourcesets.main.alljava } 

when run generatejavadocs task, copy files src/main/resources/doc-files build/docs/javadoc/doc-files


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -