diff --git a/build-extras.gradle b/build-extras.gradle index 06746da4..714d242c 100644 --- a/build-extras.gradle +++ b/build-extras.gradle @@ -11,4 +11,49 @@ test { showExceptions true showCauses true } -} \ No newline at end of file +} + +// 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 = """ + +Gr4vy Java SDK ${sdkVersion} + +

Gr4vy Java SDK ${sdkVersion}

+

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

+ + + +""" + 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" +}