Newer
Older
Adam Laskowski
committed
apply from: '../build/repository.gradle'
Adam Laskowski
committed
repositories repositoryConfig
dependencies {
classpath 'apache:commons-codec:1.10',
Adam Laskowski
committed
'owasp:dependency-check-gradle:6.2.2',
'paleozogt:symzip-plugin:0.10.1'
Adam Laskowski
committed
//plugins {
// id "com.github.node-gradle.node" version "3.2.1"
//}
apply plugin: org.owasp.dependencycheck.gradle.DependencyCheckPlugin
apply plugin: "org.paleozogt.symzip"
Adam Laskowski
committed
failBuildOnCVSS = 7 // 0 - 4 = low, 4 - 7 = medium, 7 - 9 = high, 9-10 = critical
suppressionFile = "owasp_suppressing_false_positives.xml"
analyzers {
assemblyEnabled = false
}
proxy {
server = 'proxy.ethz.ch'
port = 3128
}
Adam Laskowski
committed
evaluationDependsOn(':lib-commonbase')
Adam Laskowski
committed
evaluationDependsOn(':lib-common')
evaluationDependsOn(':api-openbis-java')
evaluationDependsOn(':lib-openbis-common')
evaluationDependsOn(':lib-authentication')
evaluationDependsOn(':lib-dbmigration')
evaluationDependsOn(':server-application-server')
evaluationDependsOn(':server-original-data-store')
evaluationDependsOn(':server-screening')
evaluationDependsOn(':server-external-data-store')
evaluationDependsOn(':ui-admin')
Adam Laskowski
committed
evaluationDependsOn(':ui-eln-lims')
Adam Laskowski
committed
apply from: '../build/javaproject.gradle'
apply from: 'query-api.gradle'
apply from: 'screening-api.gradle'
apply from: 'clients.gradle'
apply from: 'admin-console.gradle'
apply plugin: 'war'
anttil
committed
archivesBaseName = 'openBIS-server-standard-technologies'
configurations.create('gwt')
configurations.create('zipping')
// TODO: find how configuration can be renamed into 'server-original-data-store'
configurations.create('server_original_data_store')
configurations.create('javadoc_sources')
configurations.create('javadoc_compilation')
Adam Laskowski
committed
configurations.create('blast_tar')
configurations.create('libOpenbisCommonJavadoc')
configurations.create('serverOriginalDataStoreJavadoc')
configurations.create('serverApplicationServerJavadoc')
anttil
committed
def jettyDistributionVersion = '9.4.44.v20210927'
dependencies {
api project(':server-screening')
Adam Laskowski
committed
providedCompile 'google:gwt-user:2.4'
providedRuntime "eclipse:jetty-deploy:${jettyVersion}.v20210927@jar",
"eclipse:jetty-xml:${jettyVersion}.v20210927@jar",
"eclipse:jetty-webapp:${jettyVersion}.v20210927@jar",
"eclipse:jetty-servlet:${jettyVersion}.v20210927@jar",
"eclipse:jetty-security:${jettyVersion}.v20210927@jar",
"eclipse:jetty-server:${jettyVersion}.v20210927@jar",
"eclipse:jetty-continuation:${jettyVersion}.v20210927@jar"
gwt 'reveregroup:gwt-image-loader:1.1.4',
'google:gwt-dev:2.4'
zipping "eclipse:jetty-distribution:${jettyVersion}@zip"
Adam Laskowski
committed
blast_tar "blast:blast:2.2.30@tar.gz"
server_original_data_store project(':server-screening'),
Adam Laskowski
committed
'bioformats:bioformats:6.5.1',
'imagej:ij:1.43u',
'cisd:cisd-openbis-knime-server:13.6.0.r29301',
'apache:xml-apis:1.3.03',
'slf4j:slf4j:1.6.2',
'slf4j:slf4j-log4j12:1.6.2',
'sybit:image-viewer:0.3.6'
Adam Laskowski
committed
javadoc_sources project(path: ':lib-commonbase', configuration: 'archives'),
Adam Laskowski
committed
project(path: ':lib-common', configuration: 'archives'),
project(path: ':api-openbis-java', configuration: 'archives'),
project(path: ':lib-openbis-common', configuration: 'archives'),
project(path: ':server-application-server', configuration: 'archives'),
project(path: ':server-original-data-store', configuration: 'archives'),
project(path: ':server-screening', configuration: 'archives'),
Adam Laskowski
committed
'sis:sis-base:18.09.0:sources',
'cisd:cisd-args4j:9.11.2:sources',
'cisd:cisd-hotdeploy:13.01.0:sources'
javadoc_compilation project(path: ':server-screening')
Adam Laskowski
committed
testImplementation project(path: ':lib-commonbase', configuration: 'tests'),
Adam Laskowski
committed
project(path: ':lib-common', configuration: 'tests'),
project(path: ':lib-dbmigration', configuration: 'tests'),
project(path: ':lib-authentication', configuration: 'tests'),
project(path: ':api-openbis-java', configuration: 'tests'),
project(path: ':lib-openbis-common', configuration: 'tests'),
project(path: ':server-original-data-store', configuration: 'tests'),
Adam Laskowski
committed
'fjelmer:classycle:1.4.2',
'testng:testng:6.8-CISD',
'springframework:spring-test:5.0.17.RELEASE'
testImplementation(project(path: ':server-application-server', configuration: 'tests')) {
exclude group: 'google', module: 'gwt-user'
libOpenbisCommonJavadoc project(':lib-openbis-common')
serverOriginalDataStoreJavadoc project(':server-original-data-store')
serverApplicationServerJavadoc project(':server-application-server')
sourceSets {
Adam Laskowski
committed
test {
resources {
srcDirs = ['source/java', 'sourceTest/java']
}
}
}
def gwtBuildDir = "${project.buildDir}/gwt"
def gwtCacheBuildDir = "${project.buildDir}/gwt-unitCache"
def gwtModuleName = 'ch.systemsx.cisd.openbis.OpenBIS'
def gwtModuleBuildDir = "${gwtBuildDir}/${gwtModuleName}"
def gwtArchivePath = 'resource'
def gwtArchiveFileName = 'gwt.tar.gz'
Adam Laskowski
committed
task compileGwt(dependsOn: classes, type: JavaExec) {
ext.buildDir = gwtBuildDir
def 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 {
[
sourceSets.main.java.srcDirs,
Adam Laskowski
committed
project(":server-application-server").sourceSets.main.java.srcDirs,
project(":server-application-server").sourceSets.main.output.resourcesDir,
project(":server-application-server").sourceSets.main.output.classesDirs,
project(":server-application-server").sourceSets.main.compileClasspath,
project(":lib-common").sourceSets.main.java.srcDirs,
project(":api-openbis-java").sourceSets.main.java.srcDirs,
project(":server-screening").sourceSets.main.java.srcDirs,
project(":server-screening").sourceSets.main.output.resourcesDir,
Adam Laskowski
committed
configurations.gwt
]
}
args =
[
gwtModuleName,
'-war', buildDir,
'-logLevel', 'INFO',
'-localWorkers', '2',
'-compileReport',
'-extra', extraDir,
]
maxHeapSize = '1024m'
systemProperty "javax.xml.parsers.SAXParserFactory", "org.apache.xerces.jaxp.SAXParserFactoryImpl"
}
anttil
committed
task buildCoreUIPackageUsingJDK8(type: Tar, dependsOn: compileGwt) {
Adam Laskowski
committed
from gwtBuildDir
destinationDirectory = file(gwtArchivePath)
archiveFileName = gwtArchiveFileName
compression = Compression.GZIP
doLast { // Cleanup, the rest of the build should not use these
delete gwtBuildDir
delete gwtCacheBuildDir
}
}
task untarGwt(type: Copy) {
Adam Laskowski
committed
from tarTree(resources.gzip("${gwtArchivePath}/${gwtArchiveFileName}"))
into gwtBuildDir
}
task copyOpenbisStaticResources(type: Copy) {
Adam Laskowski
committed
dependsOn 'untarGwt'
from "${project(':server-application-server').projectDir}/source/java/ch/systemsx/cisd/openbis/public"
Adam Laskowski
committed
into gwtModuleBuildDir
}
task copyV3ApiResources(type: Copy, dependsOn: [copyOpenbisStaticResources, ':api-openbis-javascript:bundleOpenbisStaticResources']) {
from("${project(':api-openbis-javascript').projectDir}/src/v3")
into "${gwtModuleBuildDir}/resources/api/v3"
}
anttil
committed
ext.classpathEntries = files(
project(':server-application-server').file('source/java/applicationContext.xml'),
project(':server-application-server').file('source/java/dbConfigurationContext.xml'),
project(':server-application-server').file('source/java/ehcache.xml'),
project(':server-application-server').file('source/java/genericApplicationContext.xml'),
project(':server-application-server').file('source/java/hibernateContext.xml'),
project(':server-application-server').file('source/java/schema-for-xslt20.xsd'),
project(':server-application-server').file('source/java/XMLSchema.xsd'),
project(':server-screening').file('source/java/screening-applicationContext.xml'),
project(':server-screening').file('source/java/screening-dssApplicationContext.xml'),
project(':server-screening').file('source/java/screening-plugin-applicationContext.xml'),
Adam Laskowski
committed
project(':lib-common').file('source/java/genericCommonContext.xml'),
Adam Laskowski
committed
'source/java/standard-technologies-applicationContext.xml'
anttil
committed
)
ext.zipEntries = files(
project(':server-application-server').file('dist/server/autosymlink.sh'),
project(':server-application-server').file('dist/server/check.sh'),
project(':server-application-server').file('dist/server/configure.sh'),
project(':server-application-server').file('dist/server/export-master-data.py'),
project(':server-application-server').file('dist/server/export-master-data.sh'),
project(':server-application-server').file('dist/server/install.sh'),
project(':server-application-server').file('dist/server/openBIS.keystore'),
project(':server-application-server').file('dist/server/openbis.conf'),
project(':server-application-server').file('dist/server/passwd.sh'),
project(':server-application-server').file('dist/server/register-master-data.sh'),
project(':server-application-server').file('dist/server/setup-env'),
project(':server-application-server').file('dist/server/shutdown.sh'),
project(':server-application-server').file('dist/server/startup.sh'),
project(':server-application-server').file('dist/server/status.sh'),
project(':server-application-server').file('dist/server/version.sh'),
project(':server-application-server').file('dist/server/watchdog.sh'),
project(':server-application-server').fileTree(dir: 'dist/server').matching {
Adam Laskowski
committed
include 'base/**'
},
file('dist/server/service.properties'),
file('dist/server/web-client.properties')
)
task checkFilesExist {
Adam Laskowski
committed
inputs.files files(classpathEntries, zipEntries)
doLast {
classpathEntries.each {
x -> assert x.exists()
}
zipEntries.each {
x -> assert x.exists()
}
anttil
committed
}
war.dependsOn untarGwt
war.dependsOn copyOpenbisStaticResources
war.dependsOn checkFilesExist
war {
rootSpec.eachFile { file ->
Adam Laskowski
committed
|| file.name.startsWith('server-original-data-store')
|| file.name.startsWith('bioformats')
|| file.name.startsWith('cisd-image-readers')
Adam Laskowski
committed
) {
file.exclude()
}
}
from "${project.buildDir}/gwt/ch.systemsx.cisd.openbis.OpenBIS"
from signedJarsFolder
anttil
committed
webXml = file('resource/server/web.xml')
webInf {
from "${project.buildDir}/gwt/WEB-INF",
project(':server-application-server').file('resource/server/bis-common.xml'),
Adam Laskowski
committed
file('resource/server/spring-servlet.xml'),
file('resource/server/jetty-web.xml'),
Adam Laskowski
committed
project(':lib-common').file('resource/server/web-common.xml')
Adam Laskowski
committed
from(classpathEntries) {
anttil
committed
}
Adam Laskowski
committed
from('dist/server') {
into("WEB-INF/classes")
include "etc/log.xml"
}
Adam Laskowski
committed
from('targets/dist') {
into("WEB-INF/classes")
include 'BUILD*INFO'
rename 'BUILD.*INFO', 'BUILD-openbis.INFO'
anttil
committed
from('../server-screening/source') {
into("WEB-INF/classes")
include "sql/**/*.sql"
exclude "sql/imaging/postgresql/_ERD"
}
anttil
committed
from('../server-application-server/source') {
into("WEB-INF/classes")
include "sql/**/*.sql"
exclude "sql/generic/_ERD"
}
felmer
committed
def downloadCorePlugin(url, pluginname) {
Adam Laskowski
committed
if (!project.getGradle().startParameter.isOffline()) {
def file = project(':server-application-server').file("../core-plugin-openbis/targets/downloads/${pluginname}.zip")
Adam Laskowski
committed
if (file.exists() == false || System.currentTimeMillis() - file.lastModified() > 3600000) {
file.getParentFile().mkdirs()
ext.executeFunction('curl', [url, '-sLk', '-o', file.getAbsolutePath()])
ext.executeFunction('unzip', ['-uqo', file.getAbsolutePath(), '-d', '../core-plugin-openbis/targets/downloads/'])
Adam Laskowski
committed
}
}
import org.paleozogt.gradle.zip.SymZip;
task zipCorePlugins(type: SymZip) {
Adam Laskowski
committed
duplicatesStrategy 'include'
includeEmptyDirs = false
archiveName 'core-plugins.zip'
downloadCorePlugin('https://github.com/aarpon/obit_flow_core_technology/archive/release/20.x.zip', 'flow')
downloadCorePlugin('https://github.com/aarpon/obit_microscopy_core_technology/archive/release/20.x.zip', 'microscopy')
downloadCorePlugin('https://github.com/aarpon/obit_shared_core_technology/archive/release/20.x.zip', 'shared')
from project(':server-screening').fileTree(dir: 'source/core-plugins', includes: ['screening/**', 'screening-optional/**'], excludes: ['**/package-to-dist'])
Adam Laskowski
committed
from fileTree(dir: 'targets/downloads/obit_flow_core_technology-release-20.x/core-plugins', includes: ['flow/**'])
from fileTree(dir: 'targets/downloads/obit_microscopy_core_technology-release-20.x/core-plugins', includes: ['microscopy/**'])
from fileTree(dir: 'targets/downloads/obit_shared_core_technology-release-20.x/core-plugins', includes: ['shared/**'])
from 'dist/core-plugins'
from 'dist/server/core-plugins.properties'
Adam Laskowski
committed
from(configurations.blast_tar.collect { tarTree(it) }) {
into 'eln-lims'
}
Adam Laskowski
committed
into 'core-plugins'
def generateMD5(final file) {
Adam Laskowski
committed
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 {
Adam Laskowski
committed
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
Adam Laskowski
committed
doLast {
if (destFile.exists()) {
destFile.delete()
}
destFile.createNewFile()
def 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 = "${jettyDistributionVersion}"
}
}
task zip(type: Zip, dependsOn: createJettyVersionFile) {
from createJettyVersionFile
Adam Laskowski
committed
from zipEntries
from checksums
from configurations.zipping
anttil
committed
from zipCorePlugins.archivePath
Adam Laskowski
committed
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: copyJarsForWebStart) {
Adam Laskowski
committed
baseName 'datastore_server-standard-technologies'
includeEmptyDirs true
from(configurations.server_original_data_store) {
Adam Laskowski
committed
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'
Adam Laskowski
committed
rename 'lib-common-.*jar', 'lib-common.jar'
rename 'lib-commonbase-.*jar', 'lib-commonbase.jar'
Adam Laskowski
committed
}
from(signedJarsFolder) {
into 'datastore_server/lib/dss_upload_gui'
exclude openbisClientJarName
exclude dssCliClientJarName
}
from(project(':server-original-data-store').fileTree(dir: 'dist', includes: ['**/*'], excludes: ['dss_client.sh', 'etc/**'])) {
Adam Laskowski
committed
into 'datastore_server';
}
from(project(':server-original-data-store').files('dist/etc/datastore_server.conf', 'dist/etc/openBIS.keystore')) {
Adam Laskowski
committed
into 'datastore_server/etc';
}
from(fileTree(dir: 'dist', includes: ['etc/service.properties', 'etc/log.xml'])) {
into 'datastore_server'
}
from(project(':server-screening').file('dist/etc/tabular-data-graph.properties')) {
Adam Laskowski
committed
into 'datastore_server/etc';
}
}
task zipBdlServer(type: Zip, dependsOn: project(':server-external-data-store').tasks.distZip) {
Adam Laskowski
committed
baseName 'big_data_link_server'
from zipTree('../server-external-data-store/build/distributions/server-external-data-store.zip')
}
task pybisZip(type: Zip) {
Adam Laskowski
committed
baseName 'pybis'
from '../api-openbis-python3-pybis/'
}
task obisZip(type: Zip) {
Adam Laskowski
committed
baseName 'obis'
from '../app-openbis-command-line/'
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
task libOpenbisCommonJavadoc(type: Javadoc) {
source project(':lib-openbis-common').files('source/java').getAsFileTree().matching {
include "**/ch/ethz/sis/openbis/common/io/hierarchical_content/api/**/*.java"
}
classpath = configurations.libOpenbisCommonJavadoc
}
task libOpenbisCommonJavadocZip(type: Zip, dependsOn: libOpenbisCommonJavadoc) {
archiveName 'javadoc-lib-openbis-common.zip'
from libOpenbisCommonJavadoc.destinationDir
}
task serverOriginalDataStoreJavadoc(type: Javadoc) {
source project(':server-original-data-store').files('source/java').getAsFileTree().matching {
include "**/ch/systemsx/cisd/openbis/dss/generic/server/plugins/jython/api/**/*.java"
include "**/ch/systemsx/cisd/openbis/dss/generic/shared/api/internal/**/*.java"
}
classpath = configurations.serverOriginalDataStoreJavadoc
}
task serverOriginalDataStoreJavadocZip(type: Zip, dependsOn: serverOriginalDataStoreJavadoc) {
archiveName 'javadoc-server-original-data-store.zip'
from serverOriginalDataStoreJavadoc.destinationDir
}
task serverApplicationServerJavadoc(type: Javadoc) {
source project(':server-application-server').files('source/java').getAsFileTree().matching {
include "**/ch/systemsx/cisd/openbis/generic/shared/managed_property/api/**/*.java"
}
classpath = configurations.serverApplicationServerJavadoc
}
task serverApplicationServerJavadocZip(type: Zip, dependsOn: serverApplicationServerJavadoc) {
archiveName 'javadoc-server-application-server.zip'
from serverApplicationServerJavadoc.destinationDir
}
task clientsAndApis(type: Zip, dependsOn: [dssClientZip, queryApiZip, apiV3Zip, screeningApiZip, pybisZip, obisZip,
dropboxJavaDocZip, dynamicApiJavadocZip, libOpenbisCommonJavadocZip,
serverOriginalDataStoreJavadocZip, serverApplicationServerJavadocZip]) {
Adam Laskowski
committed
baseName 'openBIS-clients-and-APIs'
from dssClientZip.archivePath
from queryApiZip.archivePath
from apiV3Zip.archivePath
from screeningApiZip.archivePath
from pybisZip.archivePath
from obisZip.archivePath
from dropboxJavaDocZip.archivePath
from dynamicApiJavadocZip.archivePath
from libOpenbisCommonJavadocZip.archivePath
from serverOriginalDataStoreJavadocZip.archivePath
from serverApplicationServerJavadocZip.archivePath
Adam Laskowski
committed
from('dist/client/readme.txt')
rename { filename ->
if (filename.startsWith('pybis-')) {
def contentOfSetUpFile = zipTree(pybisZip.archivePath).getFiles().findAll { it.path.endsWith('src/python/setup.cfg') }.iterator().next().text
def pybisVersion = (contentOfSetUpFile =~ /version.*=.*(.*)/)[0][1]
'pybis-' + pybisVersion + '.zip'
} else {
filename
}
anttil
committed
}

yvesn
committed
task deleteOpenbisNgUi(type: Delete) {
delete 'dist/core-plugins/admin'

yvesn
committed
}
task copyOpenbisNgUiToCorePlugins(type: Copy, dependsOn: [deleteOpenbisNgUi, ':ui-admin:copyWebApp']) {
from project(':ui-admin').file('build/core-plugins')
piotr.kupczyk@id.ethz.ch
committed
into file('dist/core-plugins')

yvesn
committed
}
Adam Laskowski
committed
task deleteOpenbisElnLims(type: Delete) {
delete 'dist/core-plugins/eln-lims'
}
task copyOpenbisElnLimsCorePlugins(type: Copy, dependsOn: [deleteOpenbisNgUi, ':ui-eln-lims:copyCorePlugins']) {
from project(':ui-eln-lims').file('build/core-plugins')
into file('dist/core-plugins')
}

yvesn
committed
zipCorePlugins.dependsOn copyOpenbisNgUiToCorePlugins
Adam Laskowski
committed
zipCorePlugins.dependsOn copyOpenbisElnLimsCorePlugins

yvesn
committed
task generateJavadoc(type: Javadoc) {
Adam Laskowski
committed
source = configurations.javadoc_sources.collect {
zipTree(it).matching {
include "**/ch/ethz/sis/openbis/generic/asapi/**/*.java"
include "**/ch/ethz/sis/openbis/generic/dssapi/**/*.java"
include "**/ch/systemsx/cisd/**/api/**/*.java"
include "**/ch/systemsx/cisd/**/etlserver/TopLevelDataSetRegistratorGlobalState.java"
include "**/ch/systemsx/cisd/**/etlserver/registrator/*.java"
include "**/ch/systemsx/cisd/base/**/*.java"
include "**/ch/systemsx/cisd/common/annotation/*.java"
Adam Laskowski
committed
include "**/ch/systemsx/cisd/common/mail/*.java"
include "**/OpenBISScreeningML.java"
Adam Laskowski
committed
}
}
classpath = configurations.javadoc_compilation
maxMemory = "1024m"
options.addStringOption("source", "11")
build.dependsOn zip
build.dependsOn zipDss
build.dependsOn zipBdlServer
build.dependsOn clientsAndApis
anttil
committed
build.dependsOn dssUploadGuiStandaloneZip
build.dependsOn dssUploadGuiStandaloneJar