1
+
2
+ configure(rootProject) {
3
+ ext {
4
+ published = [
5
+ " :hppc" ,
6
+ ]
7
+ }
8
+
9
+ configure(subprojects. findAll { it. path in rootProject. published }) {
10
+ apply plugin : ' maven-publish'
11
+ apply plugin : ' signing'
12
+
13
+ tasks. withType(GenerateModuleMetadata ) {
14
+ enabled = false
15
+ }
16
+
17
+ plugins. withType(JavaPlugin ) {
18
+ publishing {
19
+ repositories {
20
+ maven {
21
+ name = ' sonatype'
22
+ url " https://oss.sonatype.org/service/local/staging/deploy/maven2"
23
+
24
+ credentials {
25
+ if (project. hasProperty(' nexusUsername' )) {
26
+ username project. nexusUsername
27
+ }
28
+ if (project. hasProperty(' nexusPassword' )) {
29
+ password project. nexusPassword
30
+ }
31
+ }
32
+ }
33
+ }
34
+ }
35
+
36
+ task sourcesJar(type : Jar , dependsOn : classes) {
37
+ archiveClassifier = ' sources'
38
+ from sourceSets. main. allJava
39
+ }
40
+
41
+ task javadocJar(type : Jar , dependsOn : javadoc) {
42
+ archiveClassifier = ' javadoc'
43
+ from javadoc. destinationDir
44
+ }
45
+
46
+ publishing {
47
+ def configurePom = {
48
+ name = " High Performance Primitive Collections"
49
+ url = " https://github.com/carrotsearch/hppc"
50
+ description = " High Performance Primitive Collections: " +
51
+ " data structures (maps, sets, lists, stacks, queues) generated " +
52
+ " for combinations of object and primitive types to conserve JVM " +
53
+ " memory and speed up execution."
54
+
55
+ licenses {
56
+ license {
57
+ name = ' Apache 2'
58
+ url = ' http://www.apache.org/licenses/LICENSE-2.0.txt'
59
+ }
60
+ }
61
+ }
62
+
63
+ publications {
64
+ signed(MavenPublication ) {
65
+ from components. java
66
+ groupId = project. group
67
+ artifactId = project. archivesBaseName
68
+
69
+ artifact sourcesJar
70
+ artifact javadocJar
71
+
72
+ pom(configurePom)
73
+ }
74
+ }
75
+ }
76
+
77
+ signing {
78
+ sign publishing. publications. signed
79
+ }
80
+ }
81
+ }
82
+ }
0 commit comments