|
| 1 | +package publishing |
| 2 | + |
| 3 | +configure(rootProject) { |
| 4 | + ext { |
| 5 | + published = [ |
| 6 | + ":hppc", |
| 7 | + ] |
| 8 | + } |
| 9 | + |
| 10 | + configure(subprojects.findAll { it.path in rootProject.published }) { |
| 11 | + apply plugin: 'maven-publish' |
| 12 | + apply plugin: 'signing' |
| 13 | + |
| 14 | + tasks.withType(GenerateModuleMetadata) { |
| 15 | + enabled = false |
| 16 | + } |
| 17 | + |
| 18 | + plugins.withType(JavaPlugin) { |
| 19 | + publishing { |
| 20 | + repositories { |
| 21 | + maven { |
| 22 | + name = 'sonatype' |
| 23 | + url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2" |
| 24 | + |
| 25 | + credentials { |
| 26 | + if (project.hasProperty('nexusUsername')) { |
| 27 | + username project.nexusUsername |
| 28 | + } |
| 29 | + if (project.hasProperty('nexusPassword')) { |
| 30 | + password project.nexusPassword |
| 31 | + } |
| 32 | + } |
| 33 | + } |
| 34 | + } |
| 35 | + } |
| 36 | + |
| 37 | + task sourcesJar(type: Jar, dependsOn: classes) { |
| 38 | + archiveClassifier = 'sources' |
| 39 | + from sourceSets.main.allJava |
| 40 | + } |
| 41 | + |
| 42 | + task javadocJar(type: Jar, dependsOn: javadoc) { |
| 43 | + archiveClassifier = 'javadoc' |
| 44 | + from javadoc.destinationDir |
| 45 | + } |
| 46 | + |
| 47 | + publishing { |
| 48 | + def configurePom = { |
| 49 | + name = "High Performance Primitive Collections" |
| 50 | + url = "https://github.com/carrotsearch/hppc" |
| 51 | + description = "High Performance Primitive Collections: " + |
| 52 | + "data structures (maps, sets, lists, stacks, queues) generated " + |
| 53 | + "for combinations of object and primitive types to conserve JVM " + |
| 54 | + "memory and speed up execution." |
| 55 | + |
| 56 | + licenses { |
| 57 | + license { |
| 58 | + name = 'Apache 2' |
| 59 | + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 60 | + } |
| 61 | + } |
| 62 | + |
| 63 | + organization { |
| 64 | + name = "Carrot Search s.c." |
| 65 | + url = "https://www.carrotsearch.com" |
| 66 | + } |
| 67 | + |
| 68 | + developers { |
| 69 | + developer { |
| 70 | + id = 'stanislaw.osinski' |
| 71 | + name = 'Stanisław Osiński' |
| 72 | + |
| 73 | + } |
| 74 | + developer { |
| 75 | + id = 'dawid.weiss' |
| 76 | + name = 'Dawid Weiss' |
| 77 | + |
| 78 | + } |
| 79 | + developer { |
| 80 | + id = 'bruno.roustant' |
| 81 | + name = 'Bruno Roustant' |
| 82 | + |
| 83 | + } |
| 84 | + } |
| 85 | + |
| 86 | + scm { |
| 87 | + connection = 'scm:git:[email protected]:carrotsearch/hppc.git' |
| 88 | + developerConnection = 'scm:git:[email protected]:carrotsearch/hppc.git' |
| 89 | + url = 'https://github.com/carrotsearch/hppc' |
| 90 | + } |
| 91 | + } |
| 92 | + |
| 93 | + publications { |
| 94 | + signed(MavenPublication) { |
| 95 | + from components.java |
| 96 | + groupId = project.group |
| 97 | + artifactId = project.archivesBaseName |
| 98 | + |
| 99 | + artifact sourcesJar |
| 100 | + artifact javadocJar |
| 101 | + |
| 102 | + pom(configurePom) |
| 103 | + } |
| 104 | + } |
| 105 | + } |
| 106 | + |
| 107 | + signing { |
| 108 | + sign publishing.publications.signed |
| 109 | + } |
| 110 | + } |
| 111 | + } |
| 112 | +} |
0 commit comments