|
15 | 15 |
|
16 | 16 | plugins { |
17 | 17 | id 'java-library' |
| 18 | + id 'maven-publish' |
| 19 | + id 'com.jfrog.artifactory' version '5.2.3' |
18 | 20 | } |
19 | 21 |
|
20 | 22 | dependencies { |
21 | 23 | implementation 'net.java.dev.jna:jna:5.12.1' |
22 | 24 | } |
23 | 25 | jar { |
24 | | - archiveBaseName = 'common' |
| 26 | + archiveBaseName = 'besu-native-common' |
25 | 27 | includeEmptyDirs = false |
26 | 28 | manifest { |
27 | 29 | attributes( |
|
34 | 36 | } |
35 | 37 | } |
36 | 38 |
|
| 39 | + |
| 40 | +task sourcesJar(type: Jar, dependsOn: classes) { |
| 41 | + archiveBaseName = 'besu-native-common' |
| 42 | + archiveClassifier = 'sources' |
| 43 | + from sourceSets.main.allSource |
| 44 | +} |
| 45 | + |
| 46 | +task javadocJar(type: Jar, dependsOn: javadoc) { |
| 47 | + archiveBaseName = 'besu-native-common' |
| 48 | + archiveClassifier = 'javadoc' |
| 49 | + from javadoc.destinationDir |
| 50 | +} |
| 51 | + |
| 52 | +publishing { |
| 53 | + publications { |
| 54 | + mavenJava(MavenPublication) { |
| 55 | + groupId "org.hyperledger.besu" |
| 56 | + artifactId 'besu-native-common' |
| 57 | + version "${project.version}" |
| 58 | + |
| 59 | + from components.java |
| 60 | + artifact sourcesJar |
| 61 | + artifact javadocJar |
| 62 | + |
| 63 | + pom { |
| 64 | + name = "Besu Native - ${project.name}" |
| 65 | + description = 'Shared lib for besu-native implementations' |
| 66 | + url = 'http://github.com/hyperledger/besu-native' |
| 67 | + licenses { |
| 68 | + license { |
| 69 | + name = 'The Apache License, Version 2.0' |
| 70 | + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 71 | + } |
| 72 | + } |
| 73 | + scm { |
| 74 | + connection = 'scm:git:git://github.com/hyperledger/besu-native.git' |
| 75 | + developerConnection = 'scm:git:ssh://github.com/hyperledger/besu-native.git' |
| 76 | + url = 'https://github.com/hyperledger/besu-native' |
| 77 | + } |
| 78 | + } |
| 79 | + } |
| 80 | + } |
| 81 | +} |
| 82 | + |
| 83 | +def artifactoryUser = project.hasProperty('artifactoryUser') ? project.property('artifactoryUser') : System.getenv('ARTIFACTORY_USER') |
| 84 | +def artifactoryKey = project.hasProperty('artifactoryApiKey') ? project.property('artifactoryApiKey') : System.getenv('ARTIFACTORY_KEY') |
| 85 | +def artifactoryRepo = System.getenv('ARTIFACTORY_REPO') ?: 'besu-maven' |
| 86 | +def artifactoryOrg = System.getenv('ARTIFACTORY_ORG') ?: 'hyperledger' |
| 87 | + |
| 88 | +artifactory { |
| 89 | + contextUrl = "https://hyperledger.jfrog.io/${artifactoryOrg}" |
| 90 | + publish { |
| 91 | + repository { |
| 92 | + repoKey = artifactoryRepo |
| 93 | + username = artifactoryUser |
| 94 | + password = artifactoryKey |
| 95 | + } |
| 96 | + defaults { |
| 97 | + publications('mavenJava') |
| 98 | + publishArtifacts = true |
| 99 | + publishPom = true |
| 100 | + } |
| 101 | + } |
| 102 | +} |
0 commit comments