-
Notifications
You must be signed in to change notification settings - Fork 206
/
build.gradle
99 lines (81 loc) · 2.48 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
/*
* Copyright IBM Corp. 2018 All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
plugins {
id "com.github.ben-manes.versions" version "0.51.0"
id "com.diffplug.spotless" version "6.25.0"
}
version = '2.5.6'
// 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 {
apply plugin: "com.diffplug.spotless"
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://www.jitpack.io" }
}
spotless {
format 'misc', {
target '*.gradle', '.gitattributes', '.gitignore'
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
}
}
subprojects {
apply plugin: 'java'
apply plugin: "maven-publish"
group = 'org.hyperledger.fabric-chaincode-java'
version = rootProject.version
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
compileJava {
if (javaCompiler.get().metadata.languageVersion.canCompileOrRun(10)) {
options.release = 11
}
}
dependencies {
implementation 'commons-cli:commons-cli:1.9.0'
implementation 'commons-logging:commons-logging:1.3.4'
testImplementation platform('org.junit:junit-bom:5.11.3')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'org.assertj:assertj-core:3.26.3'
testImplementation 'org.mockito:mockito-core:5.14.2'
testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.1.7'
testImplementation 'org.hamcrest:hamcrest-library:3.0'
}
test {
useJUnitPlatform()
}
spotless {
java {
removeUnusedImports()
palantirJavaFormat('2.50.0').formatJavadoc(true)
formatAnnotations()
}
}
}
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
}