Newer
Older
evaluationDependsOn(':common')
evaluationDependsOn(':openbis_api')
evaluationDependsOn(':openbis-common')
evaluationDependsOn(':authentication')
evaluationDependsOn(':dbmigration')
evaluationDependsOn(':openbis')
evaluationDependsOn(':datastore_server')
evaluationDependsOn(':rtd_phosphonetx')
evaluationDependsOn(':screening')
evaluationDependsOn(':rtd_yeastx')
evaluationDependsOn(':deep_sequencing_unit')
apply from: 'http://svncisd.ethz.ch/repos/cisd/gradle/trunk/javaproject.gradle'
apply from: 'query-api.gradle'
apply from: 'screening-api.gradle'
apply from: 'proteomics-api.gradle'
anttil
committed
apply from: 'dss-client.gradle'
apply from: 'dss-upload-gui.gradle'
apply plugin: 'war'
anttil
committed
archivesBaseName = 'openBIS-server-standard-technologies'
configurations.create('gwt')
configurations.create('zipping')
configurations.create('admin_partial')
configurations.create('admin_full')
configurations.create('datastore_server')
configurations.create('webStartJars')
anttil
committed
def jettyVersion = '8.1.8'
dependencies {
compile project(':screening'),
project(':rtd_phosphonetx')
providedCompile 'google:gwt-user:2.4'
providedRuntime "eclipse:jetty-util:${jettyVersion}.v20121106",
"eclipse:jetty-deploy:${jettyVersion}.v20121106"
gwt 'reveregroup:gwt-image-loader:1.1.4',
'google:gwt-dev:+'
zipping "eclipse:jetty-distribution:${jettyVersion}@zip"
anttil
committed
admin_partial 'google:gwt-user:2.4'
admin_full 'cisd:cisd-base:+',
'apache:commons-httpclient:+',
'apache:commons-logging:+',
'apache:commons-io:+',
'apache:log4j:+',
'springframework:spring-core:+',
'springframework:spring-context:+',
'springframework:spring-jdbc:+',
'springframework:spring-orm:+',
'springframework:spring-aop:+',
anttil
committed
'marathon:marathon-spring-util:+',
'springframework:spring-beans:+',
'jline:jline:0.9.94'
datastore_server project(':deep_sequencing_unit'),
project(':rtd_yeastx'),
project(':screening'),
project(':rtd_phosphonetx'),
'bioformats:bioformats:+',
'imagej:ij:+',
'cisd:cisd-openbis-knime-server:+',
'apache:xml-apis:+',
'javax:jaxb:+',
'slf4j:slf4j:+',
'slf4j:slf4j-log4j12:+',
'sybit:image-viewer:+'
webStartJars 'cisd:cisd-base:+',
'apache:commons-codec:+',
'apache:commons-io:+',
'apache:commons-httpclient:+',
'apache:commons-lang:+',
'apache:commons-logging:+',
'apache:log4j:+',
'apache:geronimo-stax:+',
'apache:poi:+',
'apache:poi-ooxml:+',
'apache:poi-ooxml-schemas:+',
'apache:xmlbeans:+',
'dom4j:dom4j:+',
'imagej:ij:+',
'python:jython:+',
'sybit:image-viewer:+',
'springframework:spring:+',
'springframework:spring-aop:+',
'springframework:spring-beans:+',
'springframework:spring-context:+',
'springframework:spring-core:+',
'springframework:spring-web:+',
'marathon:marathon-spring-util:+',
'aopalliance:aopalliance:+'
}
buildscript {
apply from: '../gradle/repository.gradle'
repositories repositoryConfig
dependencies {
classpath 'apache:commons-codec:+'
}
task compileGwt (dependsOn: classes, type: JavaExec) {
buildDir = "${project.buildDir}/gwt"
extraDir = "${project.buildDir}/extra"
inputs.source sourceSets.main.java.srcDirs
inputs.dir sourceSets.main.output.resourcesDir
outputs.dir buildDir
doFirst {
file(buildDir).mkdirs()
}
main = 'com.google.gwt.dev.Compiler'
classpath {
[
anttil
committed
sourceSets.main.java.srcDirs,
anttil
committed
project(":openbis").sourceSets.main.java.srcDirs,
project(":openbis").sourceSets.main.output.resourcesDir,
project(":openbis").sourceSets.main.output.classesDir,
project(":openbis").sourceSets.main.compileClasspath,
project(":common").sourceSets.main.java.srcDirs,
project(":openbis_api").sourceSets.main.java.srcDirs,
anttil
committed
project(":screening").sourceSets.main.java.srcDirs,
project(":screening").sourceSets.main.output.resourcesDir,
project(":rtd_phosphonetx").sourceSets.main.java.srcDirs,
project(":rtd_phosphonetx").sourceSets.main.output.resourcesDir,
configurations.gwt
]
}
args =
[
'ch.systemsx.cisd.openbis.OpenBIS',
'-war', buildDir,
'-logLevel', 'INFO',
'-localWorkers', '2',
'-compileReport',
'-extra', extraDir,
]
maxHeapSize = '1024m'
}
anttil
committed
classpathEntries = files(
project(':openbis').file('source/java/applicationContext.xml'),
project(':openbis').file('source/java/dbConfigurationContext.xml'),
project(':openbis').file('source/java/ehcache.xml'),
project(':openbis').file('source/java/genericApplicationContext.xml'),
project(':openbis').file('source/java/hibernateContext.xml'),
project(':openbis').file('source/java/schema-for-xslt20.xsd'),
project(':openbis').file('source/java/XMLSchema.xsd'),
project(':screening').file('source/java/screening-applicationContext.xml'),
project(':screening').file('source/java/screening-dssApplicationContext.xml'),
project(':screening').file('source/java/screening-plugin-applicationContext.xml'),
project(':rtd_phosphonetx').file('source/java/proteomics-applicationContext.xml'),
project(':rtd_phosphonetx').file('source/java/proteomics-plugin-applicationContext.xml'),
project(':common').file('source/java/genericCommonContext.xml'),
'source/java/standard-technologies-applicationContext.xml'
)
zipEntries = files(
project(':openbis').file('dist/server/check.sh'),
project(':openbis').file('dist/server/configure.sh'),
project(':openbis').file('dist/server/export-master-data.py'),
project(':openbis').file('dist/server/export-master-data.sh'),
project(':openbis').file('dist/server/install.sh'),
project(':openbis').file('dist/server/jetty.xml'),
project(':openbis').file('dist/server/openBIS.keystore'),
project(':openbis').file('dist/server/openbis.conf'),
project(':openbis').file('dist/server/passwd.sh'),
project(':openbis').file('dist/server/register-master-data.sh'),
project(':openbis').file('dist/server/setup-env'),
project(':openbis').file('dist/server/shutdown.sh'),
project(':openbis').file('dist/server/startup.sh'),
project(':openbis').file('dist/server/status.sh'),
project(':openbis').file('dist/server/version.sh'),
project(':openbis').file('dist/server/watchdog.sh'),
file('dist/server/service.properties'),
file('dist/server/web-client.properties')
)
task checkFilesExist {
inputs.files files(classpathEntries, zipEntries)
anttil
committed
doLast {
classpathEntries.each {
x -> assert x.exists()
}
zipEntries.each {
x -> assert x.exists()
}
anttil
committed
}
}
jarsToBeSignedFolder = "${buildDir}/jars_to_be_signed"
signedJarsFolder = "${buildDir}/signed_jars"
task createOpenbisJar(type: Jar) {
archiveName = 'openbis.jar'
destinationDir = file(jarsToBeSignedFolder)
outputs.file new File(jarsToBeSignedFolder, archiveName)
from zipTree(project(':common').jar.archivePath).plus(
zipTree(project(':openbis-common').jar.archivePath).plus(
zipTree(project(':openbis_api').jar.archivePath).plus(
zipTree(project(':datastore_server').jar.archivePath).plus(
zipTree(project(':screening').jar.archivePath).plus(
zipTree(project(':openbis').jar.archivePath)))))).matching {
include '**/ch/systemsx/cisd/common/**/*.class'
include '**/ch/systemsx/cisd/openbis/common/**/*.class'
include '**/ch/systemsx/cisd/openbis/generic/client/api/**/*.class'
include '**/ch/systemsx/cisd/openbis/generic/client/cli/**/*.class'
include '**/ch/systemsx/cisd/openbis/generic/shared/api/**/*.class'
include '**/ch/systemsx/cisd/openbis/plugin/screening/client/api/**/*.class'
include '**/ch/systemsx/cisd/openbis/plugin/screening/shared/api/**/*.class'
include '**/ch/systemsx/cisd/openbis/dss/client/api/**/*.class'
include '**/ch/systemsx/cisd/openbis/dss/generic/shared/api/**/*.class'
include '**/ch/systemsx/cisd/openbis/dss/screening/shared/api/**/*.class'
include '**/shared/I*.class'
include '**/shared/basic/dto/**/*.class'
include '**/shared/basic/*.class'
include '**/*BuildAndEnvironmentInfo.class'
}
}
task copyJarsForWebStart(type: Copy) {
from configurations.webStartJars.files
into jarsToBeSignedFolder
rename '(.+)-[^-]*\\.jar', '$1.jar'
rename 'dom4j.jar', 'dom4j-1.6.1.jar'
rename 'poi-[^-]*\\.jar', 'poi.jar'
rename 'poi-ooxml-[^-]*\\.jar', 'poi-ooxml.jar'
rename 'poi-ooxml-schemas-[^-]*\\.jar', 'poi-ooxml-schemas.jar'
rename 'geronimo-stax.jar', 'geronimo-stax-api_1.0_spec-1.0.jar'
rename 'xmlbeans.jar', 'xmlbeans-2.3.0.jar'
rename 'marathon-spring-util.*jar', 'stream-supporting-httpinvoker.jar'
}
keystoreFile = '../screening/etc/dev.keystore'
anttil
committed
task signWebStartJars(type: Copy, dependsOn: [createOpenbisJar, dssGui, copyJarsForWebStart]) {
from jarsToBeSignedFolder
into signedJarsFolder
inputs.file keystoreFile
doLast {
file(signedJarsFolder).listFiles().each { file ->
ant.signjar(jar: file, keystore: keystoreFile,
alias: 'openbis', storepass: 'openbistest')
}
}
}
war.dependsOn compileGwt
war.dependsOn checkFilesExist
war.dependsOn signWebStartJars
war {
rootSpec.eachFile { file ->
if (file.name.startsWith('cisd-cifex') || file.name.startsWith('datastore_server')) {
file.exclude()
}
}
from "${compileGwt.buildDir}/ch.systemsx.cisd.openbis.OpenBIS"
from signedJarsFolder
anttil
committed
webXml = file('resource/server/web.xml')
webInf {
from "${compileGwt.buildDir}/WEB-INF",
project(':openbis').file('resource/server/bis-common.xml'),
file('resource/server/spring-servlet.xml'),
project(':common').file('resource/server/web-common.xml')
}
from (classpathEntries) {
into("WEB-INF/classes")
anttil
committed
}
anttil
committed
into("WEB-INF/classes")
include "etc/log.xml"
}
from('targets/dist'){
into("WEB-INF/classes")
include 'BUILD*INFO'
rename 'BUILD.*INFO', 'BUILD-openbis.INFO'
anttil
committed
}
from('../screening/source'){
into("WEB-INF/classes")
include "sql/**/*.sql"
exclude "sql/imaging/postgresql/_ERD"
}
from('../openbis/source'){
into("WEB-INF/classes")
include "sql/**/*.sql"
exclude "sql/generic/_ERD"
duplicatesStrategy 'exclude'
}
anttil
committed
from('../rtd_phosphonetx/source/sql'){
into("WEB-INF/classes")
include "proteomics/**/*.sql"
}
}
task zipCorePlugins(type: Zip) {
archiveName 'core-plugins.zip'
from project(':rtd_phosphonetx').fileTree(dir: 'source/core-plugins', includes:['proteomics/**', 'proteomics-optional/**'], excludes:['**/dss/**', '**/package-to-dist'])
from project(':screening').fileTree(dir: 'source/core-plugins', includes:['screening/**', 'screening-optional/**'], excludes:['**/dss/**', '**/package-to-dist'])
from project(':deep_sequencing_unit').fileTree(dir: 'source/core-plugins', includes:['illumina-ngs/**'], excludes:['**/dss/**', '**/package-to-dist'])
from 'dist/server/core-plugins.properties'
into 'core-plugins'
}
anttil
committed
task adminConsole(type: Jar) {
archiveName 'openbis-admin-console.jar'
includeEmptyDirs false
from zipTree(project(':common').jar.archivePath).plus(
zipTree(project(':openbis-common').jar.archivePath).plus(
zipTree(project(':screening').jar.archivePath).plus(
zipTree(project(':openbis').jar.archivePath)))).matching {
include '**/ch/systemsx/cisd/common/spring/HttpInvokerUtils.class'
include '**/ch/systemsx/cisd/common/**/*.class'
include '**/ch/systemsx/cisd/openbis/common/**/*.class'
include '**/ch/systemsx/cisd/openbis/generic/client/console/**/*.class'
include '**/shared/I*.class'
include '**/shared/basic/dto/**/*.class'
include '**/shared/basic/*.class'
include '**/shared/dto/**/*.class'
include '**/shared/dto/*PE.class'
include '**/shared/authorization/annotation/*.class'
include '**/shared/authorization/ISessionProvider.class'
include '**/*BuildAndEnvironmentInfo.class'
}
anttil
committed
from zipTree(configurations.admin_partial.files.iterator().next()).matching {
include '**/com/google/gwt/user/client/rpc/IsSerializable.class'
include '**/com/google/gwt/user/client/rpc/SerializableException.class'
}
for (File f : configurations.admin_full.files) {
from zipTree(f).matching {
include '**/**'
}
}
manifest {
attributes("Main-Class": "ch.systemsx.cisd.openbis.generic.client.console.AdminConsole",
"Class-Path": "openbis-admin-console.jar cisd-base.jar commons-codec.jar commons-httpclient.jar commons-io.jar commons-logging.jar log4j.jar jline.jar spring.jar marathon-spring-util.jar")
anttil
committed
}
}
adminConsole.dependsOn war
task zipAdminConsole(type: Zip) {
archiveName 'openbis-admin-console.zip'
from adminConsole.archivePath
into 'openbis-admin-console'
}
zipAdminConsole.dependsOn adminConsole
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
def generateMD5(final file) {
java.security.MessageDigest digest = java.security.MessageDigest.getInstance("MD5")
file.withInputStream(){is->
byte[] buffer = new byte[8192]
int read = 0
while( (read = is.read(buffer)) > 0) {
digest.update(buffer, 0, read);
}
}
byte[] md5sum = digest.digest()
BigInteger bigInt = new BigInteger(1, md5sum)
return bigInt.toString(16)
}
task checksums {
ext.destFile = new File(buildDir, 'configuration.MD5')
ext.inputFiles = war.getSource().filter({file -> file.name.endsWith('xml') || file.name.endsWith('.conf') || file.name.endsWith('.properties')})
inputs.files inputFiles
outputs.file destFile
doLast {
if (destFile.exists()) {
destFile.delete()
}
destFile.createNewFile()
configFiles = classpathEntries.filter({file -> file.name.endsWith('xml') || file.name.endsWith('.conf') || file.name.endsWith('.properties')})
configFiles.each {file ->
destFile.text += generateMD5(file)+" webapps/openbis/WEB-INF/classes/"+file.name+"\n"
}
configFiles = war.getSource().filter({file -> file.name.endsWith('xml') || file.name.endsWith('.conf') || file.name.endsWith('.properties')}).minus(classpathEntries)
configFiles.each {file ->
destFile.text += generateMD5(file)+" webapps/openbis/WEB-INF/"+file.name+"\n"
}
}
}
checksums.dependsOn war
task createJettyVersionFile {
ext.versionFile = new File(buildDir, 'jetty-version.txt')
outputs.file versionFile
doLast {
versionFile.text = "${jettyVersion}"
}
}
task zip(type: Zip, dependsOn: createJettyVersionFile) {
from createJettyVersionFile
from war
from zipEntries
from checksums
from configurations.zipping
anttil
committed
from zipCorePlugins.archivePath
from zipAdminConsole.archivePath
rename 'jetty-distribution(.*).zip', 'jetty.zip'
rename 'openBIS(.*).war', 'openBIS.war'
}
zip.dependsOn war
zip.dependsOn zipCorePlugins
anttil
committed
zip.dependsOn zipAdminConsole
zip.dependsOn checksums
task zipDss(type: Zip, dependsOn: signWebStartJars) {
baseName 'datastore_server-standard-technologies'
includeEmptyDirs true
from (configurations.datastore_server) {
into 'datastore_server/lib'
exclude '**/antlr*.jar'
exclude '**/fastutil*.jar'
exclude '**/gwt*.jar'
exclude '**/gxt*.jar'
exclude '**/hibernate*.jar'
exclude '**/jmock*.jar'
exclude '**/junit*.jar'
exclude '**/lucene*.jar'
exclude '**/restrictions*.jar'
exclude '**/testng*.jar'
rename 'common-.*jar', 'common.jar'
}
from (files(dssUploadGuiJars.collect({"${signedJarsFolder}/${it}"}))) {
into 'datastore_server/lib/dss_upload_gui'
}
from (project(':datastore_server').fileTree(dir: 'dist', includes: ['**/*'], excludes:['dss_client.sh', 'etc/**'])) {
into 'datastore_server';
}
from (project(':datastore_server').files('dist/etc/datastore_server.conf', 'dist/etc/openBIS.keystore')) {
into 'datastore_server/etc';
}
from (fileTree(dir: 'dist', includes: ['etc/service.properties', 'etc/log.xml'])) {
into 'datastore_server'
}
from (project(':screening').file('dist/etc/tabular-data-graph.properties')) {
into 'datastore_server/etc';
}
from (file('dist/server/service.properties')) {
into 'datastore_server/server'
}
from (file('dist/server/etc/log.xml')) {
into 'datastore_server/server/etc'
}
anttil
committed
from(dssGuiZip.archivePath) {
into 'datastore_server/lib/'
}
from (project(':rtd_phosphonetx').fileTree(dir: 'source/core-plugins', includes:['proteomics/**', 'proteomics-optional/**'], excludes:['**/as/**', '**/package-to-dist']).plus(
project(':screening').fileTree(dir: 'source/core-plugins', includes:['screening/**', 'screening-optional/**'], excludes:['**/as/**', '**/package-to-dist']).plus(
project(':deep_sequencing_unit').fileTree(dir: 'source/core-plugins', includes:['illumina-ngs/**'], excludes:['**/as/**', '**/package-to-dist'])))) {
into 'core-plugins'
}
}
anttil
committed
task clientsAndApis(type: Zip) {
baseName 'openBIS-clients-and-APIs'
anttil
committed
from dssClientZip.archivePath
from dssGuiZip.archivePath
from queryApiZip.archivePath
from proteomicsApiZip.archivePath
from screeningApiZip.archivePath
anttil
committed
anttil
committed
from (dssClientZip.archivePath) {
anttil
committed
rename { String fileName -> fileName.replace('client', 'client-screening')}
}
anttil
committed
from (dssGuiZip.archivePath) {
anttil
committed
rename { String fileName -> fileName.replace('gui', 'gui-screening')}
}
from ('../openbis_all/dist/readme.txt')
anttil
committed
}
anttil
committed
clientsAndApis.dependsOn dssClientZip
clientsAndApis.dependsOn dssGuiZip
clientsAndApis.dependsOn queryApiZip
clientsAndApis.dependsOn proteomicsApiZip
clientsAndApis.dependsOn screeningApiZip
build.dependsOn zip
build.dependsOn zipDss
anttil
committed
build.dependsOn clientsAndApis