Link Tool Copies App Artifacts into the Assembled Tree
-
Status: Approved (2026-09-20) by: @clsource
Problem
The task link tool links the plugins present in the assembled source trees
into the native projects, but the freshly built app files never reach the
assembled Application tree. The task core tool copies the stock
config.jsonc and webview.js placeholders and never overwrites them, so the
merged configuration and the bundled scripts produced by task jsonc and
task bundler are lost when the app is built from build/<platform>/sources/.
Design
After linking plugins, link copies the freshly built artifacts over the
stock placeholders in each assembled Application tree:
-
Xcode:
build/xcode/config/config.jsonc→build/xcode/sources/Application/Application/config.jsonc, andbuild/xcode/scripts/webview.js→build/xcode/sources/Application/Application/webview.js. -
Android:
build/android/config/config.jsonc→build/android/sources/Application/src/main/assets/config.jsonc, andbuild/android/scripts/webview.js→build/android/sources/Application/src/main/assets/webview.js.
The input paths derive from the existing --<platform>-sources flags as the
sibling config/ and scripts/ directories under the same build/<platform>/
root. No new flags and no Taskfile.yml change are needed.
Behavior
-
A missing input (
config.jsoncorwebview.js) fails loudly, consistent with the rest of the tool and signaling thattask jsonc/task bundlerwere skipped. -
A destination that already matches is left untouched, so a rerun is a no-op and every file stays byte-stable.
Implementation
-
A single
copyArtifact(sources, artifact, rel)helper readsfilepath.Join(filepath.Dir(sources), artifact), compares it with the destination<sources>/<rel>, and writes only when it differs. -
run()wires the shared artifact list (config/config.jsonc,scripts/webview.js) with platform-specific destination relative paths.