Guest User

Untitled

a guest
Jun 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. // classpath retriever for all jars in project "lib" folder and compiled classes in project
  2.  
  3. def GRAILS_VERSION = '1.3.7'
  4.  
  5. def redcar_config = new File(getClass().protectionDomain.codeSource.location.path).parentFile
  6. def project = redcar_config.parentFile
  7. def classpath = []
  8. def home = System.getProperty("user.home")
  9. def cache = new File(home+File.separator+".ivy2"+File.separator+"cache")
  10.  
  11. // grails plugin classes
  12. def plugin_classes = new File(
  13. home + File.separator +
  14. ".grails" + File.separator +
  15. GRAILS_VERSION + File.separator + // NOTE: update on grails upgrade
  16. "projects" + File.separator +
  17. project.name + File.separator +
  18. "plugin-classes")
  19.  
  20. classpath << plugin_classes.path
  21.  
  22. //installed libraries
  23. def lib = new File(project.path + File.separator + "lib")
  24. lib.list().each {name -> classpath << lib.path+File.separator+name}
  25.  
  26. //compiled classes
  27. def target_classes = new File(
  28. project.path + File.separator +
  29. "target" + File.separator +
  30. "classes"
  31. )
  32. classpath << target_classes.path
  33.  
  34. /* manual ivy resolution */
  35. //fake ivy dependency loader
  36. def ivy = { map ->
  37. cache.path + File.separator +
  38. map.group + File.separator +
  39. map.module + File.separator +
  40. "jars" + File.separator +
  41. "${map.module}-${map.version}.jar"
  42. }
  43.  
  44. //grails version dependencies
  45. [
  46. 'grails-bootstrap','grails-core','grails-crud','grails-gorm','grails-spring',
  47. 'grails-test','grails-web'
  48. ].each { module ->
  49. classpath << ivy(group:'org.grails',module:module,version: GRAILS_VERSION)
  50. }
  51.  
  52. //spring framework dependencies
  53. [
  54. 'org.springframework.beans','org.springframework.context','org.springframework.core',
  55. 'org.springframework.jms', 'org.springframework.test','org.springframework.web',
  56. 'org.springframework.web.servlet','spring-tx'
  57. ].each { module ->
  58. classpath << ivy(group:'org.springframework',module: module,version:'3.0.3.RELEASE')
  59. }
  60.  
  61. classpath << ivy(group:'commons-lang' ,module: 'commons-lang' ,version: '2.4' )
  62. classpath << ivy(group:'commons-logging' ,module: 'commons-logging',version: '1.1.1' )
  63. classpath << ivy(group:'javax.servlet' ,module: 'jsp-api' ,version: '1.2' )
  64. classpath << ivy(group:'org.apache.ant' ,module: 'ant-junit' ,version: '1.7.1' )
  65. classpath << ivy(group:'org.hibernate' ,module: 'hibernate-core' ,version: '3.3.1.GA' )
  66. classpath << ivy(group:'org.jscience' ,module: 'jscience' ,version: '4.3' )
  67. classpath << ivy(group:'junit' ,module: 'junit' ,version: '4.8.1' )
  68.  
  69. return classpath.toArray()
Add Comment
Please, Sign In to add comment