Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
109 lines (90 loc) · 2.49 KB
/
Copy pathbuild.gradle
File metadata and controls
109 lines (90 loc) · 2.49 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
101
102
103
104
105
106
107
108
109
/*
* Copyright IBM Corp. 2018 All Rights Reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
plugins {
alias(libs.plugins.spotless)
alias(libs.plugins.nmcp.aggregation)
alias(libs.plugins.nmcp) apply false
}
version = '2.5.12'
// 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'))
}
dependencyUpdates {
checkConstraints = true
gradleReleaseChannel = 'current'
rejectPreReleases = true
revision = 'release'
}
allprojects {
apply(plugin: libs.plugins.spotless.get().pluginId)
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(libs.commons.cli)
implementation(libs.commons.logging)
testImplementation platform(libs.junit.bom)
testImplementation(libs.junit.jupiter)
testRuntimeOnly(libs.junit.platform.launcher)
testImplementation(libs.assertj)
testImplementation(libs.mockito.core)
testImplementation(libs.system.stubs.jupiter)
testImplementation(libs.hamcrest)
}
test {
useJUnitPlatform()
}
spotless {
java {
forbidWildcardImports()
formatAnnotations()
palantirJavaFormat().formatJavadoc(true)
removeUnusedImports()
shortenFullyQualifiedTypes()
}
}
}
// Get the date in the reverse format for sorting
static def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMdd')
return formattedDate
}