Appconf

A Go tool that sets the application identifiers and display names of the assembled projects from the merged per-platform configs. Run after task core, against build/.

The Xcode project file is rewritten in place: PRODUCT_BUNDLE_IDENTIFIER of the Application (app_id), ApplicationTests (app_id.Tests) and ApplicationUITests (app_id.UITests) targets, in both Debug and Release configs. INFOPLIST_KEY_CFBundleDisplayName is set on the Application target to app_name; PRODUCT_NAME stays $(TARGET_NAME) so the bundle keeps the name Application.app in the test host paths. On the Application target only, MARKETING_VERSION is set to app_version and CURRENT_PROJECT_VERSION to the current Unix timestamp (the build number). The Android applicationId is rewritten to app_id; the namespace is left untouched. Android versionName is rewritten to app_version and versionCode to the current Unix timestamp. The Android android:label is rewritten to app_name.

A missing or empty app_name leaves the app name untouched (only identifiers are set). A missing or empty app_version leaves the versions untouched.

Values are written literally, so the default wildcard app_id (com.example.*) is not translated. Re-running is a no-op, except the build number (CURRENT_PROJECT_VERSION / versionCode) changes because it is the current timestamp.

Requirements

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

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

  • The assembled projects and merged config files, produced by task core and task jsonc.

Usage

From the repository root:

tools/appconf/dist/appconf-{{os}}-{{arch}}

Flags

All flags have defaults that point to the standard build/ tree.

Flag Required Description

--xcode-config

No

Path to the merged Xcode config file. Default: build/xcode/config/config.jsonc.

--xcode-project

No

Path to the assembled Xcode project. Default: build/xcode/sources/Application/Application.xcodeproj/project.pbxproj.

--android-config

No

Path to the merged Android config file. Default: build/android/config/config.jsonc.

--android-project

No

Path to the assembled Android Application module. Default: build/android/sources/Application/build.gradle.kts.

--android-manifest

No

Path to the assembled Android manifest. Default: build/android/sources/Application/src/main/AndroidManifest.xml.

How it works

  1. Reads app_id, app_name and app_version from the Xcode config. A missing or empty app_id is an error; a missing or empty app_name skips the display name and a missing or empty app_version skips the versions.

  2. Rewrites the three PRODUCT_BUNDLE_IDENTIFIER markers in the pbxproj. Each marker must appear exactly twice (Debug + Release) or, when the file was already patched, the new value must appear twice. Any other count means the file was customized and the tool fails rather than guess. Matches are case-sensitive, so the Application id never collides with the test ids.

  3. Sets INFOPLIST_KEY_CFBundleDisplayName in both Application configurations. When a different name is already set it is replaced.

  4. Sets MARKETING_VERSION to app_version and CURRENT_PROJECT_VERSION to the current Unix timestamp in both Application configurations. When the values are already set they are replaced. Test targets are left untouched.

  5. Reads app_id, app_name and app_version from the Android config.

  6. Rewrites the single applicationId = "…​" line in the build.gradle.kts. The line must appear exactly once; when its value already equals app_id it is left unchanged.

  7. Rewrites the single versionName = "…​" and versionCode = …​ lines in the build.gradle.kts. Each line must appear exactly once; versionName becomes app_version and versionCode the current Unix timestamp.

  8. Rewrites the single android:label="…​" line in the manifest. The line must appear exactly once; when its value already equals app_name it is left unchanged.

Files are only written when they changed.

Tasks

From the repository root:

  • task appconf (aid): set the app identifiers for both Xcode and Android.

  • task appconf.build (aib): build the tools/appconf binary.

From tools/appconf/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 appconf-<os>-<arch> (Windows uses .exe).