From 25c8d741d59c6997e7a60ec627825a76dc3c7ef3 Mon Sep 17 00:00:00 2001 From: Cristiano Betta Date: Fri, 4 Dec 2026 14:52:36 +0000 Subject: [PATCH 1/3] build: make each Maven Central release smaller Trim the javadoc jar (no tree, index, search, help or deprecated list) and compile without local variable tables. A release drops from 17.0 MB to 14.5 MB. The change lives in build-extras.gradle, which Speakeasy never overwrites. Co-Authored-By: Claude Opus 5.5 --- build-extras.gradle | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/build-extras.gradle b/build-extras.gradle index 06746da4..a332eac6 100644 --- a/build-extras.gradle +++ b/build-extras.gradle @@ -11,4 +11,22 @@ 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 javadoc jar is half of every release. Drop the class tree, the A-Z index +// and search, the help page and the deprecated list; keep every class page. +javadoc { + options.noTree = true + options.noIndex = true + options.noHelp = true + options.noDeprecatedList = true +} + +// Keep file names and line numbers for stack traces; drop local variable tables. +tasks.withType(JavaCompile).configureEach { + options.debugOptions.debugLevel = "source,lines" +} From 2d4a2c9645a57a8d45691d6551e68ebc8073e00f Mon Sep 17 00:00:00 2001 From: Cristiano Betta Date: Fri, 4 Dec 2026 14:59:34 +0000 Subject: [PATCH 2/3] build: ship a placeholder javadoc jar that links to the repo docs Maven Central accepts a placeholder javadoc jar. The jar now holds one index.html and a README.md that link to the README and docs/ at the release tag. A release drops from 14.5 MB to 7.3 MB. Co-Authored-By: Claude Opus 5.5 --- build-extras.gradle | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/build-extras.gradle b/build-extras.gradle index a332eac6..da463148 100644 --- a/build-extras.gradle +++ b/build-extras.gradle @@ -17,13 +17,39 @@ test { // regeneration releases. These keep each release smaller without changing the // API. Speakeasy never overwrites this file; it overwrites build.gradle. -// The javadoc jar is half of every release. Drop the class tree, the A-Z index -// and search, the help page and the deprecated list; keep every class page. +// 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 { - options.noTree = true - options.noIndex = true - options.noHelp = true - options.noDeprecatedList = true + actions = [] + 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. From c089ff639d3b3cf31ed1d24467c5c74553923c17 Mon Sep 17 00:00:00 2001 From: Cristiano Betta Date: Fri, 4 Dec 2026 15:23:27 +0000 Subject: [PATCH 3/3] build: rebuild the placeholder javadoc when the version changes The links and title use the SDK version, so make it a task input. Otherwise a version-only change could reuse the old placeholder. Co-Authored-By: Claude Opus 5.5 --- build-extras.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build-extras.gradle b/build-extras.gradle index da463148..714d242c 100644 --- a/build-extras.gradle +++ b/build-extras.gradle @@ -23,6 +23,7 @@ test { def sdkVersion = version javadoc { actions = [] + inputs.property("sdkVersion", sdkVersion) doLast { def site = "https://github.com/gr4vy/gr4vy-java/tree/v${sdkVersion}" destinationDir.deleteDir()