Track lib .ts as typescript task inputs #12087#12088
Conversation
The :lib:typescript NpmTask compiles each lib-*'s src/main/resources/lib/xp/**/*.ts into JS/DTS via `npm run build`, but only declared global.d.ts, core/index.d.ts and the tsconfigs as inputs. Editing a subproject .ts left the task UP-TO-DATE, so processResources copied stale generated JS and tests ran against old code until `clean`. Add the subproject TS (+ js/json siblings) as task inputs, mirroring the sibling lint task in the same file. Closes #12087
Codacy's Analysis Summary0 new issue (≤ 0 issue)
|
Pushed
Before/after evidence (verified locally in
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #12088 +/- ##
=========================================
Coverage 86.05% 86.05%
Complexity 19379 19379
=========================================
Files 2544 2544
Lines 65932 65932
Branches 5289 5289
=========================================
Hits 56740 56740
Misses 6630 6630
Partials 2562 2562 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
The
:lib:typescriptNpmTask inmodules/lib/build.gradlerunsnpm run buildto compile each lib-*'ssrc/main/resources/lib/xp/**/*.tsinto the generated.js/.d.tsunderlib-*/build/typescript/. Those JS files are then copied byprocessResourcesintobuild/resources/mainfor the OSGi bundle and tests.The task only declared
global.d.ts,core/index.d.ts,tsconfig.build.jsonandtsconfig.jsonas inputs — the actual TS sources were missing. Editing a subproject.tstherefore left:lib:typescriptUP-TO-DATE,processResourcescopied the stale generated JS, and tests ran against old code until aclean.Fix: declare the subproject TS (+
.js/.jsonsiblings) as inputs of:lib:typescript, mirroring exactly the pattern the siblinglinttask in the same file already uses. Outputs and other inputs untouched.Test plan
Verified in
claude-devagainstxpat HEAD of this branch:./gradlew :lib:lib-portal:processResources— seeds outputs (clean run)../gradlew :lib:typescript—UP-TO-DATEimmediately after (caching still works with the new inputs declaration).modules/lib/lib-portal/src/main/resources/lib/xp/portal.ts, re-ran./gradlew :lib:typescript --console=plain— task now executed (> Task :lib:typescript+tsc --declaration --project tsconfig.build.json), proving the subproject.tsis now a tracked input. Before this fix the same scenario reportedUP-TO-DATE../gradlew :lib:lib-portal:test— green.Closes #12087
🤖 Generated with Claude Code