Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 96 lines (82 sloc) 4.134 kb
67e57c5 @jonesde Removed ant build files (except wartools.xml is still using ant for n…
jonesde authored
1 /*
2 * This Work is in the public domain and is provided on an "AS IS" BASIS,
3 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
4 * including, without limitation, any warranties or conditions of TITLE,
5 * NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
6 * You are solely responsible for determining the appropriateness of using
7 * this Work and assume any risks associated with your use of this Work.
8 *
9 * This Work includes contributions authored by David E. Jones, not as a
10 * "work for hire", who hereby disclaims any copyright to the same.
11 */
88ed3e0 @jonesde More complete gradle build, still some issues with the war file build
jonesde authored
12
13 dependsOnChildren()
14
d7e239b @jonesde Finished adding wartools to gradle build; leaving wartools ant file f…
jonesde authored
15 allprojects { version = '1.0-beta3' }
88ed3e0 @jonesde More complete gradle build, still some issues with the war file build
jonesde authored
16
636075a @jonesde Removed some unneeded libraries, some build improvements (added addRu…
jonesde authored
17 tomcatHome = '../apache-tomcat-7.0.6'
928ca39 @jonesde Resolved last couple of issues with gradle build, now working like an…
jonesde authored
18 warName = 'moqui-' + version + '.war'
19
88ed3e0 @jonesde More complete gradle build, still some issues with the war file build
jonesde authored
20 // ========== clean tasks ==========
21
928ca39 @jonesde Resolved last couple of issues with gradle build, now working like an…
jonesde authored
22 task clean(type: Delete) { delete file(warName) }
88ed3e0 @jonesde More complete gradle build, still some issues with the war file build
jonesde authored
23 task cleanDb(type: Delete) { delete fileTree(dir: 'runtime/db/derby', include: '**/*', exclude: 'derby.properties') }
24 task cleanLog(type: Delete) { delete fileTree(dir: 'runtime/log', include: '*') }
25 task cleanOther(type: Delete) { delete fileTree(dir: '.', includes: ['**/.nbattrs', '**/*~', '**/.#*', '**/.DS_Store', '**/*.rej', '**/*.orig']) }
26
27 task cleanAll {
928ca39 @jonesde Resolved last couple of issues with gradle build, now working like an…
jonesde authored
28 dependsOn clean
88ed3e0 @jonesde More complete gradle build, still some issues with the war file build
jonesde authored
29 dependsOn cleanDb
30 dependsOn cleanLog
31 dependsOn cleanOther
32 }
33
34 // ========== run tasks ==========
d7e239b @jonesde Finished adding wartools to gradle build; leaving wartools ant file f…
jonesde authored
35
88ed3e0 @jonesde More complete gradle build, still some issues with the war file build
jonesde authored
36 task run(type: JavaExec) {
928ca39 @jonesde Resolved last couple of issues with gradle build, now working like an…
jonesde authored
37 dependsOn ':framework:build'
88ed3e0 @jonesde More complete gradle build, still some issues with the war file build
jonesde authored
38 workingDir = '.'; jvmArgs = ['-server', '-XX:MaxPermSize=64m']; maxHeapSize = '256M'
3dee34e @jonesde Moved conf files up a directory, got rid of the idea that was never i…
jonesde authored
39 systemProperties = ['moqui.conf':'conf/MoquiDevConf.xml']
928ca39 @jonesde Resolved last couple of issues with gradle build, now working like an…
jonesde authored
40 // NOTE: this is a hack, using -jar instead of a class name, and then the first argument is the name of the jar file
41 main = '-jar'; args = [warName]
88ed3e0 @jonesde More complete gradle build, still some issues with the war file build
jonesde authored
42 }
43 task runStaging(type: JavaExec) {
928ca39 @jonesde Resolved last couple of issues with gradle build, now working like an…
jonesde authored
44 dependsOn ':framework:build'
88ed3e0 @jonesde More complete gradle build, still some issues with the war file build
jonesde authored
45 workingDir = '.'; jvmArgs = ['-server', '-XX:MaxPermSize=64m']; maxHeapSize = '1024M'
3dee34e @jonesde Moved conf files up a directory, got rid of the idea that was never i…
jonesde authored
46 systemProperties = ['moqui.conf':'conf/MoquiStagingConf.xml']
928ca39 @jonesde Resolved last couple of issues with gradle build, now working like an…
jonesde authored
47 main = '-jar'; args = [warName]
88ed3e0 @jonesde More complete gradle build, still some issues with the war file build
jonesde authored
48 }
49 task runProduction(type: JavaExec) {
928ca39 @jonesde Resolved last couple of issues with gradle build, now working like an…
jonesde authored
50 dependsOn ':framework:build'
88ed3e0 @jonesde More complete gradle build, still some issues with the war file build
jonesde authored
51 workingDir = '.'; jvmArgs = ['-server', '-XX:MaxPermSize=64m']; maxHeapSize = '1024M'
3dee34e @jonesde Moved conf files up a directory, got rid of the idea that was never i…
jonesde authored
52 systemProperties = ['moqui.conf':'conf/MoquiProductionConf.xml']
928ca39 @jonesde Resolved last couple of issues with gradle build, now working like an…
jonesde authored
53 main = '-jar'; args = [warName]
88ed3e0 @jonesde More complete gradle build, still some issues with the war file build
jonesde authored
54 }
55
56 task load(type: JavaExec) {
928ca39 @jonesde Resolved last couple of issues with gradle build, now working like an…
jonesde authored
57 dependsOn ':framework:build'
88ed3e0 @jonesde More complete gradle build, still some issues with the war file build
jonesde authored
58 workingDir = '.'; jvmArgs = ['-server', '-XX:MaxPermSize=64m']; maxHeapSize = '256M'
928ca39 @jonesde Resolved last couple of issues with gradle build, now working like an…
jonesde authored
59 main = '-jar'; args = [warName]
88ed3e0 @jonesde More complete gradle build, still some issues with the war file build
jonesde authored
60 }
636075a @jonesde Removed some unneeded libraries, some build improvements (added addRu…
jonesde authored
61
d7e239b @jonesde Finished adding wartools to gradle build; leaving wartools ant file f…
jonesde authored
62 // ========== deploy tasks ==========
636075a @jonesde Removed some unneeded libraries, some build improvements (added addRu…
jonesde authored
63
d7e239b @jonesde Finished adding wartools to gradle build; leaving wartools ant file f…
jonesde authored
64 task deployTomcat << {
65 // remove runtime directory, may have been added for logs/etc
66 delete file(tomcatHome + '/runtime')
67 // remove ROOT directory and war to avoid conflicts
68 delete file(tomcatHome + '/webapps/ROOT')
69 delete file(tomcatHome + '/webapps/ROOT.war')
70 // copy the war file to ROOT.war
71 copy { from file(warName); into file(tomcatHome + '/webapps'); rename(warName, 'ROOT.war') }
636075a @jonesde Removed some unneeded libraries, some build improvements (added addRu…
jonesde authored
72 }
73
74 task addRuntime << {
75 // unzip the "moqui-${version}.war" file to the wartemp directory
76 //directory { dir = file('wartemp') }
77 copy { from zipTree(warName); into file('wartemp') }
78 // copy runtime directory (with a few exceptions) into a runtime directory in the war
79 copy {
80 from fileTree(dir: '.', include: 'runtime/**', excludes: ['**/*.jar', 'runtime/lib/**', 'runtime/db/**', 'runtime/log/**'])
81 into file('wartemp')
82 }
83 // copy the jar files from runtime/lib
84 copy { from fileTree(dir: 'runtime/lib', include: '*.jar'); into 'wartemp/WEB-INF/lib' }
85 // copy the jar files from components
86 // this copies whole directory tree, how to just get files? copy { from fileTree(dir: 'runtime/component', include: '**/*.jar'); into 'wartemp/WEB-INF/lib' }
87 // add MoquiInit.properties fresh copy, just in case it was changed
88 copy { from file('MoquiInit.properties'); into 'wartemp/WEB-INF/classes' }
89
90 // zip it up again
91 ant.zip(destfile: 'moqui-plus-runtime.war') { fileset(dir: 'wartemp') { include(name: '**/*') } }
92 // alternative once supported: zip { archiveName 'moqui-plus-runtime.war'; from fileTree(dir: 'wartemp', include: '**/*') }
93 // clean up the temporary directory
94 delete file('wartemp')
95 }
Something went wrong with that request. Please try again.