yerzhik

Untitled

Apr 19th, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.62 KB | None | 0 0
  1. allprojects {
  2. ext.artifactGroup = 'com.integer.oncomed'
  3. ext.artifactVersion = '0.2'
  4. ext.isSnapshot = true
  5. ext.copyright = 'Copyright (c) $today.year Integer Ltd. All Rights Reserved.'
  6. //tomcatDir = rootDir.absolutePath + '/../tomcat'
  7.  
  8. ext.repositoryUrl = "http://localhost:8081/nexus/content/"
  9. ext.repositoryUser = 'admin'
  10. ext.repositoryPassword ='admin123'
  11. }
  12.  
  13. buildscript {
  14. ext.cubaPlugin = [group: 'com.haulmont.gradle', name: 'cuba-plugin', version: '1.4.12']
  15.  
  16. repositories {
  17. mavenLocal()
  18. mavenCentral()
  19. maven {
  20. credentials {
  21. username 'admin'
  22. password 'admin123'
  23. }
  24. url "http://localhost:8081/nexus/content/groups/work/"
  25. }
  26. }
  27. dependencies {
  28. classpath cubaPlugin
  29. }
  30. }
  31.  
  32. def cubaVersion = '3.5.4'
  33.  
  34. def globalModule = project(':oncomed-global')
  35. def coreModule = project(':oncomed-core')
  36. def guiModule = project(':oncomed-gui')
  37. def webModule = project(':oncomed-web')
  38.  
  39. def postgres = 'postgresql:postgresql:9.1-901.jdbc4'
  40. def servletApi = 'org.apache.tomcat:servlet-api:6.0.20'
  41.  
  42. def cubaWeb = "com.haulmont.cuba:cuba-web:$cubaVersion"
  43.  
  44. def coreJarNames = ['bali', 'chile-core', 'chile-jpa', 'cuba-global', 'cuba-core',
  45. 'oncomed-global', 'oncomed-core']
  46.  
  47. apply(plugin: 'idea')
  48. apply(plugin: 'cuba')
  49.  
  50. configure([globalModule, coreModule, guiModule, webModule]) {
  51. apply(plugin: 'java')
  52. apply(plugin: 'idea')
  53. apply(plugin: 'maven')
  54. apply(plugin: 'cuba')
  55.  
  56. configurations.each {
  57. it.resolutionStrategy.cacheChangingModulesFor 2, "minutes"
  58. }
  59.  
  60. dependencies {
  61. compile("com.haulmont.cuba:cuba-global:$cubaVersion")
  62. compile('axis:axis:1.4')
  63. compile group: 'javax.mail', name: 'mail', version: '1.4'
  64. compile group: 'javax.xml.rpc', name: 'javax.xml.rpc-api', version: '1.1.1'
  65. compile group: 'org.apache.directory.studio', name: 'org.apache.commons.logging', version: '1.1.3'
  66. compile group: 'commons-discovery', name: 'commons-discovery', version: '0.4'
  67. compile group: 'wsdl4j', name: 'wsdl4j', version: '1.6.2'
  68.  
  69. testCompile('junit:junit:4.5')
  70. }
  71.  
  72. task sourceJar(type: Jar) {
  73. from file('src')
  74. classifier = 'sources'
  75. }
  76.  
  77. artifacts {
  78. archives sourceJar
  79. }
  80. }
  81.  
  82. configure(globalModule) {
  83. dependencies {
  84. provided(cubaPlugin)
  85. }
  86. task enhance(type: CubaEnhancing) {
  87. persistenceXml = "$globalModule.projectDir/src/oncomed-persistence.xml"
  88. metadataXml = "$globalModule.projectDir/src/oncomed-metadata.xml"
  89. }
  90. compileJava << {
  91. enhance.execute()
  92. }
  93. }
  94.  
  95. configure(coreModule) {
  96.  
  97. configurations {
  98. jdbc
  99. dbscripts
  100. }
  101.  
  102. dependencies {
  103. compile(globalModule)
  104. compile("com.haulmont.cuba:cuba-core:$cubaVersion")
  105. compile('axis:axis:1.4')
  106. compile group: 'javax.mail', name: 'mail', version: '1.4'
  107. compile group: 'javax.xml.rpc', name: 'javax.xml.rpc-api', version: '1.1.1'
  108. compile group: 'org.apache.directory.studio', name: 'org.apache.commons.logging', version: '1.1.3'
  109. compile group: 'commons-discovery', name: 'commons-discovery', version: '0.4'
  110. compile group: 'wsdl4j', name: 'wsdl4j', version: '1.6.2'
  111.  
  112. testCompile("com.haulmont.cuba:cuba-core:$cubaVersion:tests")
  113. testCompile('junit:junit:4.5')
  114. testCompile("com.haulmont.cuba:cuba-shared-lib:$cubaVersion")
  115.  
  116. provided(servletApi)
  117. jdbc(postgres)
  118. testRuntime(postgres)
  119.  
  120. dbscripts("com.haulmont.cuba:cuba-core:$cubaVersion:db@zip")
  121. }
  122.  
  123. test {
  124. scanForTestClasses = false
  125. includes = ['**/*Test.class']
  126. }
  127.  
  128. task deploy(dependsOn: assemble, type: CubaDeployment) {
  129. appName = 'app-core'
  130. jarNames = coreJarNames
  131. }
  132.  
  133. task createDb(dependsOn: assemble, description: 'Creates local Postgres database', type: CubaDbCreation) {
  134. dbms = 'postgres'
  135. dbName = 'oncomed'
  136. dbUser = 'root'
  137. dbPassword = 'root'
  138. }
  139.  
  140. task createTestDb(dependsOn: assemble, description: 'Creates local Postgres database for tests', type: CubaDbCreation) {
  141. dbms = 'postgres'
  142. dbName = 'oncomed_test'
  143. dbUser = 'root'
  144. dbPassword = 'root'
  145. }
  146. }
  147.  
  148. configure(guiModule) {
  149. dependencies {
  150. compile(globalModule)
  151. compile(group: 'com.haulmont.cuba', name: 'cuba-gui', version: cubaVersion)
  152. }
  153. }
  154.  
  155. configure(webModule) {
  156. configurations {
  157. webcontent
  158. }
  159.  
  160. dependencies {
  161. compile(globalModule)
  162. compile(guiModule)
  163. compile(cubaWeb)
  164.  
  165. webcontent(group: 'com.haulmont.cuba', name: 'cuba-web', version: cubaVersion, classifier: 'web', ext: 'zip')
  166. }
  167.  
  168. task webArchive(type: Zip) {
  169. from file('web')
  170. classifier = 'web'
  171. }
  172.  
  173. artifacts {
  174. archives webArchive
  175. }
  176.  
  177. task deploy(dependsOn: assemble, type: CubaDeployment) {
  178. appName = 'app'
  179. appJars('bali', 'chile-core', 'chile-jpa', 'cuba-global', 'cuba-client', 'cuba-gui', 'cuba-web',
  180. 'oncomed-global', 'oncomed-gui', 'oncomed-web')
  181. }
  182. }
  183.  
  184. task restart(dependsOn: ['stop', ':oncomed-core:deploy', ':oncomed-web:deploy'], description: 'Redeploys applications and restarts local Tomcat') << {
  185. ant.waitfor(maxwait: 6, maxwaitunit: 'second', checkevery: 2, checkeveryunit: 'second') {
  186. not {
  187. socket(server: 'localhost', port: '8787')
  188. }
  189. }
  190. start.execute()
  191. }
Advertisement
Add Comment
Please, Sign In to add comment