From dcd0c936be1088529af4c6288e771f2fbb1d1b96 Mon Sep 17 00:00:00 2001 From: Suyeol Jeon Date: Mon, 19 Jan 2026 14:56:46 +0900 Subject: [PATCH] fix: replace + with - in bundle identifier for UTI compatibility (issue #87) - Rename package from UITextView+Placeholder to UITextView-Placeholder - Add Tuist+SPM integration test to CI workflow - Update SPM integration test script with correct product name - Add new test script to reproduce and validate the fix - Bundle identifiers must use alphanumeric, hyphen, and period chars only - SPM converts hyphens to underscores for module names (non-breaking) --- .github/workflows/ci.yml | 3 + Package.swift | 8 +-- Scripts/test-spm-integration.sh | 2 +- Scripts/test-tuist-spm-integration.sh | 99 +++++++++++++++++++++++++++ 4 files changed, 107 insertions(+), 5 deletions(-) create mode 100755 Scripts/test-tuist-spm-integration.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bde3597..c54d4c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,3 +20,6 @@ jobs: - name: Test SPM Integration run: ./Scripts/test-spm-integration.sh + + - name: Test Tuist+SPM Integration + run: ./Scripts/test-tuist-spm-integration.sh diff --git a/Package.swift b/Package.swift index e6d2caf..2b6af7d 100644 --- a/Package.swift +++ b/Package.swift @@ -3,16 +3,16 @@ import PackageDescription let package = Package( - name: "UITextView+Placeholder", + name: "UITextView-Placeholder", platforms: [.iOS(.v12)], products: [ .library( - name: "UITextView+Placeholder", - targets: ["UITextView+Placeholder"]), + name: "UITextView-Placeholder", + targets: ["UITextView-Placeholder"]), ], targets: [ .target( - name: "UITextView+Placeholder", + name: "UITextView-Placeholder", path: "Sources", publicHeadersPath: "."), ] diff --git a/Scripts/test-spm-integration.sh b/Scripts/test-spm-integration.sh index 111897d..e0525b2 100755 --- a/Scripts/test-spm-integration.sh +++ b/Scripts/test-spm-integration.sh @@ -26,7 +26,7 @@ let package = Package( .target( name: "SPMIntegrationTest", dependencies: [ - .product(name: "UITextView+Placeholder", package: "UITextView-Placeholder") + .product(name: "UITextView-Placeholder", package: "UITextView-Placeholder") ] ) ] diff --git a/Scripts/test-tuist-spm-integration.sh b/Scripts/test-tuist-spm-integration.sh new file mode 100755 index 0000000..a5c9166 --- /dev/null +++ b/Scripts/test-tuist-spm-integration.sh @@ -0,0 +1,99 @@ +#!/bin/bash +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PACKAGE_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +TEST_DIR=$(mktemp -d) + +cleanup() { + rm -rf "$TEST_DIR" +} +trap cleanup EXIT + +echo "==> Creating Tuist+SPM test project in $TEST_DIR" + +cat > "$TEST_DIR/Tuist.swift" << 'EOF' +import ProjectDescription + +let tuist = Tuist() +EOF + +cat > "$TEST_DIR/Package.swift" << EOF +// swift-tools-version:6.0 +import PackageDescription + +#if TUIST +import ProjectDescription + +let packageSettings = PackageSettings( + baseSettings: .settings() +) +#endif + +let package = Package( + name: "TuistSPMTest", + dependencies: [ + .package(path: "$PACKAGE_DIR") + ] +) +EOF + +cat > "$TEST_DIR/Project.swift" << 'EOF' +import ProjectDescription + +let project = Project( + name: "TuistSPMTest", + targets: [ + .target( + name: "TuistSPMTest", + destinations: .iOS, + product: .app, + bundleId: "com.test.TuistSPMTest", + deploymentTargets: .iOS("15.0"), + infoPlist: .default, + sources: ["Sources/**"], + dependencies: [ + .external(name: "UITextView-Placeholder") + ] + ) + ] +) +EOF + +mkdir -p "$TEST_DIR/Sources" +cat > "$TEST_DIR/Sources/App.swift" << 'EOF' +import UIKit +import UITextView_Placeholder + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + let textView = UITextView() + textView.placeholder = "Hello, Tuist+SPM!" + return true + } +} +EOF + +echo "==> Installing external dependencies with Tuist..." +cd "$TEST_DIR" +tuist install + +echo "==> Generating Xcode project with Tuist..." +tuist generate --no-open + +echo "==> Building with xcodebuild..." +SIMULATOR=$(xcrun simctl list devices available | grep -E "iPhone" | head -1 | sed 's/^[[:space:]]*//' | cut -d'(' -f1 | xargs) +if [ -z "$SIMULATOR" ]; then + echo "Error: No iOS Simulator found" + exit 1 +fi +echo " Using simulator: $SIMULATOR" + +xcodebuild -workspace TuistSPMTest.xcworkspace \ + -scheme TuistSPMTest \ + -destination "platform=iOS Simulator,name=$SIMULATOR" \ + build \ + -quiet + +echo "==> Tuist+SPM integration test passed!"