Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the issue of javadocJar not including documentation & Publish sourcesJar to the GitHub Release page. #544

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
As this project is pre 1.0, breaking changes may happen for minor version bumps. A breaking change will get clearly notified in this log.

## Pending
* Fix the issue of javadocJar not including documentation. ([#539](https://github.com/stellar/java-stellar-sdk/pull/539))
* Publish sourcesJar to the GitHub Release page. ([#539](https://github.com/stellar/java-stellar-sdk/pull/539))

## 0.41.0
* Add support for Soroban Preview 11. ([#530](https://github.com/stellar/java-stellar-sdk/pull/530))
Expand Down
34 changes: 23 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ tasks {
archiveFileName = "stellar-sdk.jar"
}

val sourcesJar by creating(Jar::class) {
manifest {
attributes["Implementation-Title"] = "stellar-sdk"
attributes["Implementation-Version"] = version
}
archiveClassifier = "sources"
archiveFileName = "stellar-sdk-sources.jar"
from(sourceSets.main.get().allSource)
}

val uberJar by creating(Jar::class) {
// https://docs.gradle.org/current/userguide/working_with_files.html#sec:creating_uber_jar_example
manifest {
Expand All @@ -73,17 +83,6 @@ tasks {
})
}

val javadocJar by creating(Jar::class) {
manifest {
attributes["Implementation-Title"] = "stellar-sdk"
attributes["Implementation-Version"] = version
}
archiveClassifier = "javadoc"
archiveFileName = "stellar-sdk-javadoc.jar"
dependsOn(javadoc)
from(javadoc.get().destinationDir)
}

javadoc {
destinationDir = file("javadoc")
isFailOnError = false
Expand All @@ -97,6 +96,17 @@ tasks {
}
}

val javadocJar by creating(Jar::class) {
manifest {
attributes["Implementation-Title"] = "stellar-sdk"
attributes["Implementation-Version"] = version
}
archiveClassifier = "javadoc"
archiveFileName = "stellar-sdk-javadoc.jar"
dependsOn(javadoc)
from(javadoc.get().destinationDir) // It needs to be placed after the javadoc task, otherwise it cannot read the path we set.
}

register<Copy>("updateGitHook") {
from("scripts/pre-commit.sh") { rename { it.removeSuffix(".sh") } }
into(".git/hooks")
Expand All @@ -118,6 +128,7 @@ artifacts {
archives(tasks.jar)
archives(tasks["uberJar"])
archives(tasks["javadocJar"])
archives(tasks["sourcesJar"])
}

publishing {
Expand All @@ -126,6 +137,7 @@ publishing {
from(components["java"])
artifact(tasks["uberJar"])
artifact(tasks["javadocJar"])
artifact(tasks["sourcesJar"])
pom {
name.set("java-stellar-sdk")
description.set("The Java Stellar SDK library provides APIs to build transactions and connect to Horizon and Soroban-RPC server.")
Expand Down
Loading