-
Notifications
You must be signed in to change notification settings - Fork 211
Expand file tree
/
Copy pathbuild.gradle
More file actions
100 lines (83 loc) · 2.51 KB
/
build.gradle
File metadata and controls
100 lines (83 loc) · 2.51 KB
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
/*
* Copyright IBM Corp. 2018 All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
plugins {
id "com.github.ben-manes.versions" version "0.53.0"
id "com.diffplug.spotless" version "8.1.0"
id "com.gradleup.nmcp.aggregation" version "1.4.3"
id "com.gradleup.nmcp" version "1.4.3" apply false
}
version = '2.5.9'
// 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
}
nmcpAggregation {
centralPortal {
username = findProperty('mavenCentralUsername')
password = findProperty('mavenCentralPassword')
publishingType = "AUTOMATIC"
}
}
dependencies {
nmcpAggregation(project(':fabric-chaincode-shim'))
}
allprojects {
apply plugin: "com.diffplug.spotless"
repositories {
mavenCentral()
}
spotless {
format 'misc', {
target '*.gradle', '.gitattributes', '.gitignore'
trimTrailingWhitespace()
leadingTabsToSpaces()
endWithNewline()
}
}
}
subprojects {
apply plugin: 'java'
apply plugin: "maven-publish"
group = 'org.hyperledger.fabric-chaincode-java'
version = rootProject.version
compileJava {
options.release = 11
options.compilerArgs += ['-Werror', '-Xlint:all']
}
dependencies {
implementation 'commons-cli:commons-cli:1.11.0'
implementation 'commons-logging:commons-logging:1.3.5'
testImplementation platform('org.junit:junit-bom:6.0.2')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'org.assertj:assertj-core:3.27.7'
testImplementation 'org.mockito:mockito-core:5.21.0'
testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.1.8'
testImplementation 'org.hamcrest:hamcrest-library:3.0'
}
test {
useJUnitPlatform()
}
spotless {
java {
removeUnusedImports()
palantirJavaFormat().formatJavadoc(true)
formatAnnotations()
}
}
}
// Get the date in the reverse format for sorting
static def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMdd')
return formattedDate
}