Skip to content
Merged
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
47 changes: 46 additions & 1 deletion build-extras.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,49 @@ test {
showExceptions true
showCauses true
}
}
}

// Maven Central limits how much a namespace can release each month, and every
// regeneration releases. These keep each release smaller without changing the
// API. Speakeasy never overwrites this file; it overwrites build.gradle.

// The full javadoc was half of every release. Maven Central accepts a placeholder
// javadoc jar, so ship one page that links to the docs in the repo. IDEs read
// the sources jar for documentation.
def sdkVersion = version
javadoc {
actions = []
inputs.property("sdkVersion", sdkVersion)
doLast {
def site = "https://github.com/gr4vy/gr4vy-java/tree/v${sdkVersion}"
destinationDir.deleteDir()
destinationDir.mkdirs()
new File(destinationDir, "index.html").text = """<!DOCTYPE html>
<html lang="en">
<head><meta charset="utf-8"><title>Gr4vy Java SDK ${sdkVersion}</title></head>
<body>
<h1>Gr4vy Java SDK ${sdkVersion}</h1>
<p>The reference for every class and method is in the SDK repository.</p>
<ul>
<li><a href="${site}#readme">README and usage</a></li>
<li><a href="${site}/docs">SDK and model reference</a></li>
<li><a href="https://docs.gr4vy.com">Gr4vy documentation</a></li>
</ul>
</body>
</html>
"""
new File(destinationDir, "README.md").text = """# Gr4vy Java SDK ${sdkVersion}

The reference for every class and method is in the SDK repository:

- README and usage: ${site}#readme
- SDK and model reference: ${site}/docs
- Gr4vy documentation: https://docs.gr4vy.com
"""
}
}

// Keep file names and line numbers for stack traces; drop local variable tables.
tasks.withType(JavaCompile).configureEach {
options.debugOptions.debugLevel = "source,lines"
}
Loading