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

Requirements

  • Go 1.26 or newer (only for compilation. dist/ directory contains binaries).

  • go-task (optional, only for the tasks below).

  • The assembled source trees, produced by task plugins and task core.

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

--xcode-sources

No

Path to the assembled Xcode source tree (build/xcode/sources/).

--android-sources

No

Path to the assembled Android source tree (build/android/sources/).

--xcode-assets

No

Path to the Xcode icon output from task icons (lib/xcode/assets/).

--android-assets

No

Path to the Android icon output from task icons (lib/android/assets/).

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 a PBXBuildFile/PBXFileReference pair 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 — the include(":Plugin") lines.

  • Application/build.gradle.kts — the implementation(project(":Plugin")) lines inside the dependencies block.

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, and build/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, and build/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 sets ASSETCATALOG_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 the AndroidManifest.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 the tools/link binary.

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.

Release binaries

dist/ contains prebuilt binaries for each platform, named link-<os>-<arch> (Windows uses .exe).