forked from corda/corda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
160 lines (138 loc) · 4.15 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
buildscript {
Properties constants = new Properties()
file("../constants.properties").withInputStream { constants.load(it) }
ext {
artifactory_contextUrl = 'https://ci-artifactory.corda.r3cev.com/artifactory'
artifactory_plugin_version = constants.getProperty('artifactoryPluginVersion')
proguard_version = constants.getProperty("proguardVersion")
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
url "$artifactory_contextUrl/corda-dev"
}
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:$artifactory_plugin_version"
classpath "net.sf.proguard:proguard-gradle:$proguard_version"
}
}
plugins {
id 'base'
id 'maven-publish'
}
apply plugin: 'com.jfrog.artifactory'
/*
* This is a nested and independent Gradle project,
* and so has its own group and version.
*
* NOTE: The deterministic APIs are Open Source.
*/
group 'net.corda'
version '1.0-SNAPSHOT'
task cleanJdk(type: Exec) {
commandLine 'make', 'clean'
}
task makeJdk(type: Exec) {
// See: https://github.com/corda/openjdk/tree/deterministic-jvm8
commandLine 'make'
}
task runtimeJar(type: Jar, dependsOn: makeJdk) {
baseName 'deterministic-rt'
inputs.dir "libs"
from(zipTree("libs/rt.jar"))
from(zipTree("libs/jce.jar"))
from(zipTree("libs/jsse.jar"))
reproducibleFileOrder = true
includeEmptyDirs = false
}
import proguard.gradle.ProGuardTask
task validate(type: ProGuardTask) {
injars runtimeJar
dontwarn 'java.lang.invoke.**'
dontwarn 'javax.lang.model.**'
dontwarn 'jdk.Exported'
keepattributes '*'
dontpreverify
dontobfuscate
dontoptimize
verbose
keep 'class *'
}
runtimeJar.finalizedBy validate
task apiJar(type: Jar, dependsOn: runtimeJar) {
baseName 'deterministic-rt'
classifier 'api'
from(zipTree(runtimeJar.outputs.files.singleFile)) {
include 'java/'
include 'javax/'
exclude 'java/awt/'
exclude 'java/beans/Weak*.class'
exclude 'java/lang/invoke/'
exclude 'java/lang/*Thread*.class'
exclude 'java/lang/Shutdown*.class'
exclude 'java/lang/ref/'
exclude 'java/lang/reflect/InvocationHandler.class'
exclude 'java/lang/reflect/Proxy*.class'
exclude 'java/lang/reflect/Weak*.class'
exclude 'java/io/File.class'
exclude 'java/io/File$*.class'
exclude 'java/io/*FileSystem.class'
exclude 'java/io/Filename*.class'
exclude 'java/io/FileDescriptor*.class'
exclude 'java/io/FileFilter*.class'
exclude 'java/io/FilePermission*.class'
exclude 'java/io/FileReader*.class'
exclude 'java/io/FileSystem*.class'
exclude 'java/io/File*Stream*.class'
exclude 'java/net/*Content*.class'
exclude 'java/net/Host*.class'
exclude 'java/net/Inet*.class'
exclude 'java/nio/file/Path.class'
exclude 'java/nio/file/attribute/'
exclude 'java/util/SplittableRandom*.class'
exclude 'java/util/Random.class'
exclude 'java/util/Random$*.class'
exclude 'java/util/WeakHashMap*.class'
exclude 'java/util/concurrent/*.class'
exclude 'java/util/concurrent/locks/'
exclude 'javax/activation/'
}
preserveFileTimestamps = false
reproducibleFileOrder = true
includeEmptyDirs = false
}
defaultTasks "build"
assemble.dependsOn runtimeJar
assemble.dependsOn apiJar
clean.dependsOn cleanJdk
artifacts {
archives runtimeJar
archives apiJar
}
artifactory {
contextUrl = artifactory_contextUrl
publish {
repository {
repoKey = 'corda-dev'
username = System.getenv('CORDA_ARTIFACTORY_USERNAME')
password = System.getenv('CORDA_ARTIFACTORY_PASSWORD')
maven = true
}
defaults {
publications('mavenJava')
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId 'deterministic-rt'
artifact runtimeJar
artifact apiJar
}
}
}
task install(dependsOn: publishToMavenLocal)