forked from hyperledger/fabric-chaincode-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
80 lines (64 loc) · 2.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
/*
* Copyright IBM Corp. 2018 All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
apply plugin: 'idea'
apply plugin: 'eclipse-wtp'
version = '2.4.1'
// If the nightly property is set, then this is the scheduled main
// build - and we should publish this to artifactory
//
// Use the .dev.<number> format to match Maven convention
if (properties.containsKey('NIGHTLY')) {
version = version + '.dev.' + getDate()
ext.nightly = true // set property for use in subprojects
} else {
ext.nightly = false
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://www.jitpack.io" }
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
group = 'org.hyperledger.fabric-chaincode-java'
version = rootProject.version
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
implementation group: 'commons-cli', name: 'commons-cli', version: '1.4'
implementation group: 'commons-logging', name: 'commons-logging', version: '1.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.3.1'
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.3.1'
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '1.3'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '2.23.0'
testImplementation group: 'com.github.stefanbirkner', name: 'system-rules', version: 'system-rules-1.17.0'
testCompileOnly group: 'junit', name: 'junit', version: '4.12'
testRuntimeOnly group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.3.1'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.9.1'
}
if (!it.name.equals('fabric-chaincode-protos')) {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all,-try"
}
}
test {
useJUnitPlatform()
}
}
task printVersionName() {
println rootProject.version
}
// Get the date in the reverse format for sorting
def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMdd')
return formattedDate
}