Skip to content

refactor(build): build the IP-clearance row with the kotlinx.html DSL - #246

Open
adityamparikh wants to merge 2 commits into
apache:mainfrom
adityamparikh:refactor/ip-clearance-xml-dsl
Open

adityamparikh wants to merge 2 commits into
apache:mainfrom
adityamparikh:refactor/ip-clearance-xml-dsl

Conversation

@adityamparikh

Copy link
Copy Markdown
Contributor

Depends on #245. This branch is stacked on it, so the first commit in the diff is #245's; review only the last commit, refactor(build): build the IP-clearance row with the kotlinx.html DSL. The extra commit drops out once #245 merges.

Summary

Builds the Incubator IP-clearance row (generateIpClearanceLicenseReport) with the type-safe kotlinx.html DSL instead of XMLStreamWriter plus whitespace string literals.

Before, the element structure was buried in literals like "\n ", so the shape of the emitted XML could only be recovered by replaying the whitespace. Now the code mirrors the XML:

appendHTML(prettyPrint = true).tr {
    td { +date.get() }
    td {
        +CHECKLIST_WORDING
        code { +"META-INF/LICENSE" }
        +" of the executable JAR):"
        ul { items.forEach { (name, licenses) -> li { +"$name — ${licenses.joinToString(" / ") { it.label }}" } } }
    }
}
  • The checklist wording and the row indent move into named constants (CHECKLIST_WORDING, ROW_INDENT); one prependIndent replaces the hand-written indentation.
  • The library escapes text itself.
  • New buildSrc-only dependency: org.jetbrains.kotlinx:kotlinx-html-jvm:0.12.0 (Apache-2.0). It is not on the shipped classpath, so it does not appear in the binary LICENSE.

Output

The date, the checklist wording and all 157 dependency entries are unchanged. Only insignificant whitespace in the row differs: the checklist sentence is one line instead of hand-wrapped, and the <li> indent is 18 spaces instead of 20.

Testing

  • ./gradlew build (JDK 25, clean tree, including rat) — 421 tests, 0 failed, 0 skipped.
  • The generated ip-clearance-licenses.xml is well-formed; parsed, it matches the previous output (date, prose, 157 items). LICENSE is byte-identical.

@epugh, please review.

🤖 Generated with Claude Code

adityamparikh and others added 2 commits October 4, 2026 21:07
Add generateIpClearanceLicenseReport, which writes
build/generated/license/ip-clearance-licenses.xml: the "all items depended
upon by the project are covered by approved licenses" row of the Incubator
IP-clearance status document, listing group:artifact and license for every
bundled dependency as reported by the CycloneDX SBOM. A dependency missing
from the SBOM fails the task, the same completeness gate the binary LICENSE
uses.

Add the generateLicenseDocs aggregate (LICENSE, NOTICE and the IP-clearance
row) and make check depend on it, so a plain ./gradlew build leaves all three
in build/generated/license/. CI uploads that directory as the
solr-mcp-license-docs artifact. Extract the SBOM license lookup into a shared
SbomLicenses helper used by both license tasks.

Document the row on the Licensing & Notices page, in AGENTS.md and in
buildSrc/README.md, including a table of the generated files with the Gradle
task that produces each.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Aditya Parikh <aditya.m.parikh@gmail.com>
Replace the whitespace-literal construction of the IP-clearance row with a
type-safe kotlinx.html DSL whose shape mirrors the XML it emits, and move
the checklist wording and row indent into named constants. The library
escapes text itself. The date, wording and all dependency entries are
unchanged; only insignificant whitespace in the row differs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Aditya Parikh <aditya.m.parikh@gmail.com>
@adityamparikh
adityamparikh marked this pull request as ready for review October 5, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant