Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. task exportCompileLibs << {
  2. subprojects.each { iSubProject ->
  3. iSubProject.configurations.findAll{it.name == "compile"}.each{ jConfig ->
  4. println "copying compile libs for ${iSubProject.name}..."
  5. copy {
  6. into "${iSubProject.buildDir}/gradle-lib-export"
  7. from jConfig
  8. eachFile {println it.name}
  9. }
  10. }
  11. }
  12. }
  13.  
  14. task exportDependencies << {
  15. def deps = project.extensions.getByType(IdeaModel).module.resolveDependencies()
  16. copy {
  17. from deps*.classes.file
  18. into "${buildDir}/gradle-lib-export/libs"
  19. }
  20.  
  21. copy {
  22. from deps*.sources.file
  23. into "${buildDir}/gradle-lib-export/sources"
  24. }
  25. }
  26.  
  27. task exportDependencies(description: "export project dependency jars") << {
  28. subprojects.each { Project iSubProject ->
  29. String target = "${iSubProject.buildDir}/gradle-lib-export"
  30.  
  31. IdeaPlugin ideaPlugin = new IdeaPlugin()
  32. ideaPlugin.apply(iSubProject)
  33. Set<Dependency> deps = ideaPlugin.model.module.resolveDependencies()
  34.  
  35. println "exporting dependencies for $iSubProject.name into $target"
  36. copy {
  37. from deps*.classes.file
  38. into "${target}/libs"
  39. eachFile { println "lib -> $it.name" }
  40. }
  41. copy {
  42. from deps*.sources.file
  43. into "${target}/sources"
  44. eachFile{ println "source -> $it.name" }
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement