From 1719419dd496cbbc5ae3755b4252de8da6d81d41 Mon Sep 17 00:00:00 2001 From: Wendy Liga Date: Fri, 12 Nov 2021 12:36:41 +0700 Subject: [PATCH] Migrate to Xcode New Build System (#29) * use build system * bump version and add changelog * update changelog --- CHANGELOG.md | 18 ++++++++++++++++++ src/TulsiGenerator/TulsiOptionSet.swift | 6 +++++- src/TulsiGenerator/XcodeProjectGenerator.swift | 14 +++++++++----- src/TulsiGenerator/en.lproj/Options.strings | 3 +++ version.bzl | 4 ++-- 5 files changed, 37 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8d60989..30384eeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # CHANGELOG +## 0.6.0 +

Tulsi++ 0.6.0 🔥

+

What's new:

+
    +
  1. By default, will use Xcode New Build System
  2. +
  3. Add Option to use Legacy Build System, false by default
  4. +
+ +

New Build System Fixes:

+
    +
  1. unit test will build & test successfully on Xcode 13
  2. +
  3. Fix issue where unit test failure doesn't pin to the exact code line
  4. +
  5. eliminate error couldn't find framework folder
  6. +
  7. Xcode will properly indexing the whole codebase in the background
  8. +
+ +---- + ## 0.5.3

Tulsi++ 0.5.3 🔨

What's new:

diff --git a/src/TulsiGenerator/TulsiOptionSet.swift b/src/TulsiGenerator/TulsiOptionSet.swift index 70f9e501..6cd814d4 100644 --- a/src/TulsiGenerator/TulsiOptionSet.swift +++ b/src/TulsiGenerator/TulsiOptionSet.swift @@ -94,7 +94,10 @@ public enum TulsiOptionKey: String { PreBuildPhaseRunScript, // Custom build phase run script that runs after bazel build. - PostBuildPhaseRunScript + PostBuildPhaseRunScript, + + // option to fallback to xcode legacy build system + UseLegacyBuildSystem // Options for build invocations. case BazelBuildOptionsDebug, @@ -345,6 +348,7 @@ public class TulsiOptionSet: Equatable { addBoolOption(.TreeArtifactOutputs, .Generic, true) addBoolOption(.Use64BitWatchSimulator, .Generic, false) addBoolOption(.DisableCustomLLDBInit, .Generic, false) + addBoolOption(.UseLegacyBuildSystem, .Generic, false) let defaultIdentifier = PlatformConfiguration.defaultConfiguration.identifier let platformCPUIdentifiers = PlatformConfiguration.allValidConfigurations.map { $0.identifier } diff --git a/src/TulsiGenerator/XcodeProjectGenerator.swift b/src/TulsiGenerator/XcodeProjectGenerator.swift index 397a4b75..2a1ef1cc 100644 --- a/src/TulsiGenerator/XcodeProjectGenerator.swift +++ b/src/TulsiGenerator/XcodeProjectGenerator.swift @@ -635,14 +635,18 @@ final class XcodeProjectGenerator { try writeDataHandler(workspaceSettingsURL, data) } - let workspaceSharedDataURL = projectURL.appendingPathComponent("project.xcworkspace/xcshareddata") - let sharedWorkspaceSettings: [String: Any] = [ - "BuildSystemType": "Original", - "DisableBuildSystemDeprecationWarning": true as AnyObject, - "DisableBuildSystemDeprecationDiagnostic": true as AnyObject, + var sharedWorkspaceSettings: [String: Any] = [ "IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded": false as AnyObject, ] + + let useLegacyBuildSystem: Bool = config.options[.UseLegacyBuildSystem].commonValueAsBool ?? false + if useLegacyBuildSystem { + sharedWorkspaceSettings["BuildSystemType"] = "Original" + sharedWorkspaceSettings["DisableBuildSystemDeprecationWarning"] = true as AnyObject + sharedWorkspaceSettings["DisableBuildSystemDeprecationDiagnostic"] = true as AnyObject + } + try writeWorkspaceSettings(sharedWorkspaceSettings, toDirectoryAtURL: workspaceSharedDataURL, replaceIfExists: true) diff --git a/src/TulsiGenerator/en.lproj/Options.strings b/src/TulsiGenerator/en.lproj/Options.strings index 26883636..88b46995 100644 --- a/src/TulsiGenerator/en.lproj/Options.strings +++ b/src/TulsiGenerator/en.lproj/Options.strings @@ -25,6 +25,9 @@ "ProjectGenerationUseRealFilePath" = "Use real Groups file path"; "ProjectGenerationUseRealFilePath_DESC" = "Experimental Feature! By default Tulsi use dummy file path for Groups to prevents some issues related to project-generation. By turning this ON, the generated-project will use real path for Groups. This can let developer to maintain file easily on Xcode, but may can cause some issues."; +"UseLegacyBuildSystem" = "Use Legacy Build System"; +"UseLegacyBuildSystem_DESC" = "Option to fallback to xcode legacy build system"; + "BazelBuildStartupOptions" = "'build' startup options"; "BazelBuildStartupOptions_DESC" = "Startup options for bazel 'build' invocations."; "BazelBuildStartupOptionsDebug" = "Debug"; diff --git a/version.bzl b/version.bzl index fcc8f96e..7ccdf5cb 100644 --- a/version.bzl +++ b/version.bzl @@ -3,8 +3,8 @@ # Version number (recorded into the Info.plist) TULSI_VERSION_MAJOR = "0" -TULSI_VERSION_MINOR = "5" -TULSI_VERSION_FIXLEVEL = "3" +TULSI_VERSION_MINOR = "6" +TULSI_VERSION_FIXLEVEL = "0" TULSI_VERSION_COPYRIGHT = "2021" TULSI_PRODUCT_NAME = "Tulsi++"