-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
151 lines (137 loc) · 5.02 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}
group = 'com.perforce'
version = project.hasProperty('ver') ? project.ext.ver : 'PREP-TEST_ONLY'
sourceCompatibility = 11
targetCompatibility = 11
repositories {
maven { url "https://repo.maven.apache.org/maven2" }
maven { url "https://artifactory.bnr.perforce.com/artifactory/snapshots/" }
}
dependencies {
api 'com.jcraft:jzlib:1.1.3'
api 'org.apache.commons:commons-lang3:3.12.0'
api 'commons-codec:commons-codec:1.15'
api 'commons-io:commons-io:2.11.0'
api 'com.google.code.findbugs:jsr305:3.0.2'
testImplementation 'org.slf4j:slf4j-api:1.7.36'
testImplementation 'org.slf4j:slf4j-simple:1.7.36'
testImplementation 'org.apache.commons:commons-exec:1.3'
testImplementation 'org.apache.commons:commons-compress:1.21'
testImplementation 'junit:junit:4.13.1'
testImplementation 'org.mockito:mockito-core:4.0.0'
testImplementation 'com.googlecode.java-diff-utils:diffutils:1.3.0'
}
jar {
into("META-INF/maven/$project.group/$project.name") {
from { generatePomFileForMavenJavaPublication }
rename ".*", "pom.xml"
}
manifest {
attributes["Name"] = "com/perforce/p4java/"
attributes["Main-Class"] = "com.perforce.p4java.Metadata"
attributes["Implementation-Title"] = "p4java"
attributes["Implementation-Version"] = archiveVersion
attributes["Implementation-Vendor-Id"] = "com.perforce"
attributes["Implementation-Vendor"] = "Perforce Software"
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'Perforce Java API'
description = 'P4Java, the Perforce Java API is a Java-native API for accessing Perforce SCM services from within Java'
url = 'https://github.com/perforce/p4java'
organization {
name = 'Perforce Software'
url = 'http://www.perforce.com'
}
licenses {
license {
name = 'Perforce Software'
url = 'https://www.perforce.com/perforce/doc.current/user/p4java_eula.txt'
}
}
developers {
developer {
id = 'p4java'
name = 'Perforce Software'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:https://github.com/perforce/p4java.git'
developerConnection = 'scm:git:https://github.com/perforce/p4java.git'
url = 'https://github.com/perforce/p4java'
}
}
}
}
repositories {
def mavenUser = project.hasProperty('mavenUser') ? project.ext.mavenUser : ''
def mavenPassword = project.hasProperty('mavenPassword') ? project.ext.mavenPassword : ''
def artifactoryUser = project.hasProperty('artifactoryUser') ? project.ext.artifactoryUser : ''
def artifactoryPassword = project.hasProperty('artifactoryPassword') ? project.ext.artifactoryPassword : ''
def mavenStagingUrl = project.hasProperty('mavenStagingUrl') ? project.ext.mavenStagingUrl : ''
def artifactorySnapshotUrl = project.hasProperty('artifactorySnapshotUrl') ? project.ext.artifactorySnapshotUrl : ''
def artifactoryReleaseUrl = project.hasProperty('artifactoryReleaseUrl') ? project.ext.artifactoryReleaseUrl : ''
maven {
name = 'p4mavencentral-staging'
url = mavenStagingUrl
credentials {
username = mavenUser
password = mavenPassword
}
}
maven {
name = 'artifactory-snapshots'
url = artifactorySnapshotUrl
credentials {
username = artifactoryUser
password = artifactoryPassword
}
}
maven {
name = 'artifactory-release'
url = artifactoryReleaseUrl
credentials {
username = artifactoryUser
password = artifactoryPassword
}
}
}
}
java {
withSourcesJar()
withJavadocJar()
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
tasks.withType(Javadoc) {
(options as StandardJavadocDocletOptions).addStringOption("Xmaxwarns", "500")
(options as StandardJavadocDocletOptions).addStringOption("Xmaxerrs", "500")
}
// Report lint check details
tasks.withType(JavaCompile) {
options.compilerArgs.add("-Xlint:deprecation")
options.compilerArgs.add("-Xlint:unchecked")
}
signing {
sign publishing.publications
}