mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19:54:13 +00:00
153 lines
4.9 KiB
Groovy
153 lines
4.9 KiB
Groovy
|
buildscript {
|
||
|
ext.keyStoreDir = "$buildDir/keystore"
|
||
|
ext.httpsKeyStoreDir = "$buildDir/https-keystore"
|
||
|
}
|
||
|
|
||
|
apply plugin: 'kotlin'
|
||
|
apply plugin: 'war'
|
||
|
apply plugin: 'org.akhikhl.gretty'
|
||
|
|
||
|
description 'Proof-of-Concept IAS Proxy server'
|
||
|
|
||
|
import org.akhikhl.gretty.AppStartTask
|
||
|
import org.akhikhl.gretty.AppStopTask
|
||
|
|
||
|
configurations {
|
||
|
integrationTestCompile.extendsFrom testCompile
|
||
|
integrationTestRuntime.extendsFrom testRuntime
|
||
|
}
|
||
|
|
||
|
sourceSets {
|
||
|
integrationTest {
|
||
|
kotlin {
|
||
|
compileClasspath += main.compileClasspath + test.compileClasspath
|
||
|
runtimeClasspath += main.runtimeClasspath + test.runtimeClasspath
|
||
|
//noinspection GroovyAssignabilityCheck
|
||
|
srcDir file('src/integration-test/kotlin')
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
dependencies {
|
||
|
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
|
||
|
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
||
|
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
|
||
|
testCompile "junit:junit:$junit_version"
|
||
|
|
||
|
compile project(":attestation-common")
|
||
|
compile "org.bouncycastle:bcpkix-jdk15on:$bouncycastle_version"
|
||
|
compile "org.jboss.resteasy:resteasy-jaxrs:$resteasy_version"
|
||
|
compile "org.jboss.resteasy:resteasy-jackson2-provider:$resteasy_version"
|
||
|
compile "org.jboss.resteasy:resteasy-servlet-initializer:$resteasy_version"
|
||
|
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
|
||
|
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
|
||
|
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
|
||
|
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
|
||
|
compile "org.apache.httpcomponents:httpclient:$httpclient_version"
|
||
|
compile "org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version"
|
||
|
compile "org.apache.logging.log4j:log4j-core:$log4j_version"
|
||
|
runtime "org.apache.logging.log4j:log4j-web:$log4j_version"
|
||
|
compile "org.slf4j:jcl-over-slf4j:$slf4j_version"
|
||
|
testCompile project(path: ':attestation-common', configuration: 'testArtifacts')
|
||
|
}
|
||
|
|
||
|
task createIntelKeyStores(type: Exec) {
|
||
|
doFirst {
|
||
|
mkdir keyStoreDir
|
||
|
}
|
||
|
|
||
|
inputs.dir "$projectDir/src/main/ssl/intel-ssl"
|
||
|
outputs.files "$keyStoreDir/isv.pfx", "$keyStoreDir/ias.pfx"
|
||
|
workingDir keyStoreDir
|
||
|
commandLine "$projectDir/src/main/ssl/intel-ssl/generate-keystores.sh"
|
||
|
}
|
||
|
|
||
|
task createMockKeyStores(type: Exec) {
|
||
|
doFirst {
|
||
|
mkdir keyStoreDir
|
||
|
}
|
||
|
|
||
|
inputs.dir "$projectDir/src/main/ssl/mockias"
|
||
|
outputs.files "$keyStoreDir/dummyIAS.pfx", "$keyStoreDir/dummyIAS-trust.pfx"
|
||
|
workingDir keyStoreDir
|
||
|
commandLine "$projectDir/src/main/ssl/mockias/generate-keystores.sh"
|
||
|
}
|
||
|
|
||
|
processResources {
|
||
|
dependsOn = [createIntelKeyStores, createMockKeyStores]
|
||
|
from keyStoreDir
|
||
|
}
|
||
|
|
||
|
task integrationTest(type: Test) {
|
||
|
testClassesDirs = sourceSets.integrationTest.output.classesDirs
|
||
|
classpath = sourceSets.integrationTest.runtimeClasspath
|
||
|
systemProperties["test.httpPort"] = testHttpPort
|
||
|
}
|
||
|
|
||
|
task createHttpsKeyStores(type: Exec) {
|
||
|
doFirst {
|
||
|
mkdir httpsKeyStoreDir
|
||
|
}
|
||
|
|
||
|
inputs.dir "$projectDir/src/integration-test/ssl"
|
||
|
outputs.dir httpsKeyStoreDir
|
||
|
workingDir httpsKeyStoreDir
|
||
|
commandLine "$projectDir/src/integration-test/ssl/generate-ssl.sh"
|
||
|
}
|
||
|
|
||
|
project.afterEvaluate {
|
||
|
appBeforeIntegrationTest.dependsOn createHttpsKeyStores
|
||
|
}
|
||
|
|
||
|
gretty {
|
||
|
httpPort = testHttpPort
|
||
|
contextPath = "/"
|
||
|
servletContainer = 'tomcat8'
|
||
|
logDir = "$buildDir/logs"
|
||
|
logFileName = "gretty-test"
|
||
|
integrationTestTask = 'integrationTest'
|
||
|
jvmArgs = [
|
||
|
"-Dorg.jboss.logging.provider=slf4j",
|
||
|
"-Dnet.corda.IsvKeyStorePassword=attestation",
|
||
|
"-Djavax.net.ssl.keyStore=$httpsKeyStoreDir/keystore",
|
||
|
"-Djavax.net.ssl.keyStorePassword=attestation",
|
||
|
"-Djavax.net.ssl.trustStore=$httpsKeyStoreDir/truststore",
|
||
|
"-Djavax.net.ssl.trustStorePassword=attestation",
|
||
|
"-Dattestation.home=$buildDir/logs",
|
||
|
"-Dias.host=localhost:$iasTestHttpsPort",
|
||
|
]
|
||
|
|
||
|
httpsPort = iasTestHttpsPort
|
||
|
httpsEnabled = true
|
||
|
sslNeedClientAuth = true
|
||
|
sslKeyStorePath = "$httpsKeyStoreDir/keystore"
|
||
|
sslKeyStorePassword = 'attestation'
|
||
|
sslKeyManagerPassword = 'attestation'
|
||
|
}
|
||
|
|
||
|
task('startISV', type: AppStartTask, dependsOn: war) {
|
||
|
prepareServerConfig {
|
||
|
httpPort = isvHttpPort
|
||
|
servletContainer = 'tomcat8'
|
||
|
logDir = "$buildDir/logs"
|
||
|
logFileName = "gretty-iasproxy"
|
||
|
jvmArgs = [
|
||
|
"-Dorg.jboss.logging.provider=slf4j",
|
||
|
"-Dnet.corda.IsvKeyStorePassword=attestation",
|
||
|
"-Dias.host=test-as.sgx.trustedservices.intel.com",
|
||
|
"-Dattestation.home=$buildDir/logs",
|
||
|
]
|
||
|
|
||
|
httpsEnabled = false
|
||
|
}
|
||
|
|
||
|
prepareWebAppConfig {
|
||
|
contextPath = "/"
|
||
|
inplace = false
|
||
|
}
|
||
|
|
||
|
interactive = false
|
||
|
}
|
||
|
|
||
|
task("stopISV", type: AppStopTask)
|