forked from OmniLayer/OmniJ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
170 lines (139 loc) · 5.32 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
161
162
163
164
165
166
167
168
169
170
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'application'
apply plugin: 'maven'
sourceCompatibility = 1.7
group = 'com.msgilligan'
version = '0.2'
repositories {
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/'}
}
configurations {
// jansi configuration is a workaround for a broken transitive dependency
// See: http://forums.gradle.org/gradle/topics/gradle_task_groovydoc_failing_with_noclassdeffounderror
jansi.extendsFrom(runtime)
robovm
}
dependencies {
compile 'com.fasterxml.jackson.core:jackson-core:2.3.2'
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.3'
compile 'commons-cli:commons-cli:1.2'
robovm 'org.codehaus.groovy:groovy:2.4.0-rc-1:grooid'
compile 'org.codehaus.groovy:groovy:2.4.0-rc-1'
compile 'org.codehaus.groovy:groovy-json:2.4.0-rc-1'
compile 'org.codehaus.groovy:groovy-sql:2.4.0-rc-1'
compile 'org.codehaus.groovy:groovy-ant:2.4.0-rc-1' // used in Groovy doc
compile 'com.google:bitcoinj:0.11.3'
compile 'org.postgresql:postgresql:9.3-1102-jdbc41'
jansi 'org.fusesource.jansi:jansi:1.11'
testCompile("org.spockframework:spock-core:1.0-groovy-2.3-SNAPSHOT") {
exclude module: "groovy-all"
}
}
//compileJava {
// options.compilerArgs << '-Xlint:unchecked'
//}
mainClassName = "com.msgilligan.bitcoin.cli.Status"
def roboExeName = "btcstatus"
jar {
manifest {
attributes 'Implementation-Title': 'BTC/MSC Status', 'Implementation-Version': version, 'Consensus-Class': mainClassName
}
}
test {
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
}
def homePath = System.properties['user.home']
def roboVMHome = "${homePath}/robovm-0.0.14"
def roboLibPath = "robolib"
task copyToRoboLib(type: Copy) {
into roboLibPath
from configurations.runtime
}
task roboCompile(type:Exec, dependsOn: [classes, copyToRoboLib]) {
executable "${roboVMHome}/bin/robovm"
args '-verbose', '-debug',
'-cp', "build/classes/main:${roboLibPath}/commons-cli-1.2.jar:${roboLibPath}/jackson-core-2.3.3.jar:${roboLibPath}/jackson-databind-2.3.3.jar:${roboLibPath}/jackson-annotations-2.3.0.jar",
'-d', 'build',
'-forcelinkclasses', 'com.android.okhttp.HttpHandler:com.android.org.conscrypt.OpenSSLSocketFactoryImpl',
'-o', "${roboExeName}",
"${mainClassName}"
}
task roboRun(type:Exec, dependsOn: roboCompile) {
executable "build/${roboExeName}"
args '-rvm:log=debug'
}
// Test Structure
sourceSets {
integrationTest {
compileClasspath = sourceSets.main.output + configurations.testRuntime
runtimeClasspath = output + sourceSets.main.output + configurations.testRuntime
java {
srcDir 'src/integ/java'
}
groovy {
srcDir 'src/integ/groovy'
}
resources {
srcDir 'src/integ/resources'
}
}
}
task integrationTest(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
testLogging.showStandardStreams = true
}
task regTest(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
testLogging.showStandardStreams = true
systemProperty 'regtest', true
// include 'org/mastercoin/test/rpc/**', 'com/msgilligan/bitcoin/rpc/**', 'com/msgilligan/bitcoinj/**'
include 'org/mastercoin/test/rpc/**', 'com/msgilligan/bitcoin/rpc/**'
}
task regTestBTC(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
testLogging.showStandardStreams = true
systemProperty 'regtest', true
include 'com/msgilligan/bitcoin/rpc/**'
}
task consensusTest(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
testLogging.showStandardStreams = true
systemProperty 'regtest', false
include 'org/mastercoin/test/consensus/**'
}
groovydoc {
// Create GroovyDoc for Groovy + Java classes
source = sourceSets.main.groovy + sourceSets.main.java
overview = "src/main/java/overview.html"
groovyClasspath = project.configurations.jansi
}
def currencyID = 1
task getMasterConsensus(dependsOn: 'classes', type: JavaExec) {
main = 'org.mastercoin.consensus.MasterCoreConsensusTool'
args = [currencyID, 'build/mastercore_consensus.txt']
classpath = sourceSets.main.runtimeClasspath
}
task getOmniConsensus(dependsOn: 'classes', type: JavaExec) {
main = 'org.mastercoin.consensus.OmniwalletConsensusTool'
args = [currencyID, 'build/omniwallet_consensus.txt']
classpath = sourceSets.main.runtimeClasspath
}
task getChestConsensus(dependsOn: 'classes', type: JavaExec) {
main = 'org.mastercoin.consensus.ChestConsensusTool'
args = [currencyID, 'build/chest_consensus.txt']
classpath = sourceSets.main.runtimeClasspath
}
task getConsensus(dependsOn: ['getMasterConsensus', 'getOmniConsensus', 'getChestConsensus']) << {
println "Consensus files are in build/*_consensus.txt"
}