-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
128 lines (112 loc) · 3.15 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'checkstyle'
id 'jacoco'
id 'com.github.ben-manes.versions' version '0.38.0'
id 'com.autonomousapps.dependency-analysis' version '0.71.0'
id 'dev.jacomet.logging-capabilities' version '0.9.0'
id 'io.github.gradle-nexus.publish-plugin' version '1.0.0'
}
repositories {
// mavenLocal()
mavenCentral()
}
dependencies {
api 'com.github.junrar:junrar:7.4.0'
api 'org.apache.commons:commons-vfs2:2.8.0'
implementation 'org.slf4j:slf4j-api:1.7.30'
testRuntimeOnly 'ch.qos.logback:logback-classic:1.2.3'
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
testImplementation 'commons-io:commons-io:2.8.0'
testImplementation 'org.assertj:assertj-core:3.19.0'
}
group = 'com.github.junrar'
description = 'Apache Commons VFS RAR provider'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'Java Unrar'
description = "${description}"
url = 'https://github.com/junrar/junrar'
licenses {
license {
name = 'MIT License'
url = 'https://github.com/junrar/commons-vfs-rar/LICENSE'
}
}
developers {
developer {
id = 'gotson'
name = 'Gauthier Roebroeck'
}
}
scm {
url = 'https://github.com/junrar/commons-vfs-rar.git'
}
}
}
}
repositories {
mavenLocal()
}
}
signing {
def signingKey = findProperty('signingKey')
def signingPassword = findProperty('signingPassword')
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
nexusPublishing {
repositories {
sonatype()
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.wrapper {
gradleVersion = '6.8.3'
distributionType = Wrapper.DistributionType.ALL
}
test {
useJUnitPlatform()
}
checkstyle {
configFile = file("${rootDir}/checkstyle.xml")
toolVersion = '8.29'
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
// disallow release candidates as upgradable versions from stable versions
rejectVersionIf {
isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)
}
}