2018-07-17 11:31:44 +00:00
|
|
|
apply plugin: 'net.corda.plugins.cordapp'
|
|
|
|
|
|
|
|
def javaHome = System.getProperty('java.home')
|
|
|
|
def shrinkJar = file("$buildDir/libs/${project.name}-${project.version}-tiny.jar")
|
|
|
|
|
|
|
|
cordapp {
|
2018-12-14 09:39:23 +00:00
|
|
|
targetPlatformVersion = corda_platform_version.toInteger()
|
|
|
|
minimumPlatformVersion 1
|
2018-10-15 20:11:52 +00:00
|
|
|
signing {
|
2018-12-10 13:57:56 +00:00
|
|
|
// Cordapp is signed after the "shrink" task.
|
2018-10-15 20:11:52 +00:00
|
|
|
enabled false
|
2018-07-17 11:31:44 +00:00
|
|
|
}
|
2018-11-27 11:41:05 +00:00
|
|
|
sealing {
|
|
|
|
// Cannot seal JAR because other module also defines classes in the package net.corda.vega.analytics
|
|
|
|
enabled false
|
|
|
|
}
|
2018-12-14 09:39:23 +00:00
|
|
|
contract {
|
|
|
|
name "net/corda/vega/contracts"
|
|
|
|
versionId 1
|
|
|
|
vendor "R3"
|
|
|
|
licence "Open Source (Apache 2)"
|
|
|
|
}
|
2018-05-08 15:19:35 +00:00
|
|
|
}
|
|
|
|
|
2018-07-17 11:31:44 +00:00
|
|
|
configurations {
|
|
|
|
shrinkArtifacts
|
|
|
|
}
|
2018-05-08 15:19:35 +00:00
|
|
|
|
|
|
|
dependencies {
|
2018-07-17 11:31:44 +00:00
|
|
|
cordaCompile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
2018-05-08 15:19:35 +00:00
|
|
|
|
|
|
|
// The SIMM demo CorDapp depends upon Cash CorDapp features
|
2018-12-19 18:02:51 +00:00
|
|
|
cordapp project(':finance:contracts')
|
2018-05-08 15:19:35 +00:00
|
|
|
|
|
|
|
// Corda integration dependencies
|
|
|
|
cordaCompile project(':core')
|
|
|
|
|
|
|
|
|
|
|
|
// Cordapp dependencies
|
|
|
|
// Specify your cordapp's dependencies below, including dependent cordapps
|
2018-07-17 11:31:44 +00:00
|
|
|
compile "com.opengamma.strata:strata-product:$strata_version"
|
|
|
|
compile "com.opengamma.strata:strata-market:$strata_version"
|
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
|
|
|
classifier = 'fat'
|
|
|
|
}
|
2018-05-08 15:19:35 +00:00
|
|
|
|
2018-07-17 11:31:44 +00:00
|
|
|
import proguard.gradle.ProGuardTask
|
|
|
|
task shrink(type: ProGuardTask) {
|
|
|
|
injars jar
|
|
|
|
outjars shrinkJar
|
|
|
|
|
|
|
|
libraryjars "$javaHome/lib/rt.jar"
|
|
|
|
libraryjars "$javaHome/lib/jce.jar"
|
|
|
|
configurations.runtime.forEach {
|
|
|
|
libraryjars it.path, filter: '!META-INF/versions/**'
|
|
|
|
}
|
|
|
|
|
|
|
|
dontwarn 'afu.org.checkerframework.**'
|
|
|
|
dontwarn 'co.paralleluniverse.**'
|
|
|
|
dontwarn 'org.checkerframework.**'
|
|
|
|
dontwarn 'org.joda.**'
|
|
|
|
dontnote
|
|
|
|
|
|
|
|
// We need to preserve our CorDapp's own directory structure so that Corda
|
|
|
|
// can find the contract classes.
|
|
|
|
keepdirectories 'net/corda/**'
|
|
|
|
keepattributes '*'
|
|
|
|
dontobfuscate
|
|
|
|
dontoptimize
|
|
|
|
verbose
|
|
|
|
|
|
|
|
// These are our CorDapp classes, so don't change these.
|
|
|
|
keep 'class net.corda.vega.** { *; }', includedescriptorclasses:true
|
|
|
|
|
|
|
|
// Until CorDapps are isolated from each other, we need to ensure that the
|
|
|
|
// versions of the classes that this CorDapp needs are still usable by other
|
|
|
|
// CorDapps. Unfortunately, this means that we cannot shrink them as much as
|
|
|
|
// we'd like to.
|
|
|
|
keepclassmembers 'class com.opengamma.strata.** { *; }', includedescriptorclasses:true
|
|
|
|
keepclassmembers 'class com.google.** { *; }', includedescriptorclasses:true
|
|
|
|
keepclassmembers 'class org.joda.** { *; }', includedescriptorclasses:true
|
|
|
|
}
|
2018-12-10 13:57:56 +00:00
|
|
|
|
|
|
|
task sign(type: net.corda.plugins.SignJar) {
|
|
|
|
inputJars shrink
|
|
|
|
}
|
|
|
|
|
2018-07-17 11:31:44 +00:00
|
|
|
jar.finalizedBy shrink
|
2018-12-10 13:57:56 +00:00
|
|
|
shrink.finalizedBy sign
|
2018-07-17 11:31:44 +00:00
|
|
|
|
|
|
|
artifacts {
|
2018-12-10 13:57:56 +00:00
|
|
|
shrinkArtifacts file: sign.outputJars.singleFile, name: project.name, type: 'jar', extension: 'jar', classifier: 'tiny', builtBy: sign
|
2018-07-17 11:31:44 +00:00
|
|
|
}
|