-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjcomponent.gradle
111 lines (88 loc) · 2.48 KB
/
jcomponent.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
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply from: rootProject.file('dependencies.gradle')
apply from: rootProject.file('extras.gradle')
sourceCompatibility = JavaVersion.VERSION_1_8
dependencies {
implementation slf4jApi()
testImplementation junit()
testImplementation mockito()
testImplementation hamcrest()
}
test {
useJUnitPlatform()
testLogging {
events "failed"
exceptionFormat "full"
showStackTraces true
}
}
jar {
archiveBaseName.set(project.name)
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveBaseName.set(project.name)
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveBaseName.set(project.name)
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
build.finalizedBy sourcesJar, javadocJar
publishing {
publications {
mavenFlashlib(MavenPublication) {
def projectName = project.name
from components.java
artifact sourcesJar
artifact javadocJar
artifactId = projectName
pom {
name = projectName
description = "Robotics development framework (${projectName})"
url = POM_URL
licenses {
license {
name = POM_LICENSE_NAME
url = POM_LICENSE_URL
}
}
developers {
developer {
id = POM_DEVELOPER_ID
name = POM_DEVELOPER_NAME
email = POM_DEVELOPER_MAIL
}
}
scm {
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEV_CONNECTION
url = POM_URL
}
}
}
}
repositories {
maven {
if (isReleaseBuild()) {
name = 'NexusStaging'
url = NEXUS_RELEASE_REPOSITORY_URL
} else {
name = 'NexusSnapshot'
url = NEXUS_SNAPSHOT_REPOSITORY_URL
}
credentials {
username getNexusUsername()
password getNexusPassword()
}
}
}
}
if (shouldSign()) {
signing {
sign publishing.publications.mavenFlashlib
}
}