Link
A Go tool that links the plugins present in the assembled
source trees into the native projects. It scans
build/<platform>/sources/ for the JLPlugin* directories the plugins tool
copied — plugins in the config are on disk and get linked, plugins removed
from the config leave no directory and get unlinked. Anything that is not a
linked plugin (JLKernel, non-JLPlugin projects) is left untouched;
Application itself is only touched by the
app artifact copy
below.
Run it after task plugins and task core, before task appconf:
task jsonc
task bundler
task plugins
task core
task link
task appconf
Usage
From tools/link/src:
go run . --xcode-sources build/xcode/sources --android-sources build/android/sources
Both flags default to those paths. A rerun is a no-op: every edit is byte-stable.
Flags
| Flag | Required | Description |
|---|---|---|
|
No |
Path to the assembled Xcode source tree
( |
|
No |
Path to the assembled Android source tree
( |
|
No |
Path to the Xcode icon output from |
|
No |
Path to the Android icon output from |
Xcode
-
Jasonelle.xcworkspace/contents.xcworkspacedata— adds a FileRef (group:<Plugin>/<Plugin>.xcodeproj) per plugin and removes the stale ones. -
Application/Application.xcodeproj/project.pbxproj— adds aPBXBuildFile/PBXFileReferencepair per plugin with deterministic 24-hex object IDs, plus the Frameworks build phase entry and the Frameworks group child, and removes the corresponding stale entries. The framework product is assumed to be<Plugin>.framework.
Android
-
settings.gradle.kts— theinclude(":Plugin")lines. -
Application/build.gradle.kts— theimplementation(project(":Plugin"))lines inside thedependenciesblock.
App artifacts
After linking, the tool copies the freshly built app files into the assembled Application tree, replacing the stock placeholders the core tool copied:
-
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 inputs are derived from the --<platform>-sources flags as siblings
config/ and scripts/ under the same build/<platform>/ root. A missing
input fails the run. Files whose destination already matches are left
untouched, so reruns stay byte-stable no-ops.
App icons
After copying the app artifacts, the tool mirrors the icons generated by
task icons into the assembled Application tree and
verifies they landed:
-
Xcode:
lib/xcode/assets/AppIcon.appiconset/→build/xcode/sources/Application/Application/Assets.xcassets/AppIcon.appiconset/. The pbxproj already setsASSETCATALOG_COMPILER_APPICON_NAME = AppIcon, so a populated appiconset is all the project needs. -
Android:
lib/android/assets/icon/res/→build/android/sources/Application/src/main/res/, and theAndroidManifest.xml<application>tag is wired to@mipmap/ic_launcher/@mipmap/ic_launcher_round(values replaced when present, inserted when missing).
The source roots default to lib/xcode/assets and lib/android/assets,
overridable with --xcode-assets and --android-assets. The copy is a
mirror — stale files in the destination are removed — and every source file
is re-read after the copy and compared byte-for-byte; a missing or mismatched
icon fails the run. Reruns stay byte-stable no-ops. See the
design doc for details.
Tasks
From the repository root:
-
task link(l): link the plugins for both Xcode and Android. -
task link.build(lb): build thetools/linkbinary.
From tools/link/src:
-
task build(b): cross-compile binaries into../dist/for macOS (amd64/arm64), Linux (amd64) and Windows (amd64). -
task test(t): run the test suite.