RM: Build script updates

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@34686 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2012-03-22 10:29:57 +00:00
parent be5b7a8d5a
commit 0edede13d1
3 changed files with 68 additions and 24 deletions

View File

@@ -14,33 +14,66 @@ subprojects {
flatDir {
dirs libsDir
}
mavenCentral()
}
dependencies {
compile fileTree(dir: libsDir, include: '*.jar')
compile fileTree(dir: 'libs/test', include: '*.jar')
compile group: 'javax.servlet', name: 'servlet-api', version: '2.5'
compile 'org.springframework:spring-test:2.5'
dependencies {
compile fileTree(dir: libsDir, include: '*.jar')
}
task unpackWar << {
println 'Unpacking ' + warFileName + ' WAR ...'
// Clean out any existing jars
ant.delete {
ant.fileset(dir: libsDir, includes: '*.jar')
}
// Unpack WAR
ant.unzip(src: warFile, dest: libsDir) {
ant.patternset {
ant.include(name: '**/*.jar')
}
ant.mapper(type: 'flatten')
compileJava.doFirst {
if (areLibsUnpacked(file(libsDir)) == false) {
tasks.unpackLibs.execute()
}
}
task cleanLibs << {
ant.delete {
ant.fileset(dir: libsDir, includes: '*.jar')
}
}
task refreshLibs (dependsOn: ['cleanLibs', 'unpackLibs'])
task unpackLibs << {
if (file(warFile).exists()) {
println 'Unpacking libs from ' + warFileName + ' WAR'
// unpack the jars from the war file
ant.unzip(src: warFile, dest: libsDir) {
ant.patternset {
ant.include(name: '**/*.jar')
}
ant.mapper(type: 'flatten')
}
}
else {
// TODO eventually we will be able to retrieve the war file if we don't have it
println 'The ' + warFile + ' was not found.'
}
}
// task amp << {
//
// ant.zip(destfile: 'build/dist/blar.amp', update: 'true') {
//
// ant.zipfileset(file: '../module.properties')
// ant.zipfileset(file: 'build/libs/rm.jar', prefix: 'lib')
// ant.zipfileset(dir: '/config', prefix: 'config') {
// ant.exclude(name: '**/module.properties')
// }
// }
// }
}
Boolean areLibsUnpacked(dir){
result = false;
dir.eachFileMatch(~/.*\.jar/) {
result = true;
}
return result;
}

11
rm-server/build.gradle Normal file
View File

@@ -0,0 +1,11 @@
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs/test', include: '*.jar')
compile group: 'javax.servlet', name: 'servlet-api', version: '2.5'
compile 'org.springframework:spring-test:2.5'
}

View File

@@ -1,2 +1,2 @@
warFile=build/war/alfresco.war
warFile=war/alfresco.war
warFileName=Alfresco