corda/tools/demobench/build.gradle
Schife 28852ce47d Razvan/merge 4.3 into 4.4 (#5494)
* NOTICK: Corda 4.3-RC01

Created first release candidate of Corda 4.3 - RC01.

* CORDA-3141: Add GracefulReconnect callbacks which allow logic to be performed when RPC disconnects unexpectedly (#5430)

Also removed potential for growing stack trace on reconnects.

* CORDA-2050 Upgrade Corda to Java 11 (compatibility mode) (#5356)

Upgrade Corda to run with Java 11 (compatibility mode) - see https://github.com/corda/corda/pull/5356

* ENT-4198 Adding legal text

Signed-off-by: Ed Prosser <edward.prosser@r3.com>

* TM-29 new baseline for 4.3 since new debt has been added with the last few commits (#5487)

* TM-23 compileAll task to compile all code (#5490)

* Add simple compileAll task to be used by warning check

* lazy configure compileAll

* TM-32 Merge OS 4.3 into 4.4

* TM-32 fixed detekt issue

* Downgrade Dokka back to 0.9.17 due to failing docs_builder.

* add ability to group test types together (#5459)

* add ability to group test types together

* add ability to specify podCount for use in parallel testing

* remove compiler xml

* add Jenkinsfile to enable scanning

* trigger build

* add ability to specify what docker tag to use from outside of the build

* fix docker work dir

* fix pipeline syntax issues

* use environment rather than `def`

* move agent restrictor outside of stages block

* use steps block

* more pipeline syntax fixes

* even more pipeline syntax fixes

* even more pipeline syntax fixes

* add kubenetize as property to image build

* move clear of docker image to end of build rather than start to prevent colocated builds

* escape dollar on docker image remove command

* attempt to kill all existing jobs

* fix compile issue due to killall_jobs

* fix compile issue due to killall_jobs pt2

* fix spelling

* make all variables environment variables

* add logic to delete images locally after pushing

* wrap testing phase with try / finally so that junit reports are always evaluated

* change the behaviour around post build actions

* break implicit link between testing phase and image building phase, allowing testing to occur without a rebuild and push of image

* prepend registry name to provided tag

* allow tasks to specify whether they wish to stream output from containers

* add timestamps directive to Jenkinsfile to have timing info on output

* make KubesTest resilient against transient pod failures in k8s

* increase CPU request

* add logic to allow specifying container resource requests

* attempt to run unit and integration tests in parallel

* change unit tests to use 3 cores to allow co-location on 8c machines

* join grouped tests together to give pod meaningful name

* add step to renew token with GKE

* change renew step to use pods instead of nodes

* fix bug where memory request is not correctly passed to pod

* disable unit tests for now

* [CORDA-2368] Added exception handling for missing files that displays appropriate messages rather than defaulting to file names. (#5472)

* NOTIK Minor adjustments to Detekt rules to reflect current working practises  (#5498)

* Minor adjustments to rules to reflect current working practises (including IntelliJ code style alignment)

* Adjust another rule in line with existing code style.

* rebaseline with changed detekt ruleset

* rebaseline with NodeStartup changes
2019-09-20 14:10:15 +00:00

251 lines
8.0 KiB
Groovy

// JDK 11 JavaFX
plugins {
id 'org.openjfx.javafxplugin' version '0.0.7' apply false
}
if (JavaVersion.current().isJava9Compatible()) {
apply plugin: 'org.openjfx.javafxplugin'
javafx {
version = "11.0.2"
modules = ['javafx.controls',
'javafx.fxml',
'javafx.swing'
]
}
}
ext {
tornadofx_version = '1.7.15'
jna_version = '4.5.2'
java_home = System.properties.'java.home'
pkg_source = "$buildDir/packagesrc"
pkg_outDir = "$buildDir/javapackage"
dist_source = "$pkg_source/demobench-$version"
pkg_version = version.indexOf('-') >= 0 ? version.substring(0, version.indexOf('-')) : version
pkg_macosxKeyUserName = 'R3CEV'
}
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'application'
evaluationDependsOn(':tools:explorer:capsule')
evaluationDependsOn(':webserver:webcapsule')
mainClassName = 'net.corda.demobench.DemoBench'
applicationDefaultJvmArgs = [
'-Djava.util.logging.config.class=net.corda.demobench.config.LoggingConfig',
'-Dorg.jboss.logging.provider=slf4j'
]
repositories {
flatDir {
dirs 'libs'
}
jcenter()
}
configurations {
compile {
// We don't need Hibernate just for its @Type annotation.
exclude group: 'org.hibernate', module: 'hibernate-core'
}
}
dependencies {
compile project(':client:rpc')
compile project(':finance:contracts')
compile project(':finance:workflows')
compile project(':tools:worldmap')
// TornadoFX: A lightweight Kotlin framework for working with JavaFX UI's.
compile "no.tornado:tornadofx:$tornadofx_version"
// Controls FX: more java FX components http://fxexperience.com/controlsfx/
compile "org.controlsfx:controlsfx:$controlsfx_version"
compile "com.h2database:h2:$h2_version"
compile "net.java.dev.jna:jna-platform:$jna_version"
compile "com.google.guava:guava:$guava_version"
compile "org.slf4j:log4j-over-slf4j:$slf4j_version"
compile "org.slf4j:jul-to-slf4j:$slf4j_version"
compile "org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version"
compile "org.apache.logging.log4j:log4j-core:$log4j_version"
compile "com.typesafe:config:$typesafe_config_version"
// FontAwesomeFX: icons in the form of a font.
compile "de.jensd:fontawesomefx-fontawesome:$fontawesomefx_fontawesome_version"
compile "de.jensd:fontawesomefx-commons:$fontawesomefx_commons_version"
// JediTerm: the terminal emulator used in IntelliJ. We have forked it and tweaked it, see https://github.com/corda/jediterm
compile ':terminal-331a005d6793e52cefc9e2cec6774e62d5a546b1'
compile ':pty4j-0.7.2'
compile ':purejavacomm-0.0.18'
testCompile project(':test-utils')
testCompile project(':webserver')
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}"
testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}"
testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testCompile "org.assertj:assertj-core:$assertj_version"
testCompile "junit:junit:$junit_version"
}
tasks.withType(JavaCompile) {
// Resolves a Gradle warning about not scanning for pre-processors.
options.compilerArgs << '-proc:none'
}
jar {
manifest {
attributes(
'Main-Class': mainClassName,
'Class-Path': configurations.runtimeClasspath.collect { it.name }.join(' '),
)
}
}
test {
systemProperty 'java.util.logging.config.class', 'net.corda.demobench.config.LoggingConfig'
systemProperty 'org.jboss.logging.provider', 'slf4j'
}
distributions {
main() {
contents {
into('lib/linux') {
from 'libs/linux'
fileMode = 0555
}
into('lib/macosx') {
from 'libs/macosx'
fileMode = 0555
}
into('lib/win') {
from 'libs/win'
fileMode = 0555
}
from(project(':tools:explorer:capsule').tasks.buildExplorerJAR) {
rename 'node-explorer-(.*)', 'node-explorer.jar'
into 'explorer'
fileMode = 0444
}
from(project(':node:capsule').tasks.buildCordaJAR) {
rename 'corda-(.*)', 'corda.jar'
into 'corda'
fileMode = 0444
}
from(project(':webserver:webcapsule').tasks.buildWebserverJar) {
rename 'corda-webserver-(.*)', 'corda-webserver.jar'
into 'corda'
fileMode = 0444
}
from(project(':finance:contracts').tasks.jar) {
rename 'corda-finance-contracts(.*)', 'corda-finance-contracts.jar'
into 'cordapps'
fileMode = 0444
}
from(project(':finance:workflows').tasks.jar) {
rename 'corda-finance-workflows(.*)', 'corda-finance-workflows.jar'
into 'cordapps'
fileMode = 0444
}
}
}
}
/*
* Bundles the application using JavaPackager,
* using the ZIP distribution as source.
*/
task javapackage(dependsOn: distZip) {
doLast {
delete([pkg_source, pkg_outDir])
copy {
from(zipTree(distZip.outputs.files.singleFile))
into pkg_source
}
copy {
/*
* Copy non-text formats "as-is".
*/
from("$projectDir/package") {
exclude '**/*.spec'
exclude '**/*.sh'
exclude '**/*.wsf'
exclude '**/*.manifest'
}
into "$pkg_source/package"
}
copy {
/*
* Expand tokens for text formats.
*/
from("$projectDir/package") {
include '**/*.spec'
include '**/*.sh'
include '**/*.wsf'
include '**/*.manifest'
}
filter { line ->
line.replaceAll('@pkg_version@', pkg_version)
.replaceAll('@signingKeyUserName@', pkg_macosxKeyUserName)
}
into "$pkg_source/package"
}
ant.taskdef(
resource: 'com/sun/javafx/tools/ant/antlib.xml',
classpath: "$pkg_source:$java_home/../lib/ant-javafx.jar"
)
ant.deploy(nativeBundles: packageType, outdir: pkg_outDir, outfile: 'DemoBench', verbose: 'true') {
application(name: 'Corda DemoBench', version: pkg_version, mainClass: mainClassName)
info(title: 'Corda DemoBench', vendor: 'R3', description: 'A sales and educational tool for demonstrating Corda.')
//noinspection GroovyAssignabilityCheck
resources {
fileset(dir: "$dist_source/lib", type: 'jar') {
include(name: '*.jar')
}
fileset(dir: "$dist_source/lib", type: 'native') {
include(name: "macosx/**/*.dylib")
include(name: "win/**/*.dll")
include(name: "win/**/*.exe")
include(name: "linux/**/*.so")
}
fileset(dir: dist_source, type: 'data') {
include(name: 'corda/*.jar')
include(name: 'cordapps/*.jar')
include(name: 'explorer/*.jar')
}
fileset(dir: "$pkg_source/package", type: 'data') {
include(name: "bugfixes/**")
}
}
// This is specific to MacOSX packager.
bundleArgument(arg: 'mac.signing-key-user-name', value: pkg_macosxKeyUserName)
platform {
//noinspection GroovyAssignabilityCheck
property(name: 'java.util.logging.config.class', value: 'net.corda.demobench.config.LoggingConfig')
//noinspection GroovyAssignabilityCheck
property(name: 'org.jboss.logging.provider', value: 'slf4j')
}
preferences(install: true)
}
}
}