Skip to content

Commit

Permalink
Fix publish script (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnasNaouchi authored Jul 12, 2024
1 parent 1815ca1 commit 85fe55f
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ distributions {
}
}

signing {
def signingKey = System.getenv("PGP_SIGNING_KEY")
def signingPwd = System.getenv("PGP_SIGNING_PASSWORD")

useInMemoryPgpKeys(signingKey, signingPwd)

sign configurations.archives
}

javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
Expand All @@ -60,9 +51,9 @@ javadoc {
// REF: https://docs.gradle.org/current/userguide/publishing_maven.html
publishing {
publications {
shadow(MavenPublication) {
release(MavenPublication) {
publication ->
project.shadow.component(publication)
artifact jar
artifactId = 'omise-java'
artifact sourcesJar
artifact javadocJar
Expand Down Expand Up @@ -91,6 +82,17 @@ publishing {
email = 'support@omise.co'
}
}
withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.implementation.allDependencies.each {
if (it.group != null && (it.name != null || "unspecified" == it.name) && it.version != null) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}
Expand All @@ -108,6 +110,14 @@ publishing {
}
}

signing {
def signingKey = System.getenv("PGP_SIGNING_KEY")
def signingPwd = System.getenv("PGP_SIGNING_PASSWORD")

useInMemoryPgpKeys(signingKey, signingPwd)
sign publishing.publications.release
}

/**
* {@link Package#getImplementationVersion()} on IDE will alway return `null`
* because this method read data from `META-INF/MANIFEST.MF` that contain in `.jar`.
Expand Down

0 comments on commit 85fe55f

Please sign in to comment.