From e2fe49052c7152f9820309135186c4b81c818bfd Mon Sep 17 00:00:00 2001 From: Michael McGuire Date: Wed, 31 Aug 2022 13:15:23 -0700 Subject: [PATCH] Implement Run Script comparison Fixes issue #110 Describe your changes * Added `RunScriptComparator` for doing detailed comparisons of an Xcode "Run Script" build phase (represented in `XcodeProj` as `PBXShellScriptBuildPhase`). * Added test support for running unit tests. * Updated the generated `CommandTests` after modifying the Project fixtures to have differences. Testing performed Added full suite of unit tests and command tests. I also ran it against the projects I'm working on (where I first noticed the problem) and saw it detected the changes. Signed-off-by: Michael McGuire --- .../Generated/differences_only.2.42311ee5.md | 2 + .../Generated/html_format.2.e5ef416a.md | 2 +- .../html_format_verbose.2.3ef640ed.md | 6 +- .../html_side_by_side_format.2.a609f1e3.md | 18 + ..._side_by_side_format_verbose.2.1beb48e8.md | 81 +++ CommandTests/Generated/list.0.a330395c.md | 1 + CommandTests/Generated/p1_p2.2.bac5a245.md | 6 + .../p1_p2_Project_target.2.961f27cf.md | 2 + ...roject_target_console_format.2.dfbdb9cf.md | 2 + ...arget_console_format_verbose.2.ba4ce842.md | 26 + ...2_Project_target_json_format.2.1b44ee6e.md | 45 ++ ...t_target_json_format_verbose.2.bcad53ce.md | 45 ++ ...oject_target_markdown_format.2.d851dd25.md | 6 + ...rget_markdown_format_verbose.2.f582a13e.md | 30 + ...p1_p2_Project_target_verbose.2.6f518e43.md | 26 + .../p1_p2_console_format.2.9841a8d7.md | 6 + ...p1_p2_console_format_verbose.2.40a241bd.md | 30 + .../Generated/p1_p2_json_format.2.e54c06ce.md | 105 ++++ .../p1_p2_json_format_verbose.2.0e0a3eb6.md | 105 ++++ .../p1_p2_markdown_format.2.1e09644b.md | 18 + ...1_p2_markdown_format_verbose.2.ac528bab.md | 42 ++ .../p1_p2_run_scripts_tag.2.6a74f67b.md | 19 + ...ipts_tag_NewFramework_target.1.30052ab6.md | 13 + ...mework_target_console_format.1.1fdd966d.md | 13 + ...arget_console_format_verbose.1.a1ddaf56.md | 13 + ...Framework_target_json_format.1.8d53e8aa.md | 13 + ...k_target_json_format_verbose.1.46488720.md | 13 + ...ework_target_markdown_format.1.7c1a3a53.md | 13 + ...rget_markdown_format_verbose.1.a39cf85f.md | 13 + ..._NewFramework_target_verbose.1.89d78c8a.md | 13 + ...n_scripts_tag_Project_target.2.c652102e.md | 15 + ...roject_target_console_format.2.86651d78.md | 15 + ...arget_console_format_verbose.2.57c6423c.md | 39 ++ ...g_Project_target_json_format.2.651b03e2.md | 59 ++ ...t_target_json_format_verbose.2.d7bb4f9f.md | 59 ++ ...oject_target_markdown_format.2.dd412257.md | 19 + ...rget_markdown_format_verbose.2.7f01b3b3.md | 43 ++ ...s_tag_Project_target_verbose.2.da061135.md | 39 ++ ...n_scripts_tag_console_format.2.863601f6.md | 19 + ...s_tag_console_format_verbose.2.de59bc4a.md | 43 ++ ..._run_scripts_tag_json_format.2.7dd2f1b0.md | 119 ++++ ...ipts_tag_json_format_verbose.2.7dc66165.md | 119 ++++ ..._scripts_tag_markdown_format.2.d3f5c727.md | 31 + ..._tag_markdown_format_verbose.2.d9b5d912.md | 55 ++ ...1_p2_run_scripts_tag_verbose.2.d42c21b9.md | 43 ++ .../Generated/p1_p2_verbose.2.fe666557.md | 30 + .../swift_packages_verbose.2.0494a7b3.md | 1 + CommandTests/generated_test_commands.json | 1 + Documentation/Comparators.md | 4 + .../Project.xcodeproj/project.pbxproj | 40 ++ .../Project.xcodeproj/project.pbxproj | 41 ++ .../Comparator/RunScriptComparator.swift | 160 ++++++ Sources/XCDiffCore/ComparatorType.swift | 5 + .../CommandsRunnerTests.swift | 6 + .../BuildPhasesComparatorTests.swift | 20 +- .../Comparator/ComparatorTypeTests.swift | 1 + .../Comparator/RunScriptComparatorTests.swift | 538 ++++++++++++++++++ .../Helpers/PBXBuildPhaseBuilder.swift | 11 +- .../Helpers/PBXNativeTargetBuilder.swift | 31 +- 59 files changed, 2318 insertions(+), 15 deletions(-) create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag.2.6a74f67b.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target.1.30052ab6.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_console_format.1.1fdd966d.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_console_format_verbose.1.a1ddaf56.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_json_format.1.8d53e8aa.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_json_format_verbose.1.46488720.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_markdown_format.1.7c1a3a53.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_markdown_format_verbose.1.a39cf85f.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_verbose.1.89d78c8a.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_Project_target.2.c652102e.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_console_format.2.86651d78.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_console_format_verbose.2.57c6423c.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_json_format.2.651b03e2.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_json_format_verbose.2.d7bb4f9f.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_markdown_format.2.dd412257.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_markdown_format_verbose.2.7f01b3b3.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_verbose.2.da061135.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_console_format.2.863601f6.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_console_format_verbose.2.de59bc4a.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_json_format.2.7dd2f1b0.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_json_format_verbose.2.7dc66165.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_markdown_format.2.d3f5c727.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_markdown_format_verbose.2.d9b5d912.md create mode 100644 CommandTests/Generated/p1_p2_run_scripts_tag_verbose.2.d42c21b9.md create mode 100644 Sources/XCDiffCore/Comparator/RunScriptComparator.swift create mode 100644 Tests/XCDiffCoreTests/Comparator/RunScriptComparatorTests.swift diff --git a/CommandTests/Generated/differences_only.2.42311ee5.md b/CommandTests/Generated/differences_only.2.42311ee5.md index 1e87d70..53b7382 100644 --- a/CommandTests/Generated/differences_only.2.42311ee5.md +++ b/CommandTests/Generated/differences_only.2.42311ee5.md @@ -21,6 +21,8 @@ ❌ RESOURCES > "Project" target ❌ RESOURCES > "ProjectTests" target ❌ RESOURCES > "ProjectUITests" target +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase ❌ CONFIGURATIONS > Root project ❌ SETTINGS > Root project > "Debug" configuration > Base configuration ❌ SETTINGS > Root project > "Debug" configuration > Values diff --git a/CommandTests/Generated/html_format.2.e5ef416a.md b/CommandTests/Generated/html_format.2.e5ef416a.md index 3eca296..e481994 100644 --- a/CommandTests/Generated/html_format.2.e5ef416a.md +++ b/CommandTests/Generated/html_format.2.e5ef416a.md @@ -104,7 +104,7 @@

Δ xcdiff result

-

❌ FILE_REFERENCES

❌ BUILD_PHASES > "MismatchingLibrary" target

✅ BUILD_PHASES > "Project" target

✅ BUILD_PHASES > "ProjectFramework" target

✅ BUILD_PHASES > "ProjectTests" target

✅ BUILD_PHASES > "ProjectUITests" target

✅ COPY_FILES > "MismatchingLibrary" target

❌ COPY_FILES > "Project" target > Embed Frameworks

✅ COPY_FILES > "ProjectFramework" target

✅ COPY_FILES > "ProjectTests" target

✅ COPY_FILES > "ProjectUITests" target

❌ TARGETS > NATIVE targets

❌ TARGETS > AGGREGATE targets

❌ HEADERS > "MismatchingLibrary" target

✅ HEADERS > "Project" target

❌ HEADERS > "ProjectFramework" target

✅ HEADERS > "ProjectTests" target

✅ HEADERS > "ProjectUITests" target

✅ SOURCES > "MismatchingLibrary" target

❌ SOURCES > "Project" target

✅ SOURCES > "ProjectFramework" target

❌ SOURCES > "ProjectTests" target

❌ SOURCES > "ProjectUITests" target

✅ RESOURCES > "MismatchingLibrary" target

❌ RESOURCES > "Project" target

✅ RESOURCES > "ProjectFramework" target

❌ RESOURCES > "ProjectTests" target

❌ RESOURCES > "ProjectUITests" target

❌ CONFIGURATIONS > Root project

❌ SETTINGS > Root project > "Debug" configuration > Base configuration

❌ SETTINGS > Root project > "Debug" configuration > Values

✅ SETTINGS > Root project > "Release" configuration > Base configuration

❌ SETTINGS > Root project > "Release" configuration > Values

✅ SETTINGS > "MismatchingLibrary" target > "Debug" configuration > Base configuration

❌ SETTINGS > "MismatchingLibrary" target > "Debug" configuration > Values

✅ SETTINGS > "MismatchingLibrary" target > "Release" configuration > Base configuration

❌ SETTINGS > "MismatchingLibrary" target > "Release" configuration > Values

❌ SETTINGS > "Project" target > "Debug" configuration > Base configuration

❌ SETTINGS > "Project" target > "Debug" configuration > Values

✅ SETTINGS > "Project" target > "Release" configuration > Base configuration

❌ SETTINGS > "Project" target > "Release" configuration > Values

✅ SETTINGS > "ProjectFramework" target > "Debug" configuration > Base configuration

❌ SETTINGS > "ProjectFramework" target > "Debug" configuration > Values

✅ SETTINGS > "ProjectFramework" target > "Release" configuration > Base configuration

❌ SETTINGS > "ProjectFramework" target > "Release" configuration > Values

✅ SETTINGS > "ProjectTests" target > "Debug" configuration > Base configuration

✅ SETTINGS > "ProjectTests" target > "Debug" configuration > Values

✅ SETTINGS > "ProjectTests" target > "Release" configuration > Base configuration

✅ SETTINGS > "ProjectTests" target > "Release" configuration > Values

✅ SETTINGS > "ProjectUITests" target > "Debug" configuration > Base configuration

❌ SETTINGS > "ProjectUITests" target > "Debug" configuration > Values

✅ SETTINGS > "ProjectUITests" target > "Release" configuration > Base configuration

❌ SETTINGS > "ProjectUITests" target > "Release" configuration > Values

❌ SOURCE_TREES > Root project

✅ DEPENDENCIES > "MismatchingLibrary" target

❌ DEPENDENCIES > "Project" target

✅ DEPENDENCIES > "ProjectFramework" target

✅ DEPENDENCIES > "ProjectTests" target

✅ DEPENDENCIES > "ProjectUITests" target

✅ LINKED_DEPENDENCIES > "MismatchingLibrary" target

❌ LINKED_DEPENDENCIES > "Project" target

✅ LINKED_DEPENDENCIES > "ProjectFramework" target

✅ LINKED_DEPENDENCIES > "ProjectTests" target

✅ LINKED_DEPENDENCIES > "ProjectUITests" target

❌ ATTRIBUTES > Root project

❌ ATTRIBUTES > "MismatchingLibrary" target

❌ ATTRIBUTES > "Project" target

✅ ATTRIBUTES > "ProjectFramework" target

✅ ATTRIBUTES > "ProjectTests" target

❌ ATTRIBUTES > "ProjectUITests" target

✅ SWIFT_PACKAGES

+

❌ FILE_REFERENCES

❌ BUILD_PHASES > "MismatchingLibrary" target

✅ BUILD_PHASES > "Project" target

✅ BUILD_PHASES > "ProjectFramework" target

✅ BUILD_PHASES > "ProjectTests" target

✅ BUILD_PHASES > "ProjectUITests" target

✅ COPY_FILES > "MismatchingLibrary" target

❌ COPY_FILES > "Project" target > Embed Frameworks

✅ COPY_FILES > "ProjectFramework" target

✅ COPY_FILES > "ProjectTests" target

✅ COPY_FILES > "ProjectUITests" target

❌ TARGETS > NATIVE targets

❌ TARGETS > AGGREGATE targets

❌ HEADERS > "MismatchingLibrary" target

✅ HEADERS > "Project" target

❌ HEADERS > "ProjectFramework" target

✅ HEADERS > "ProjectTests" target

✅ HEADERS > "ProjectUITests" target

✅ SOURCES > "MismatchingLibrary" target

❌ SOURCES > "Project" target

✅ SOURCES > "ProjectFramework" target

❌ SOURCES > "ProjectTests" target

❌ SOURCES > "ProjectUITests" target

✅ RESOURCES > "MismatchingLibrary" target

❌ RESOURCES > "Project" target

✅ RESOURCES > "ProjectFramework" target

❌ RESOURCES > "ProjectTests" target

❌ RESOURCES > "ProjectUITests" target

✅ RUN_SCRIPTS > "MismatchingLibrary" target

❌ RUN_SCRIPTS > "Project" target > "Second script" build phase

❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase

✅ RUN_SCRIPTS > "ProjectFramework" target

✅ RUN_SCRIPTS > "ProjectTests" target

✅ RUN_SCRIPTS > "ProjectUITests" target

❌ CONFIGURATIONS > Root project

❌ SETTINGS > Root project > "Debug" configuration > Base configuration

❌ SETTINGS > Root project > "Debug" configuration > Values

✅ SETTINGS > Root project > "Release" configuration > Base configuration

❌ SETTINGS > Root project > "Release" configuration > Values

✅ SETTINGS > "MismatchingLibrary" target > "Debug" configuration > Base configuration

❌ SETTINGS > "MismatchingLibrary" target > "Debug" configuration > Values

✅ SETTINGS > "MismatchingLibrary" target > "Release" configuration > Base configuration

❌ SETTINGS > "MismatchingLibrary" target > "Release" configuration > Values

❌ SETTINGS > "Project" target > "Debug" configuration > Base configuration

❌ SETTINGS > "Project" target > "Debug" configuration > Values

✅ SETTINGS > "Project" target > "Release" configuration > Base configuration

❌ SETTINGS > "Project" target > "Release" configuration > Values

✅ SETTINGS > "ProjectFramework" target > "Debug" configuration > Base configuration

❌ SETTINGS > "ProjectFramework" target > "Debug" configuration > Values

✅ SETTINGS > "ProjectFramework" target > "Release" configuration > Base configuration

❌ SETTINGS > "ProjectFramework" target > "Release" configuration > Values

✅ SETTINGS > "ProjectTests" target > "Debug" configuration > Base configuration

✅ SETTINGS > "ProjectTests" target > "Debug" configuration > Values

✅ SETTINGS > "ProjectTests" target > "Release" configuration > Base configuration

✅ SETTINGS > "ProjectTests" target > "Release" configuration > Values

✅ SETTINGS > "ProjectUITests" target > "Debug" configuration > Base configuration

❌ SETTINGS > "ProjectUITests" target > "Debug" configuration > Values

✅ SETTINGS > "ProjectUITests" target > "Release" configuration > Base configuration

❌ SETTINGS > "ProjectUITests" target > "Release" configuration > Values

❌ SOURCE_TREES > Root project

✅ DEPENDENCIES > "MismatchingLibrary" target

❌ DEPENDENCIES > "Project" target

✅ DEPENDENCIES > "ProjectFramework" target

✅ DEPENDENCIES > "ProjectTests" target

✅ DEPENDENCIES > "ProjectUITests" target

✅ LINKED_DEPENDENCIES > "MismatchingLibrary" target

❌ LINKED_DEPENDENCIES > "Project" target

✅ LINKED_DEPENDENCIES > "ProjectFramework" target

✅ LINKED_DEPENDENCIES > "ProjectTests" target

✅ LINKED_DEPENDENCIES > "ProjectUITests" target

❌ ATTRIBUTES > Root project

❌ ATTRIBUTES > "MismatchingLibrary" target

❌ ATTRIBUTES > "Project" target

✅ ATTRIBUTES > "ProjectFramework" target

✅ ATTRIBUTES > "ProjectTests" target

❌ ATTRIBUTES > "ProjectUITests" target

✅ SWIFT_PACKAGES

diff --git a/CommandTests/Generated/html_format_verbose.2.3ef640ed.md b/CommandTests/Generated/html_format_verbose.2.3ef640ed.md index 1bac705..e7863da 100644 --- a/CommandTests/Generated/html_format_verbose.2.3ef640ed.md +++ b/CommandTests/Generated/html_format_verbose.2.3ef640ed.md @@ -104,7 +104,11 @@

Δ xcdiff result

-

❌ FILE_REFERENCES

⚠️ Only in first (8):

  • Project/Group B/AViewController.xib
  • Project/Group B/AnotherObjcClass.h
  • Project/Group B/AnotherObjcClass.m
  • Project/Resources/time.png
  • ProjectTests/BarTests.swift
  • ProjectUITests/LoginTests.swift
  • ProjectUITests/Screenshots/empty.png
  • libMismatchingLibrary.a

⚠️ Only in second (11):

  • MismatchingLibrary.framework
  • MismatchingLibrary/MismatchingLibrary-Info.plist
  • NewFramework.framework
  • NewFramework/Info.plist
  • NewFramework/NewFramework.h
  • Project/Project.xcconfig
  • Project/Target.xcconfig
  • ProjectFramework/Header4.h
  • ProjectTests/Responses/ListResponse.json
  • ProjectUITests/MetricsTests.swift
  • README.md

❌ BUILD_PHASES > "MismatchingLibrary" target

⚠️ Only in first (1):

  • CopyFiles

⚠️ Only in second (2):

  • Headers
  • Resources

✅ BUILD_PHASES > "Project" target

✅ BUILD_PHASES > "ProjectFramework" target

✅ BUILD_PHASES > "ProjectTests" target

✅ BUILD_PHASES > "ProjectUITests" target

✅ COPY_FILES > "MismatchingLibrary" target

❌ COPY_FILES > "Project" target > Embed Frameworks

⚠️ Only in second (2):

  • MismatchingLibrary.framework
  • NewFramework.framework

⚠️ Value mismatch (1):

  • ProjectFramework.framework

    • attributes = ["CodeSignOnCopy", "RemoveHeadersOnCopy"]
    • attributes = []

✅ COPY_FILES > "ProjectFramework" target

✅ COPY_FILES > "ProjectTests" target

✅ COPY_FILES > "ProjectUITests" target

❌ TARGETS > NATIVE targets

⚠️ Only in second (1):

  • NewFramework

⚠️ Value mismatch (1):

  • MismatchingLibrary product type

    • com.apple.product-type.library.static
    • com.apple.product-type.framework

❌ TARGETS > AGGREGATE targets

⚠️ Only in second (1):

  • NewAggregate

❌ HEADERS > "MismatchingLibrary" target

⚠️ Only in second (1):

  • MismatchingLibrary/MismatchingLibrary.h

✅ HEADERS > "Project" target

❌ HEADERS > "ProjectFramework" target

⚠️ Only in second (1):

  • ProjectFramework/Header4.h

⚠️ Value mismatch (2):

  • ProjectFramework/Header1.h attributes

    • Public
    • nil (Project)
  • ProjectFramework/Header2.h attributes

    • Private
    • nil (Project)

✅ HEADERS > "ProjectTests" target

✅ HEADERS > "ProjectUITests" target

✅ SOURCES > "MismatchingLibrary" target

❌ SOURCES > "Project" target

⚠️ Only in first (1):

  • Project/Group B/AnotherObjcClass.m

⚠️ Value mismatch (1):

  • Project/Group A/ObjcClass.m compiler flags

    • nil
    • -ObjC

✅ SOURCES > "ProjectFramework" target

❌ SOURCES > "ProjectTests" target

⚠️ Only in first (1):

  • ProjectTests/BarTests.swift

❌ SOURCES > "ProjectUITests" target

⚠️ Only in first (1):

  • ProjectUITests/LoginTests.swift

⚠️ Only in second (1):

  • ProjectUITests/MetricsTests.swift

✅ RESOURCES > "MismatchingLibrary" target

❌ RESOURCES > "Project" target

⚠️ Only in first (2):

  • Project/Group B/AViewController.xib
  • Project/Resources/time.png

✅ RESOURCES > "ProjectFramework" target

❌ RESOURCES > "ProjectTests" target

⚠️ Only in second (1):

  • ProjectTests/Responses/ListResponse.json

❌ RESOURCES > "ProjectUITests" target

⚠️ Only in first (1):

  • ProjectUITests/Screenshots/empty.png

❌ CONFIGURATIONS > Root project

⚠️ Only in second (1):

  • CUSTOM_NEW

❌ SETTINGS > Root project > "Debug" configuration > Base configuration

⚠️ Value mismatch (1):

  • Path to .xcconfig

    • nil
    • Project/Project.xcconfig

❌ SETTINGS > Root project > "Debug" configuration > Values

⚠️ Only in second (1):

  • CUSTOM_SETTGING_1 = CS_1_PROJECT_LEVEL

✅ SETTINGS > Root project > "Release" configuration > Base configuration

❌ SETTINGS > Root project > "Release" configuration > Values

⚠️ Only in second (1):

  • CUSTOM_SETTGING_1 = CS_1_PROJECT_LEVEL

✅ SETTINGS > "MismatchingLibrary" target > "Debug" configuration > Base configuration

❌ SETTINGS > "MismatchingLibrary" target > "Debug" configuration > Values

⚠️ Only in first (1):

  • OTHER_LDFLAGS = -ObjC

⚠️ Only in second (13):

  • CLANG_ENABLE_MODULES = YES
  • CURRENT_PROJECT_VERSION = 1
  • DEFINES_MODULE = YES
  • DYLIB_COMPATIBILITY_VERSION = 1
  • DYLIB_CURRENT_VERSION = 1
  • DYLIB_INSTALL_NAME_BASE = @rpath
  • INFOPLIST_FILE = MismatchingLibrary/MismatchingLibrary-Info.plist
  • INSTALL_PATH = $(LOCAL_LIBRARY_DIR)/Frameworks
  • LD_RUNPATH_SEARCH_PATHS = ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"]
  • PRODUCT_BUNDLE_IDENTIFIER = com.bloomberg.xcdiff.Project.MismatchingLibrary
  • SWIFT_OPTIMIZATION_LEVEL = -Onone
  • VERSIONING_SYSTEM = apple-generic
  • VERSION_INFO_PREFIX =

⚠️ Value mismatch (1):

  • PRODUCT_NAME

    • $(TARGET_NAME)
    • $(TARGET_NAME:c99extidentifier)

✅ SETTINGS > "MismatchingLibrary" target > "Release" configuration > Base configuration

❌ SETTINGS > "MismatchingLibrary" target > "Release" configuration > Values

⚠️ Only in first (1):

  • OTHER_LDFLAGS = -ObjC

⚠️ Only in second (12):

  • CLANG_ENABLE_MODULES = YES
  • CURRENT_PROJECT_VERSION = 1
  • DEFINES_MODULE = YES
  • DYLIB_COMPATIBILITY_VERSION = 1
  • DYLIB_CURRENT_VERSION = 1
  • DYLIB_INSTALL_NAME_BASE = @rpath
  • INFOPLIST_FILE = MismatchingLibrary/MismatchingLibrary-Info.plist
  • INSTALL_PATH = $(LOCAL_LIBRARY_DIR)/Frameworks
  • LD_RUNPATH_SEARCH_PATHS = ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"]
  • PRODUCT_BUNDLE_IDENTIFIER = com.bloomberg.xcdiff.Project.MismatchingLibrary
  • VERSIONING_SYSTEM = apple-generic
  • VERSION_INFO_PREFIX =

⚠️ Value mismatch (1):

  • PRODUCT_NAME

    • $(TARGET_NAME)
    • $(TARGET_NAME:c99extidentifier)

❌ SETTINGS > "Project" target > "Debug" configuration > Base configuration

⚠️ Value mismatch (1):

  • Path to .xcconfig

    • nil
    • Project/Target.xcconfig

❌ SETTINGS > "Project" target > "Debug" configuration > Values

⚠️ Only in second (1):

  • ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES

⚠️ Value mismatch (1):

  • CUSTOM_SETTING_COMMON

    • VALUE_1
    • VALUE_2

✅ SETTINGS > "Project" target > "Release" configuration > Base configuration

❌ SETTINGS > "Project" target > "Release" configuration > Values

⚠️ Only in second (1):

  • ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES

⚠️ Value mismatch (1):

  • CUSTOM_SETTING_COMMON

    • VALUE_1
    • VALUE_2

✅ SETTINGS > "ProjectFramework" target > "Debug" configuration > Base configuration

❌ SETTINGS > "ProjectFramework" target > "Debug" configuration > Values

⚠️ Value mismatch (1):

  • PRODUCT_BUNDLE_IDENTIFIER

    • com.bloomberg.xcdiff.Project.testprovisioning.ProjectFramework
    • com.bloomberg.xcdiff.Project.ProjectFramework

✅ SETTINGS > "ProjectFramework" target > "Release" configuration > Base configuration

❌ SETTINGS > "ProjectFramework" target > "Release" configuration > Values

⚠️ Value mismatch (1):

  • PRODUCT_BUNDLE_IDENTIFIER

    • com.bloomberg.xcdiff.Project.testprovisioning.ProjectFramework
    • com.bloomberg.xcdiff.Project.ProjectFramework

✅ SETTINGS > "ProjectTests" target > "Debug" configuration > Base configuration

✅ SETTINGS > "ProjectTests" target > "Debug" configuration > Values

✅ SETTINGS > "ProjectTests" target > "Release" configuration > Base configuration

✅ SETTINGS > "ProjectTests" target > "Release" configuration > Values

✅ SETTINGS > "ProjectUITests" target > "Debug" configuration > Base configuration

❌ SETTINGS > "ProjectUITests" target > "Debug" configuration > Values

⚠️ Only in first (1):

  • PROVISIONING_PROFILE =

⚠️ Only in second (1):

  • TEST_TARGET_NAME = Project

✅ SETTINGS > "ProjectUITests" target > "Release" configuration > Base configuration

❌ SETTINGS > "ProjectUITests" target > "Release" configuration > Values

⚠️ Only in first (1):

  • PROVISIONING_PROFILE =

⚠️ Only in second (1):

  • TEST_TARGET_NAME = Project

❌ SOURCE_TREES > Root project

Output format: (<path>, <name>, <source_tree>)

⚠️ Only in first (8):

  • (AViewController.xib, nil, <group>) → (Group B, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)
  • (AnotherObjcClass.h, nil, <group>) → (Group B, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)
  • (AnotherObjcClass.m, nil, <group>) → (Group B, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)
  • (BarTests.swift, nil, <group>) → (ProjectTests, nil, <group>) → (nil, nil, <group>)
  • (LoginTests.swift, nil, <group>) → (ProjectUITests, nil, <group>) → (nil, nil, <group>)
  • (empty.png, nil, <group>) → (Screenshots, nil, <group>) → (ProjectUITests, nil, <group>) → (nil, nil, <group>)
  • (libMismatchingLibrary.a, nil, BUILT_PRODUCTS_DIR) → (nil, Products, <group>) → (nil, nil, <group>)
  • (time.png, nil, <group>) → (Resources, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)

⚠️ Only in second (11):

  • (Header4.h, nil, <group>) → (ProjectFramework, nil, <group>) → (nil, nil, <group>)
  • (Info.plist, nil, <group>) → (NewFramework, nil, <group>) → (nil, nil, <group>)
  • (ListResponse.json, nil, <group>) → (Responses, nil, <group>) → (ProjectTests, nil, <group>) → (nil, nil, <group>)
  • (MetricsTests.swift, nil, <group>) → (ProjectUITests, nil, <group>) → (nil, nil, <group>)
  • (MismatchingLibrary-Info.plist, nil, <group>) → (MismatchingLibrary, nil, <group>) → (nil, nil, <group>)
  • (MismatchingLibrary.framework, nil, BUILT_PRODUCTS_DIR) → (nil, Products, <group>) → (nil, nil, <group>)
  • (NewFramework.framework, nil, BUILT_PRODUCTS_DIR) → (nil, Products, <group>) → (nil, nil, <group>)
  • (NewFramework.h, nil, <group>) → (NewFramework, nil, <group>) → (nil, nil, <group>)
  • (Project.xcconfig, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)
  • (README.md, nil, <group>) → (nil, nil, <group>)
  • (Target.xcconfig, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)

✅ DEPENDENCIES > "MismatchingLibrary" target

❌ DEPENDENCIES > "Project" target

⚠️ Only in second (2):

  • (target=MismatchingLibrary)
  • (target=NewFramework)

✅ DEPENDENCIES > "ProjectFramework" target

✅ DEPENDENCIES > "ProjectTests" target

✅ DEPENDENCIES > "ProjectUITests" target

✅ LINKED_DEPENDENCIES > "MismatchingLibrary" target

❌ LINKED_DEPENDENCIES > "Project" target

⚠️ Only in second (2):

  • MismatchingLibrary.framework
  • NewFramework.framework

⚠️ Value mismatch (1):

  • ARKit.framework attributes

    • required
    • optional

✅ LINKED_DEPENDENCIES > "ProjectFramework" target

✅ LINKED_DEPENDENCIES > "ProjectTests" target

✅ LINKED_DEPENDENCIES > "ProjectUITests" target

❌ ATTRIBUTES > Root project

⚠️ Value mismatch (3):

  • LastSwiftUpdateCheck

    • 1110
    • 1030
  • LastUpgradeCheck

    • 1020
    • 1030
  • ORGANIZATIONNAME

    • Bloomberg LP
    • Another Organization

❌ ATTRIBUTES > "MismatchingLibrary" target

⚠️ Only in second (1):

  • LastSwiftMigration = 1110

❌ ATTRIBUTES > "Project" target

⚠️ Value mismatch (1):

  • LastSwiftMigration

    • 1140
    • 1020

✅ ATTRIBUTES > "ProjectFramework" target

✅ ATTRIBUTES > "ProjectTests" target

❌ ATTRIBUTES > "ProjectUITests" target

⚠️ Only in second (1):

  • TestTargetID = Project

✅ SWIFT_PACKAGES

+

❌ FILE_REFERENCES

⚠️ Only in first (8):

  • Project/Group B/AViewController.xib
  • Project/Group B/AnotherObjcClass.h
  • Project/Group B/AnotherObjcClass.m
  • Project/Resources/time.png
  • ProjectTests/BarTests.swift
  • ProjectUITests/LoginTests.swift
  • ProjectUITests/Screenshots/empty.png
  • libMismatchingLibrary.a

⚠️ Only in second (11):

  • MismatchingLibrary.framework
  • MismatchingLibrary/MismatchingLibrary-Info.plist
  • NewFramework.framework
  • NewFramework/Info.plist
  • NewFramework/NewFramework.h
  • Project/Project.xcconfig
  • Project/Target.xcconfig
  • ProjectFramework/Header4.h
  • ProjectTests/Responses/ListResponse.json
  • ProjectUITests/MetricsTests.swift
  • README.md

❌ BUILD_PHASES > "MismatchingLibrary" target

⚠️ Only in first (1):

  • CopyFiles

⚠️ Only in second (2):

  • Headers
  • Resources

✅ BUILD_PHASES > "Project" target

✅ BUILD_PHASES > "ProjectFramework" target

✅ BUILD_PHASES > "ProjectTests" target

✅ BUILD_PHASES > "ProjectUITests" target

✅ COPY_FILES > "MismatchingLibrary" target

❌ COPY_FILES > "Project" target > Embed Frameworks

⚠️ Only in second (2):

  • MismatchingLibrary.framework
  • NewFramework.framework

⚠️ Value mismatch (1):

  • ProjectFramework.framework

    • attributes = ["CodeSignOnCopy", "RemoveHeadersOnCopy"]
    • attributes = []

✅ COPY_FILES > "ProjectFramework" target

✅ COPY_FILES > "ProjectTests" target

✅ COPY_FILES > "ProjectUITests" target

❌ TARGETS > NATIVE targets

⚠️ Only in second (1):

  • NewFramework

⚠️ Value mismatch (1):

  • MismatchingLibrary product type

    • com.apple.product-type.library.static
    • com.apple.product-type.framework

❌ TARGETS > AGGREGATE targets

⚠️ Only in second (1):

  • NewAggregate

❌ HEADERS > "MismatchingLibrary" target

⚠️ Only in second (1):

  • MismatchingLibrary/MismatchingLibrary.h

✅ HEADERS > "Project" target

❌ HEADERS > "ProjectFramework" target

⚠️ Only in second (1):

  • ProjectFramework/Header4.h

⚠️ Value mismatch (2):

  • ProjectFramework/Header1.h attributes

    • Public
    • nil (Project)
  • ProjectFramework/Header2.h attributes

    • Private
    • nil (Project)

✅ HEADERS > "ProjectTests" target

✅ HEADERS > "ProjectUITests" target

✅ SOURCES > "MismatchingLibrary" target

❌ SOURCES > "Project" target

⚠️ Only in first (1):

  • Project/Group B/AnotherObjcClass.m

⚠️ Value mismatch (1):

  • Project/Group A/ObjcClass.m compiler flags

    • nil
    • -ObjC

✅ SOURCES > "ProjectFramework" target

❌ SOURCES > "ProjectTests" target

⚠️ Only in first (1):

  • ProjectTests/BarTests.swift

❌ SOURCES > "ProjectUITests" target

⚠️ Only in first (1):

  • ProjectUITests/LoginTests.swift

⚠️ Only in second (1):

  • ProjectUITests/MetricsTests.swift

✅ RESOURCES > "MismatchingLibrary" target

❌ RESOURCES > "Project" target

⚠️ Only in first (2):

  • Project/Group B/AViewController.xib
  • Project/Resources/time.png

✅ RESOURCES > "ProjectFramework" target

❌ RESOURCES > "ProjectTests" target

⚠️ Only in second (1):

  • ProjectTests/Responses/ListResponse.json

❌ RESOURCES > "ProjectUITests" target

⚠️ Only in first (1):

  • ProjectUITests/Screenshots/empty.png

✅ RUN_SCRIPTS > "MismatchingLibrary" target

❌ RUN_SCRIPTS > "Project" target > "Second script" build phase

⚠️ Value mismatch (1):

  • shellScript

    • echo "First Hello, world!" +
    • echo "second script" +

❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase

⚠️ Value mismatch (2):

  • shellScript

    • echo "Hello, World!" +
    • echo "Hello, world?" +
  • showEnvVarsInLog

    • true
    • false

✅ RUN_SCRIPTS > "ProjectFramework" target

✅ RUN_SCRIPTS > "ProjectTests" target

✅ RUN_SCRIPTS > "ProjectUITests" target

❌ CONFIGURATIONS > Root project

⚠️ Only in second (1):

  • CUSTOM_NEW

❌ SETTINGS > Root project > "Debug" configuration > Base configuration

⚠️ Value mismatch (1):

  • Path to .xcconfig

    • nil
    • Project/Project.xcconfig

❌ SETTINGS > Root project > "Debug" configuration > Values

⚠️ Only in second (1):

  • CUSTOM_SETTGING_1 = CS_1_PROJECT_LEVEL

✅ SETTINGS > Root project > "Release" configuration > Base configuration

❌ SETTINGS > Root project > "Release" configuration > Values

⚠️ Only in second (1):

  • CUSTOM_SETTGING_1 = CS_1_PROJECT_LEVEL

✅ SETTINGS > "MismatchingLibrary" target > "Debug" configuration > Base configuration

❌ SETTINGS > "MismatchingLibrary" target > "Debug" configuration > Values

⚠️ Only in first (1):

  • OTHER_LDFLAGS = -ObjC

⚠️ Only in second (13):

  • CLANG_ENABLE_MODULES = YES
  • CURRENT_PROJECT_VERSION = 1
  • DEFINES_MODULE = YES
  • DYLIB_COMPATIBILITY_VERSION = 1
  • DYLIB_CURRENT_VERSION = 1
  • DYLIB_INSTALL_NAME_BASE = @rpath
  • INFOPLIST_FILE = MismatchingLibrary/MismatchingLibrary-Info.plist
  • INSTALL_PATH = $(LOCAL_LIBRARY_DIR)/Frameworks
  • LD_RUNPATH_SEARCH_PATHS = ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"]
  • PRODUCT_BUNDLE_IDENTIFIER = com.bloomberg.xcdiff.Project.MismatchingLibrary
  • SWIFT_OPTIMIZATION_LEVEL = -Onone
  • VERSIONING_SYSTEM = apple-generic
  • VERSION_INFO_PREFIX =

⚠️ Value mismatch (1):

  • PRODUCT_NAME

    • $(TARGET_NAME)
    • $(TARGET_NAME:c99extidentifier)

✅ SETTINGS > "MismatchingLibrary" target > "Release" configuration > Base configuration

❌ SETTINGS > "MismatchingLibrary" target > "Release" configuration > Values

⚠️ Only in first (1):

  • OTHER_LDFLAGS = -ObjC

⚠️ Only in second (12):

  • CLANG_ENABLE_MODULES = YES
  • CURRENT_PROJECT_VERSION = 1
  • DEFINES_MODULE = YES
  • DYLIB_COMPATIBILITY_VERSION = 1
  • DYLIB_CURRENT_VERSION = 1
  • DYLIB_INSTALL_NAME_BASE = @rpath
  • INFOPLIST_FILE = MismatchingLibrary/MismatchingLibrary-Info.plist
  • INSTALL_PATH = $(LOCAL_LIBRARY_DIR)/Frameworks
  • LD_RUNPATH_SEARCH_PATHS = ["$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks"]
  • PRODUCT_BUNDLE_IDENTIFIER = com.bloomberg.xcdiff.Project.MismatchingLibrary
  • VERSIONING_SYSTEM = apple-generic
  • VERSION_INFO_PREFIX =

⚠️ Value mismatch (1):

  • PRODUCT_NAME

    • $(TARGET_NAME)
    • $(TARGET_NAME:c99extidentifier)

❌ SETTINGS > "Project" target > "Debug" configuration > Base configuration

⚠️ Value mismatch (1):

  • Path to .xcconfig

    • nil
    • Project/Target.xcconfig

❌ SETTINGS > "Project" target > "Debug" configuration > Values

⚠️ Only in second (1):

  • ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES

⚠️ Value mismatch (1):

  • CUSTOM_SETTING_COMMON

    • VALUE_1
    • VALUE_2

✅ SETTINGS > "Project" target > "Release" configuration > Base configuration

❌ SETTINGS > "Project" target > "Release" configuration > Values

⚠️ Only in second (1):

  • ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES

⚠️ Value mismatch (1):

  • CUSTOM_SETTING_COMMON

    • VALUE_1
    • VALUE_2

✅ SETTINGS > "ProjectFramework" target > "Debug" configuration > Base configuration

❌ SETTINGS > "ProjectFramework" target > "Debug" configuration > Values

⚠️ Value mismatch (1):

  • PRODUCT_BUNDLE_IDENTIFIER

    • com.bloomberg.xcdiff.Project.testprovisioning.ProjectFramework
    • com.bloomberg.xcdiff.Project.ProjectFramework

✅ SETTINGS > "ProjectFramework" target > "Release" configuration > Base configuration

❌ SETTINGS > "ProjectFramework" target > "Release" configuration > Values

⚠️ Value mismatch (1):

  • PRODUCT_BUNDLE_IDENTIFIER

    • com.bloomberg.xcdiff.Project.testprovisioning.ProjectFramework
    • com.bloomberg.xcdiff.Project.ProjectFramework

✅ SETTINGS > "ProjectTests" target > "Debug" configuration > Base configuration

✅ SETTINGS > "ProjectTests" target > "Debug" configuration > Values

✅ SETTINGS > "ProjectTests" target > "Release" configuration > Base configuration

✅ SETTINGS > "ProjectTests" target > "Release" configuration > Values

✅ SETTINGS > "ProjectUITests" target > "Debug" configuration > Base configuration

❌ SETTINGS > "ProjectUITests" target > "Debug" configuration > Values

⚠️ Only in first (1):

  • PROVISIONING_PROFILE =

⚠️ Only in second (1):

  • TEST_TARGET_NAME = Project

✅ SETTINGS > "ProjectUITests" target > "Release" configuration > Base configuration

❌ SETTINGS > "ProjectUITests" target > "Release" configuration > Values

⚠️ Only in first (1):

  • PROVISIONING_PROFILE =

⚠️ Only in second (1):

  • TEST_TARGET_NAME = Project

❌ SOURCE_TREES > Root project

Output format: (<path>, <name>, <source_tree>)

⚠️ Only in first (8):

  • (AViewController.xib, nil, <group>) → (Group B, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)
  • (AnotherObjcClass.h, nil, <group>) → (Group B, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)
  • (AnotherObjcClass.m, nil, <group>) → (Group B, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)
  • (BarTests.swift, nil, <group>) → (ProjectTests, nil, <group>) → (nil, nil, <group>)
  • (LoginTests.swift, nil, <group>) → (ProjectUITests, nil, <group>) → (nil, nil, <group>)
  • (empty.png, nil, <group>) → (Screenshots, nil, <group>) → (ProjectUITests, nil, <group>) → (nil, nil, <group>)
  • (libMismatchingLibrary.a, nil, BUILT_PRODUCTS_DIR) → (nil, Products, <group>) → (nil, nil, <group>)
  • (time.png, nil, <group>) → (Resources, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)

⚠️ Only in second (11):

  • (Header4.h, nil, <group>) → (ProjectFramework, nil, <group>) → (nil, nil, <group>)
  • (Info.plist, nil, <group>) → (NewFramework, nil, <group>) → (nil, nil, <group>)
  • (ListResponse.json, nil, <group>) → (Responses, nil, <group>) → (ProjectTests, nil, <group>) → (nil, nil, <group>)
  • (MetricsTests.swift, nil, <group>) → (ProjectUITests, nil, <group>) → (nil, nil, <group>)
  • (MismatchingLibrary-Info.plist, nil, <group>) → (MismatchingLibrary, nil, <group>) → (nil, nil, <group>)
  • (MismatchingLibrary.framework, nil, BUILT_PRODUCTS_DIR) → (nil, Products, <group>) → (nil, nil, <group>)
  • (NewFramework.framework, nil, BUILT_PRODUCTS_DIR) → (nil, Products, <group>) → (nil, nil, <group>)
  • (NewFramework.h, nil, <group>) → (NewFramework, nil, <group>) → (nil, nil, <group>)
  • (Project.xcconfig, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)
  • (README.md, nil, <group>) → (nil, nil, <group>)
  • (Target.xcconfig, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)

✅ DEPENDENCIES > "MismatchingLibrary" target

❌ DEPENDENCIES > "Project" target

⚠️ Only in second (2):

  • (target=MismatchingLibrary)
  • (target=NewFramework)

✅ DEPENDENCIES > "ProjectFramework" target

✅ DEPENDENCIES > "ProjectTests" target

✅ DEPENDENCIES > "ProjectUITests" target

✅ LINKED_DEPENDENCIES > "MismatchingLibrary" target

❌ LINKED_DEPENDENCIES > "Project" target

⚠️ Only in second (2):

  • MismatchingLibrary.framework
  • NewFramework.framework

⚠️ Value mismatch (1):

  • ARKit.framework attributes

    • required
    • optional

✅ LINKED_DEPENDENCIES > "ProjectFramework" target

✅ LINKED_DEPENDENCIES > "ProjectTests" target

✅ LINKED_DEPENDENCIES > "ProjectUITests" target

❌ ATTRIBUTES > Root project

⚠️ Value mismatch (3):

  • LastSwiftUpdateCheck

    • 1110
    • 1030
  • LastUpgradeCheck

    • 1020
    • 1030
  • ORGANIZATIONNAME

    • Bloomberg LP
    • Another Organization

❌ ATTRIBUTES > "MismatchingLibrary" target

⚠️ Only in second (1):

  • LastSwiftMigration = 1110

❌ ATTRIBUTES > "Project" target

⚠️ Value mismatch (1):

  • LastSwiftMigration

    • 1140
    • 1020

✅ ATTRIBUTES > "ProjectFramework" target

✅ ATTRIBUTES > "ProjectTests" target

❌ ATTRIBUTES > "ProjectUITests" target

⚠️ Only in second (1):

  • TestTargetID = Project

✅ SWIFT_PACKAGES

diff --git a/CommandTests/Generated/html_side_by_side_format.2.a609f1e3.md b/CommandTests/Generated/html_side_by_side_format.2.a609f1e3.md index 7a12ad1..d5da524 100644 --- a/CommandTests/Generated/html_side_by_side_format.2.a609f1e3.md +++ b/CommandTests/Generated/html_side_by_side_format.2.a609f1e3.md @@ -247,6 +247,24 @@

❌ RESOURCES > "ProjectUITests" target

+
+

✅ RUN_SCRIPTS > "MismatchingLibrary" target

+
+
+

❌ RUN_SCRIPTS > "Project" target > "Second script" build phase

+
+
+

❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase

+
+
+

✅ RUN_SCRIPTS > "ProjectFramework" target

+
+
+

✅ RUN_SCRIPTS > "ProjectTests" target

+
+
+

✅ RUN_SCRIPTS > "ProjectUITests" target

+

❌ CONFIGURATIONS > Root project

diff --git a/CommandTests/Generated/html_side_by_side_format_verbose.2.1beb48e8.md b/CommandTests/Generated/html_side_by_side_format_verbose.2.1beb48e8.md index 99adeb3..a646efe 100644 --- a/CommandTests/Generated/html_side_by_side_format_verbose.2.1beb48e8.md +++ b/CommandTests/Generated/html_side_by_side_format_verbose.2.1beb48e8.md @@ -750,6 +750,87 @@ +
+

✅ RUN_SCRIPTS > "MismatchingLibrary" target

+
+
+

❌ RUN_SCRIPTS > "Project" target > "Second script" build phase

+ + + + + + + + + + + + + + + + +
FirstSecond
+ shellScript +
+ echo "First Hello, world!" + + + echo "second script" + +
+
+
+

❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase

+ + + + + + + + + + + + + + + + + + + + + + + +
FirstSecond
+ shellScript +
+ echo "Hello, World!" + + + echo "Hello, world?" + +
+ showEnvVarsInLog +
+ true + + false +
+
+
+

✅ RUN_SCRIPTS > "ProjectFramework" target

+
+
+

✅ RUN_SCRIPTS > "ProjectTests" target

+
+
+

✅ RUN_SCRIPTS > "ProjectUITests" target

+

❌ CONFIGURATIONS > Root project

diff --git a/CommandTests/Generated/list.0.a330395c.md b/CommandTests/Generated/list.0.a330395c.md index cd5a344..370127d 100644 --- a/CommandTests/Generated/list.0.a330395c.md +++ b/CommandTests/Generated/list.0.a330395c.md @@ -20,6 +20,7 @@ inclusion status when tags aren't explicitly specified. - HEADERS | Yes - SOURCES | Yes - RESOURCES | Yes +- RUN_SCRIPTS | Yes - CONFIGURATIONS | Yes - SETTINGS | Yes - RESOLVED_SETTINGS | No diff --git a/CommandTests/Generated/p1_p2.2.bac5a245.md b/CommandTests/Generated/p1_p2.2.bac5a245.md index 696f31d..264aa85 100644 --- a/CommandTests/Generated/p1_p2.2.bac5a245.md +++ b/CommandTests/Generated/p1_p2.2.bac5a245.md @@ -36,6 +36,12 @@ ✅ RESOURCES > "ProjectFramework" target ❌ RESOURCES > "ProjectTests" target ❌ RESOURCES > "ProjectUITests" target +✅ RUN_SCRIPTS > "MismatchingLibrary" target +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase +✅ RUN_SCRIPTS > "ProjectFramework" target +✅ RUN_SCRIPTS > "ProjectTests" target +✅ RUN_SCRIPTS > "ProjectUITests" target ❌ CONFIGURATIONS > Root project ❌ SETTINGS > Root project > "Debug" configuration > Base configuration ❌ SETTINGS > Root project > "Debug" configuration > Values diff --git a/CommandTests/Generated/p1_p2_Project_target.2.961f27cf.md b/CommandTests/Generated/p1_p2_Project_target.2.961f27cf.md index b643c48..64e1eff 100644 --- a/CommandTests/Generated/p1_p2_Project_target.2.961f27cf.md +++ b/CommandTests/Generated/p1_p2_Project_target.2.961f27cf.md @@ -16,6 +16,8 @@ ✅ HEADERS > "Project" target ❌ SOURCES > "Project" target ❌ RESOURCES > "Project" target +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase ❌ CONFIGURATIONS > Root project ❌ SETTINGS > Root project > "Debug" configuration > Base configuration ❌ SETTINGS > Root project > "Debug" configuration > Values diff --git a/CommandTests/Generated/p1_p2_Project_target_console_format.2.dfbdb9cf.md b/CommandTests/Generated/p1_p2_Project_target_console_format.2.dfbdb9cf.md index bdea661..3fe1dde 100644 --- a/CommandTests/Generated/p1_p2_Project_target_console_format.2.dfbdb9cf.md +++ b/CommandTests/Generated/p1_p2_Project_target_console_format.2.dfbdb9cf.md @@ -16,6 +16,8 @@ ✅ HEADERS > "Project" target ❌ SOURCES > "Project" target ❌ RESOURCES > "Project" target +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase ❌ CONFIGURATIONS > Root project ❌ SETTINGS > Root project > "Debug" configuration > Base configuration ❌ SETTINGS > Root project > "Debug" configuration > Values diff --git a/CommandTests/Generated/p1_p2_Project_target_console_format_verbose.2.ba4ce842.md b/CommandTests/Generated/p1_p2_Project_target_console_format_verbose.2.ba4ce842.md index 199742e..eabdc11 100644 --- a/CommandTests/Generated/p1_p2_Project_target_console_format_verbose.2.ba4ce842.md +++ b/CommandTests/Generated/p1_p2_Project_target_console_format_verbose.2.ba4ce842.md @@ -78,6 +78,32 @@ • Project/Resources/time.png +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + +⚠️ Value mismatch (1): + + • shellScript + ◦ echo "First Hello, world!" + + ◦ echo "second script" + + + +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + +⚠️ Value mismatch (2): + + • shellScript + ◦ echo "Hello, World!" + + ◦ echo "Hello, world?" + + + • showEnvVarsInLog + ◦ true + ◦ false + + ❌ CONFIGURATIONS > Root project ⚠️ Only in second (1): diff --git a/CommandTests/Generated/p1_p2_Project_target_json_format.2.1b44ee6e.md b/CommandTests/Generated/p1_p2_Project_target_json_format.2.1b44ee6e.md index b9732b0..2516ba2 100644 --- a/CommandTests/Generated/p1_p2_Project_target_json_format.2.1b44ee6e.md +++ b/CommandTests/Generated/p1_p2_Project_target_json_format.2.1b44ee6e.md @@ -157,6 +157,51 @@ ], "tag" : "resources" }, + { + "context" : [ + "\"Project\" target", + "\"Second script\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"First Hello, world!\"\n", + "second" : "echo \"second script\"\n" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"Project\" target", + "\"ShellScript\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"Hello, World!\"\n", + "second" : "echo \"Hello, world?\"\n" + }, + { + "context" : "showEnvVarsInLog", + "first" : "true", + "second" : "false" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, { "context" : [ "Root project" diff --git a/CommandTests/Generated/p1_p2_Project_target_json_format_verbose.2.bcad53ce.md b/CommandTests/Generated/p1_p2_Project_target_json_format_verbose.2.bcad53ce.md index 328408d..4ee588b 100644 --- a/CommandTests/Generated/p1_p2_Project_target_json_format_verbose.2.bcad53ce.md +++ b/CommandTests/Generated/p1_p2_Project_target_json_format_verbose.2.bcad53ce.md @@ -157,6 +157,51 @@ ], "tag" : "resources" }, + { + "context" : [ + "\"Project\" target", + "\"Second script\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"First Hello, world!\"\n", + "second" : "echo \"second script\"\n" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"Project\" target", + "\"ShellScript\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"Hello, World!\"\n", + "second" : "echo \"Hello, world?\"\n" + }, + { + "context" : "showEnvVarsInLog", + "first" : "true", + "second" : "false" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, { "context" : [ "Root project" diff --git a/CommandTests/Generated/p1_p2_Project_target_markdown_format.2.d851dd25.md b/CommandTests/Generated/p1_p2_Project_target_markdown_format.2.d851dd25.md index 3611e02..fe94680 100644 --- a/CommandTests/Generated/p1_p2_Project_target_markdown_format.2.d851dd25.md +++ b/CommandTests/Generated/p1_p2_Project_target_markdown_format.2.d851dd25.md @@ -33,6 +33,12 @@ ## ❌ RESOURCES > "Project" target +## ❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + + +## ❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + + ## ❌ CONFIGURATIONS > Root project diff --git a/CommandTests/Generated/p1_p2_Project_target_markdown_format_verbose.2.f582a13e.md b/CommandTests/Generated/p1_p2_Project_target_markdown_format_verbose.2.f582a13e.md index 104aab1..8e7a660 100644 --- a/CommandTests/Generated/p1_p2_Project_target_markdown_format_verbose.2.f582a13e.md +++ b/CommandTests/Generated/p1_p2_Project_target_markdown_format_verbose.2.f582a13e.md @@ -95,6 +95,36 @@ +## ❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + + +### ⚠️ Value mismatch (1): + + - `shellScript` + - `echo "First Hello, world!" +` + - `echo "second script" +` + + + +## ❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + + +### ⚠️ Value mismatch (2): + + - `shellScript` + - `echo "Hello, World!" +` + - `echo "Hello, world?" +` + + - `showEnvVarsInLog` + - `true` + - `false` + + + ## ❌ CONFIGURATIONS > Root project diff --git a/CommandTests/Generated/p1_p2_Project_target_verbose.2.6f518e43.md b/CommandTests/Generated/p1_p2_Project_target_verbose.2.6f518e43.md index f424f24..9b6c6fa 100644 --- a/CommandTests/Generated/p1_p2_Project_target_verbose.2.6f518e43.md +++ b/CommandTests/Generated/p1_p2_Project_target_verbose.2.6f518e43.md @@ -78,6 +78,32 @@ • Project/Resources/time.png +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + +⚠️ Value mismatch (1): + + • shellScript + ◦ echo "First Hello, world!" + + ◦ echo "second script" + + + +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + +⚠️ Value mismatch (2): + + • shellScript + ◦ echo "Hello, World!" + + ◦ echo "Hello, world?" + + + • showEnvVarsInLog + ◦ true + ◦ false + + ❌ CONFIGURATIONS > Root project ⚠️ Only in second (1): diff --git a/CommandTests/Generated/p1_p2_console_format.2.9841a8d7.md b/CommandTests/Generated/p1_p2_console_format.2.9841a8d7.md index 99c05cc..06baf69 100644 --- a/CommandTests/Generated/p1_p2_console_format.2.9841a8d7.md +++ b/CommandTests/Generated/p1_p2_console_format.2.9841a8d7.md @@ -36,6 +36,12 @@ ✅ RESOURCES > "ProjectFramework" target ❌ RESOURCES > "ProjectTests" target ❌ RESOURCES > "ProjectUITests" target +✅ RUN_SCRIPTS > "MismatchingLibrary" target +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase +✅ RUN_SCRIPTS > "ProjectFramework" target +✅ RUN_SCRIPTS > "ProjectTests" target +✅ RUN_SCRIPTS > "ProjectUITests" target ❌ CONFIGURATIONS > Root project ❌ SETTINGS > Root project > "Debug" configuration > Base configuration ❌ SETTINGS > Root project > "Debug" configuration > Values diff --git a/CommandTests/Generated/p1_p2_console_format_verbose.2.40a241bd.md b/CommandTests/Generated/p1_p2_console_format_verbose.2.40a241bd.md index f8c5d7f..3fd2d5b 100644 --- a/CommandTests/Generated/p1_p2_console_format_verbose.2.40a241bd.md +++ b/CommandTests/Generated/p1_p2_console_format_verbose.2.40a241bd.md @@ -181,6 +181,36 @@ • ProjectUITests/Screenshots/empty.png +✅ RUN_SCRIPTS > "MismatchingLibrary" target +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + +⚠️ Value mismatch (1): + + • shellScript + ◦ echo "First Hello, world!" + + ◦ echo "second script" + + + +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + +⚠️ Value mismatch (2): + + • shellScript + ◦ echo "Hello, World!" + + ◦ echo "Hello, world?" + + + • showEnvVarsInLog + ◦ true + ◦ false + + +✅ RUN_SCRIPTS > "ProjectFramework" target +✅ RUN_SCRIPTS > "ProjectTests" target +✅ RUN_SCRIPTS > "ProjectUITests" target ❌ CONFIGURATIONS > Root project ⚠️ Only in second (1): diff --git a/CommandTests/Generated/p1_p2_json_format.2.e54c06ce.md b/CommandTests/Generated/p1_p2_json_format.2.e54c06ce.md index 515f0e6..1aad1c1 100644 --- a/CommandTests/Generated/p1_p2_json_format.2.e54c06ce.md +++ b/CommandTests/Generated/p1_p2_json_format.2.e54c06ce.md @@ -471,6 +471,111 @@ ], "tag" : "resources" }, + { + "context" : [ + "\"MismatchingLibrary\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"Project\" target", + "\"Second script\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"First Hello, world!\"\n", + "second" : "echo \"second script\"\n" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"Project\" target", + "\"ShellScript\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"Hello, World!\"\n", + "second" : "echo \"Hello, world?\"\n" + }, + { + "context" : "showEnvVarsInLog", + "first" : "true", + "second" : "false" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"ProjectFramework\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"ProjectTests\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"ProjectUITests\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, { "context" : [ "Root project" diff --git a/CommandTests/Generated/p1_p2_json_format_verbose.2.0e0a3eb6.md b/CommandTests/Generated/p1_p2_json_format_verbose.2.0e0a3eb6.md index 6451bb7..f52d9fe 100644 --- a/CommandTests/Generated/p1_p2_json_format_verbose.2.0e0a3eb6.md +++ b/CommandTests/Generated/p1_p2_json_format_verbose.2.0e0a3eb6.md @@ -471,6 +471,111 @@ ], "tag" : "resources" }, + { + "context" : [ + "\"MismatchingLibrary\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"Project\" target", + "\"Second script\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"First Hello, world!\"\n", + "second" : "echo \"second script\"\n" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"Project\" target", + "\"ShellScript\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"Hello, World!\"\n", + "second" : "echo \"Hello, world?\"\n" + }, + { + "context" : "showEnvVarsInLog", + "first" : "true", + "second" : "false" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"ProjectFramework\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"ProjectTests\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"ProjectUITests\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, { "context" : [ "Root project" diff --git a/CommandTests/Generated/p1_p2_markdown_format.2.1e09644b.md b/CommandTests/Generated/p1_p2_markdown_format.2.1e09644b.md index d8d177e..4c31b0c 100644 --- a/CommandTests/Generated/p1_p2_markdown_format.2.1e09644b.md +++ b/CommandTests/Generated/p1_p2_markdown_format.2.1e09644b.md @@ -93,6 +93,24 @@ ## ❌ RESOURCES > "ProjectUITests" target +## ✅ RUN_SCRIPTS > "MismatchingLibrary" target + + +## ❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + + +## ❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + + +## ✅ RUN_SCRIPTS > "ProjectFramework" target + + +## ✅ RUN_SCRIPTS > "ProjectTests" target + + +## ✅ RUN_SCRIPTS > "ProjectUITests" target + + ## ❌ CONFIGURATIONS > Root project diff --git a/CommandTests/Generated/p1_p2_markdown_format_verbose.2.ac528bab.md b/CommandTests/Generated/p1_p2_markdown_format_verbose.2.ac528bab.md index 966cca1..c44a660 100644 --- a/CommandTests/Generated/p1_p2_markdown_format_verbose.2.ac528bab.md +++ b/CommandTests/Generated/p1_p2_markdown_format_verbose.2.ac528bab.md @@ -238,6 +238,48 @@ +## ✅ RUN_SCRIPTS > "MismatchingLibrary" target + + +## ❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + + +### ⚠️ Value mismatch (1): + + - `shellScript` + - `echo "First Hello, world!" +` + - `echo "second script" +` + + + +## ❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + + +### ⚠️ Value mismatch (2): + + - `shellScript` + - `echo "Hello, World!" +` + - `echo "Hello, world?" +` + + - `showEnvVarsInLog` + - `true` + - `false` + + + +## ✅ RUN_SCRIPTS > "ProjectFramework" target + + +## ✅ RUN_SCRIPTS > "ProjectTests" target + + +## ✅ RUN_SCRIPTS > "ProjectUITests" target + + ## ❌ CONFIGURATIONS > Root project diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag.2.6a74f67b.md b/CommandTests/Generated/p1_p2_run_scripts_tag.2.6a74f67b.md new file mode 100644 index 0000000..ea5acd5 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag.2.6a74f67b.md @@ -0,0 +1,19 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts"] +``` + +# Expected exit code +2 + +# Expected output +``` +✅ RUN_SCRIPTS > "MismatchingLibrary" target +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase +✅ RUN_SCRIPTS > "ProjectFramework" target +✅ RUN_SCRIPTS > "ProjectTests" target +✅ RUN_SCRIPTS > "ProjectUITests" target + + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target.1.30052ab6.md b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target.1.30052ab6.md new file mode 100644 index 0000000..61d0529 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target.1.30052ab6.md @@ -0,0 +1,13 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "NewFramework"] +``` + +# Expected exit code +1 + +# Expected output +``` +ERROR: Cannot find target "NewFramework" in both projects + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_console_format.1.1fdd966d.md b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_console_format.1.1fdd966d.md new file mode 100644 index 0000000..9e8d5de --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_console_format.1.1fdd966d.md @@ -0,0 +1,13 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "NewFramework", "-f", "console"] +``` + +# Expected exit code +1 + +# Expected output +``` +ERROR: Cannot find target "NewFramework" in both projects + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_console_format_verbose.1.a1ddaf56.md b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_console_format_verbose.1.a1ddaf56.md new file mode 100644 index 0000000..662c63e --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_console_format_verbose.1.a1ddaf56.md @@ -0,0 +1,13 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "NewFramework", "-f", "console", "-v"] +``` + +# Expected exit code +1 + +# Expected output +``` +ERROR: Cannot find target "NewFramework" in both projects + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_json_format.1.8d53e8aa.md b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_json_format.1.8d53e8aa.md new file mode 100644 index 0000000..a35e237 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_json_format.1.8d53e8aa.md @@ -0,0 +1,13 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "NewFramework", "-f", "json"] +``` + +# Expected exit code +1 + +# Expected output +``` +ERROR: Cannot find target "NewFramework" in both projects + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_json_format_verbose.1.46488720.md b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_json_format_verbose.1.46488720.md new file mode 100644 index 0000000..3d2b683 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_json_format_verbose.1.46488720.md @@ -0,0 +1,13 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "NewFramework", "-f", "json", "-v"] +``` + +# Expected exit code +1 + +# Expected output +``` +ERROR: Cannot find target "NewFramework" in both projects + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_markdown_format.1.7c1a3a53.md b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_markdown_format.1.7c1a3a53.md new file mode 100644 index 0000000..1a2aea3 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_markdown_format.1.7c1a3a53.md @@ -0,0 +1,13 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "NewFramework", "-f", "markdown"] +``` + +# Expected exit code +1 + +# Expected output +``` +ERROR: Cannot find target "NewFramework" in both projects + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_markdown_format_verbose.1.a39cf85f.md b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_markdown_format_verbose.1.a39cf85f.md new file mode 100644 index 0000000..ff969cb --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_markdown_format_verbose.1.a39cf85f.md @@ -0,0 +1,13 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "NewFramework", "-f", "markdown", "-v"] +``` + +# Expected exit code +1 + +# Expected output +``` +ERROR: Cannot find target "NewFramework" in both projects + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_verbose.1.89d78c8a.md b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_verbose.1.89d78c8a.md new file mode 100644 index 0000000..9d514fb --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_NewFramework_target_verbose.1.89d78c8a.md @@ -0,0 +1,13 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "NewFramework", "-v"] +``` + +# Expected exit code +1 + +# Expected output +``` +ERROR: Cannot find target "NewFramework" in both projects + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target.2.c652102e.md b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target.2.c652102e.md new file mode 100644 index 0000000..ec71d91 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target.2.c652102e.md @@ -0,0 +1,15 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "Project"] +``` + +# Expected exit code +2 + +# Expected output +``` +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_console_format.2.86651d78.md b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_console_format.2.86651d78.md new file mode 100644 index 0000000..efff8c7 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_console_format.2.86651d78.md @@ -0,0 +1,15 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "Project", "-f", "console"] +``` + +# Expected exit code +2 + +# Expected output +``` +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_console_format_verbose.2.57c6423c.md b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_console_format_verbose.2.57c6423c.md new file mode 100644 index 0000000..5f3a6e2 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_console_format_verbose.2.57c6423c.md @@ -0,0 +1,39 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "Project", "-f", "console", "-v"] +``` + +# Expected exit code +2 + +# Expected output +``` +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + +⚠️ Value mismatch (1): + + • shellScript + ◦ echo "First Hello, world!" + + ◦ echo "second script" + + + +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + +⚠️ Value mismatch (2): + + • shellScript + ◦ echo "Hello, World!" + + ◦ echo "Hello, world?" + + + • showEnvVarsInLog + ◦ true + ◦ false + + + + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_json_format.2.651b03e2.md b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_json_format.2.651b03e2.md new file mode 100644 index 0000000..ce98f58 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_json_format.2.651b03e2.md @@ -0,0 +1,59 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "Project", "-f", "json"] +``` + +# Expected exit code +2 + +# Expected output +``` +[ + { + "context" : [ + "\"Project\" target", + "\"Second script\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"First Hello, world!\"\n", + "second" : "echo \"second script\"\n" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"Project\" target", + "\"ShellScript\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"Hello, World!\"\n", + "second" : "echo \"Hello, world?\"\n" + }, + { + "context" : "showEnvVarsInLog", + "first" : "true", + "second" : "false" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + } +] + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_json_format_verbose.2.d7bb4f9f.md b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_json_format_verbose.2.d7bb4f9f.md new file mode 100644 index 0000000..2b72e1e --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_json_format_verbose.2.d7bb4f9f.md @@ -0,0 +1,59 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "Project", "-f", "json", "-v"] +``` + +# Expected exit code +2 + +# Expected output +``` +[ + { + "context" : [ + "\"Project\" target", + "\"Second script\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"First Hello, world!\"\n", + "second" : "echo \"second script\"\n" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"Project\" target", + "\"ShellScript\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"Hello, World!\"\n", + "second" : "echo \"Hello, world?\"\n" + }, + { + "context" : "showEnvVarsInLog", + "first" : "true", + "second" : "false" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + } +] + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_markdown_format.2.dd412257.md b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_markdown_format.2.dd412257.md new file mode 100644 index 0000000..999e10f --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_markdown_format.2.dd412257.md @@ -0,0 +1,19 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "Project", "-f", "markdown"] +``` + +# Expected exit code +2 + +# Expected output +``` + +## ❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + + +## ❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + + + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_markdown_format_verbose.2.7f01b3b3.md b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_markdown_format_verbose.2.7f01b3b3.md new file mode 100644 index 0000000..d6935ec --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_markdown_format_verbose.2.7f01b3b3.md @@ -0,0 +1,43 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "Project", "-f", "markdown", "-v"] +``` + +# Expected exit code +2 + +# Expected output +``` + +## ❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + + +### ⚠️ Value mismatch (1): + + - `shellScript` + - `echo "First Hello, world!" +` + - `echo "second script" +` + + + +## ❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + + +### ⚠️ Value mismatch (2): + + - `shellScript` + - `echo "Hello, World!" +` + - `echo "Hello, world?" +` + + - `showEnvVarsInLog` + - `true` + - `false` + + + + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_verbose.2.da061135.md b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_verbose.2.da061135.md new file mode 100644 index 0000000..317167e --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_Project_target_verbose.2.da061135.md @@ -0,0 +1,39 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-t", "Project", "-v"] +``` + +# Expected exit code +2 + +# Expected output +``` +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + +⚠️ Value mismatch (1): + + • shellScript + ◦ echo "First Hello, world!" + + ◦ echo "second script" + + + +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + +⚠️ Value mismatch (2): + + • shellScript + ◦ echo "Hello, World!" + + ◦ echo "Hello, world?" + + + • showEnvVarsInLog + ◦ true + ◦ false + + + + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_console_format.2.863601f6.md b/CommandTests/Generated/p1_p2_run_scripts_tag_console_format.2.863601f6.md new file mode 100644 index 0000000..811747a --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_console_format.2.863601f6.md @@ -0,0 +1,19 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-f", "console"] +``` + +# Expected exit code +2 + +# Expected output +``` +✅ RUN_SCRIPTS > "MismatchingLibrary" target +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase +✅ RUN_SCRIPTS > "ProjectFramework" target +✅ RUN_SCRIPTS > "ProjectTests" target +✅ RUN_SCRIPTS > "ProjectUITests" target + + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_console_format_verbose.2.de59bc4a.md b/CommandTests/Generated/p1_p2_run_scripts_tag_console_format_verbose.2.de59bc4a.md new file mode 100644 index 0000000..f4be8f8 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_console_format_verbose.2.de59bc4a.md @@ -0,0 +1,43 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-f", "console", "-v"] +``` + +# Expected exit code +2 + +# Expected output +``` +✅ RUN_SCRIPTS > "MismatchingLibrary" target +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + +⚠️ Value mismatch (1): + + • shellScript + ◦ echo "First Hello, world!" + + ◦ echo "second script" + + + +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + +⚠️ Value mismatch (2): + + • shellScript + ◦ echo "Hello, World!" + + ◦ echo "Hello, world?" + + + • showEnvVarsInLog + ◦ true + ◦ false + + +✅ RUN_SCRIPTS > "ProjectFramework" target +✅ RUN_SCRIPTS > "ProjectTests" target +✅ RUN_SCRIPTS > "ProjectUITests" target + + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_json_format.2.7dd2f1b0.md b/CommandTests/Generated/p1_p2_run_scripts_tag_json_format.2.7dd2f1b0.md new file mode 100644 index 0000000..f202924 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_json_format.2.7dd2f1b0.md @@ -0,0 +1,119 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-f", "json"] +``` + +# Expected exit code +2 + +# Expected output +``` +[ + { + "context" : [ + "\"MismatchingLibrary\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"Project\" target", + "\"Second script\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"First Hello, world!\"\n", + "second" : "echo \"second script\"\n" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"Project\" target", + "\"ShellScript\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"Hello, World!\"\n", + "second" : "echo \"Hello, world?\"\n" + }, + { + "context" : "showEnvVarsInLog", + "first" : "true", + "second" : "false" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"ProjectFramework\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"ProjectTests\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"ProjectUITests\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + } +] + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_json_format_verbose.2.7dc66165.md b/CommandTests/Generated/p1_p2_run_scripts_tag_json_format_verbose.2.7dc66165.md new file mode 100644 index 0000000..ecd75c0 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_json_format_verbose.2.7dc66165.md @@ -0,0 +1,119 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-f", "json", "-v"] +``` + +# Expected exit code +2 + +# Expected output +``` +[ + { + "context" : [ + "\"MismatchingLibrary\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"Project\" target", + "\"Second script\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"First Hello, world!\"\n", + "second" : "echo \"second script\"\n" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"Project\" target", + "\"ShellScript\" build phase" + ], + "differentValues" : [ + { + "context" : "shellScript", + "first" : "echo \"Hello, World!\"\n", + "second" : "echo \"Hello, world?\"\n" + }, + { + "context" : "showEnvVarsInLog", + "first" : "true", + "second" : "false" + } + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"ProjectFramework\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"ProjectTests\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + }, + { + "context" : [ + "\"ProjectUITests\" target" + ], + "differentValues" : [ + + ], + "onlyInFirst" : [ + + ], + "onlyInSecond" : [ + + ], + "tag" : "run_scripts" + } +] + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_markdown_format.2.d3f5c727.md b/CommandTests/Generated/p1_p2_run_scripts_tag_markdown_format.2.d3f5c727.md new file mode 100644 index 0000000..543a997 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_markdown_format.2.d3f5c727.md @@ -0,0 +1,31 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-f", "markdown"] +``` + +# Expected exit code +2 + +# Expected output +``` + +## ✅ RUN_SCRIPTS > "MismatchingLibrary" target + + +## ❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + + +## ❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + + +## ✅ RUN_SCRIPTS > "ProjectFramework" target + + +## ✅ RUN_SCRIPTS > "ProjectTests" target + + +## ✅ RUN_SCRIPTS > "ProjectUITests" target + + + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_markdown_format_verbose.2.d9b5d912.md b/CommandTests/Generated/p1_p2_run_scripts_tag_markdown_format_verbose.2.d9b5d912.md new file mode 100644 index 0000000..82b4741 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_markdown_format_verbose.2.d9b5d912.md @@ -0,0 +1,55 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-f", "markdown", "-v"] +``` + +# Expected exit code +2 + +# Expected output +``` + +## ✅ RUN_SCRIPTS > "MismatchingLibrary" target + + +## ❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + + +### ⚠️ Value mismatch (1): + + - `shellScript` + - `echo "First Hello, world!" +` + - `echo "second script" +` + + + +## ❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + + +### ⚠️ Value mismatch (2): + + - `shellScript` + - `echo "Hello, World!" +` + - `echo "Hello, world?" +` + + - `showEnvVarsInLog` + - `true` + - `false` + + + +## ✅ RUN_SCRIPTS > "ProjectFramework" target + + +## ✅ RUN_SCRIPTS > "ProjectTests" target + + +## ✅ RUN_SCRIPTS > "ProjectUITests" target + + + +``` diff --git a/CommandTests/Generated/p1_p2_run_scripts_tag_verbose.2.d42c21b9.md b/CommandTests/Generated/p1_p2_run_scripts_tag_verbose.2.d42c21b9.md new file mode 100644 index 0000000..3d7d0e0 --- /dev/null +++ b/CommandTests/Generated/p1_p2_run_scripts_tag_verbose.2.d42c21b9.md @@ -0,0 +1,43 @@ +# Command +```json +["-p1", "{ios_project_1}", "-p2", "{ios_project_2}", "-g", "run_scripts", "-v"] +``` + +# Expected exit code +2 + +# Expected output +``` +✅ RUN_SCRIPTS > "MismatchingLibrary" target +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + +⚠️ Value mismatch (1): + + • shellScript + ◦ echo "First Hello, world!" + + ◦ echo "second script" + + + +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + +⚠️ Value mismatch (2): + + • shellScript + ◦ echo "Hello, World!" + + ◦ echo "Hello, world?" + + + • showEnvVarsInLog + ◦ true + ◦ false + + +✅ RUN_SCRIPTS > "ProjectFramework" target +✅ RUN_SCRIPTS > "ProjectTests" target +✅ RUN_SCRIPTS > "ProjectUITests" target + + +``` diff --git a/CommandTests/Generated/p1_p2_verbose.2.fe666557.md b/CommandTests/Generated/p1_p2_verbose.2.fe666557.md index e90508e..5c1bff8 100644 --- a/CommandTests/Generated/p1_p2_verbose.2.fe666557.md +++ b/CommandTests/Generated/p1_p2_verbose.2.fe666557.md @@ -181,6 +181,36 @@ • ProjectUITests/Screenshots/empty.png +✅ RUN_SCRIPTS > "MismatchingLibrary" target +❌ RUN_SCRIPTS > "Project" target > "Second script" build phase + +⚠️ Value mismatch (1): + + • shellScript + ◦ echo "First Hello, world!" + + ◦ echo "second script" + + + +❌ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + +⚠️ Value mismatch (2): + + • shellScript + ◦ echo "Hello, World!" + + ◦ echo "Hello, world?" + + + • showEnvVarsInLog + ◦ true + ◦ false + + +✅ RUN_SCRIPTS > "ProjectFramework" target +✅ RUN_SCRIPTS > "ProjectTests" target +✅ RUN_SCRIPTS > "ProjectUITests" target ❌ CONFIGURATIONS > Root project ⚠️ Only in second (1): diff --git a/CommandTests/Generated/swift_packages_verbose.2.0494a7b3.md b/CommandTests/Generated/swift_packages_verbose.2.0494a7b3.md index 3d465d2..fe4296f 100644 --- a/CommandTests/Generated/swift_packages_verbose.2.0494a7b3.md +++ b/CommandTests/Generated/swift_packages_verbose.2.0494a7b3.md @@ -16,6 +16,7 @@ ✅ HEADERS > "App" target ✅ SOURCES > "App" target ✅ RESOURCES > "App" target +✅ RUN_SCRIPTS > "App" target ✅ CONFIGURATIONS > Root project ✅ SETTINGS > Root project > "Debug" configuration > Base configuration ✅ SETTINGS > Root project > "Debug" configuration > Values diff --git a/CommandTests/generated_test_commands.json b/CommandTests/generated_test_commands.json index b0498e2..0827e2b 100644 --- a/CommandTests/generated_test_commands.json +++ b/CommandTests/generated_test_commands.json @@ -5,6 +5,7 @@ "targets", "headers", "resources", + "run_scripts", "configurations", "settings", "sources", diff --git a/Documentation/Comparators.md b/Documentation/Comparators.md index ecc399c..9dfaf6d 100644 --- a/Documentation/Comparators.md +++ b/Documentation/Comparators.md @@ -46,6 +46,10 @@ As the comparator uses `xcodebuild -showBuildSettings` under the hood, it can be Compares resources i.e. files copied to the resources directory. +### `run_scripts` + +Compares Run Script build phases including the name, properties, and input and output file lists. + ### `settings` Compares raw project and target level build settings values. diff --git a/Fixtures/ios_project_1/Project.xcodeproj/project.pbxproj b/Fixtures/ios_project_1/Project.xcodeproj/project.pbxproj index e417792..971859b 100644 --- a/Fixtures/ios_project_1/Project.xcodeproj/project.pbxproj +++ b/Fixtures/ios_project_1/Project.xcodeproj/project.pbxproj @@ -308,6 +308,8 @@ 2E26637122B7F52500BA59BC /* Frameworks */, 2E26637222B7F52500BA59BC /* Resources */, 2EB291E8230B29B300C9EB4A /* Embed Frameworks */, + BF3DE30028BFE0710011B308 /* ShellScript */, + BF065C3228C26DF900FEC27F /* Second script */, ); buildRules = ( ); @@ -479,6 +481,44 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + BF065C3228C26DF900FEC27F /* Second script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Second script"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"First Hello, world!\"\n"; + }; + BF3DE30028BFE0710011B308 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"Hello, World!\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 2E26637022B7F52500BA59BC /* Sources */ = { isa = PBXSourcesBuildPhase; diff --git a/Fixtures/ios_project_2/Project.xcodeproj/project.pbxproj b/Fixtures/ios_project_2/Project.xcodeproj/project.pbxproj index e771413..831bf3e 100644 --- a/Fixtures/ios_project_2/Project.xcodeproj/project.pbxproj +++ b/Fixtures/ios_project_2/Project.xcodeproj/project.pbxproj @@ -371,6 +371,8 @@ 2E26637122B7F52500BA59BC /* Frameworks */, 2E26637222B7F52500BA59BC /* Resources */, 2EFBAADB22B9A34600AA5E95 /* Embed Frameworks */, + BF3DE30228BFE0930011B308 /* ShellScript */, + BF065C3328C2778C00FEC27F /* Second script */, ); buildRules = ( ); @@ -585,6 +587,45 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + BF065C3328C2778C00FEC27F /* Second script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Second script"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"second script\"\n"; + }; + BF3DE30228BFE0930011B308 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"Hello, world?\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 2E26637022B7F52500BA59BC /* Sources */ = { isa = PBXSourcesBuildPhase; diff --git a/Sources/XCDiffCore/Comparator/RunScriptComparator.swift b/Sources/XCDiffCore/Comparator/RunScriptComparator.swift new file mode 100644 index 0000000..87af3b2 --- /dev/null +++ b/Sources/XCDiffCore/Comparator/RunScriptComparator.swift @@ -0,0 +1,160 @@ +// +// Copyright 2022 Bloomberg Finance L.P. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation +import XcodeProj + +final class RunScriptComparator: Comparator { + let tag = "run_scripts" + private let targetsHelper = TargetsHelper() + + func compare(_ first: ProjectDescriptor, + _ second: ProjectDescriptor, + parameters: ComparatorParameters) throws -> [CompareResult] { + return try targetsHelper + .commonTargets(first, second, parameters: parameters) + .flatMap { try compare($0, $1) } + } + + // MARK: - Private + + private func compare(_ first: PBXTarget, + _ second: PBXTarget) throws -> [CompareResult] { + let context = ["\"\(first.name)\" target"] + let firstDescriptors = descriptors(from: first) + let secondDescriptors = descriptors(from: second) + let firstGrouped = Dictionary(grouping: firstDescriptors, by: { $0.name }) + let secondGrouped = Dictionary(grouping: secondDescriptors, by: { $0.name }) + let commonKeys = Set(firstGrouped.keys).intersection(secondGrouped.keys) + let compareResult = try commonKeys.sorted().flatMap { + try compare(firstGrouped[$0]!, + secondGrouped[$0]!, + context: context + ["\"\($0)\" build phase"]) + } + guard !compareResult.isEmpty else { + return [result(context: context)] + } + return compareResult + } + + private func compare(_ first: [RunScriptBuildPhaseDescriptor], + _ second: [RunScriptBuildPhaseDescriptor], + context: [String]) throws -> [CompareResult] { + let count = max(first.count, second.count) + return try (0 ..< count).map { try compare(first[safe: $0], second[safe: $0], context: context) } + } + + private func compare(_ first: RunScriptBuildPhaseDescriptor?, + _ second: RunScriptBuildPhaseDescriptor?, + context: [String]) throws -> CompareResult { + guard let first = first else { + return result(context: context, + description: "The build phase does not exist in the first project", + onlyInSecond: ["Duplicated build phase name"]) + } + guard let second = second else { + return result(context: context, + description: "The build phase does not exist in the second project", + onlyInFirst: ["Duplicated build phase name"]) + } + + let properties = first.differentValues(second: second) + return result(context: context, + differentValues: properties) + } + + private func descriptors(from target: PBXTarget) -> [RunScriptBuildPhaseDescriptor] { + return target.buildPhases.compactMap { + guard let runScriptBuildPhase = $0 as? PBXShellScriptBuildPhase else { return nil } + + return RunScriptBuildPhaseDescriptor( + name: runScriptBuildPhase.name()!, + inputPaths: runScriptBuildPhase.inputPaths, + outputPaths: runScriptBuildPhase.outputPaths, + inputFileListPaths: runScriptBuildPhase.inputFileListPaths, + outputFileListPaths: runScriptBuildPhase.outputFileListPaths, + shellPath: runScriptBuildPhase.shellPath, + shellScript: runScriptBuildPhase.shellScript, + showEnvVarsInLog: runScriptBuildPhase.showEnvVarsInLog, + alwaysOutOfDate: runScriptBuildPhase.alwaysOutOfDate, + dependencyFile: runScriptBuildPhase.dependencyFile + ) + } + } +} + +private struct RunScriptBuildPhaseDescriptor: Equatable { + let name: String + let inputPaths: [String]? + let outputPaths: [String]? + let inputFileListPaths: [String]? + let outputFileListPaths: [String]? + let shellPath: String? + let shellScript: String? + let showEnvVarsInLog: Bool + let alwaysOutOfDate: Bool + let dependencyFile: String? + + func differentValues(second: RunScriptBuildPhaseDescriptor) -> [CompareResult.DifferentValues] { + var result = [CompareResult.DifferentValues]() + if inputPaths != second.inputPaths { + result.append(.init(context: "inputPaths", + first: "\(describe(inputPaths))", + second: "\(describe(second.inputPaths))")) + } + if outputPaths != second.outputPaths { + result.append(.init(context: "outputPaths", + first: "\(describe(outputPaths))", + second: "\(describe(second.outputPaths))")) + } + if shellPath != second.shellPath { + result.append(.init(context: "shellPath", + first: "\(describe(shellPath))", + second: "\(describe(second.shellPath))")) + } + if shellScript != second.shellScript { + result.append(.init(context: "shellScript", + first: "\(describe(shellScript))", + second: "\(describe(second.shellScript))")) + } + if showEnvVarsInLog != second.showEnvVarsInLog { + result.append(.init(context: "showEnvVarsInLog", + first: "\(showEnvVarsInLog)", + second: "\(second.showEnvVarsInLog)")) + } + if alwaysOutOfDate != second.alwaysOutOfDate { + result.append(.init(context: "alwaysOutOfDate", + first: "\(alwaysOutOfDate)", + second: "\(second.alwaysOutOfDate)")) + } + if dependencyFile != second.dependencyFile { + result.append(.init(context: "dependencyFile", + first: "\(describe(dependencyFile))", + second: "\(describe(second.dependencyFile))")) + } + if inputFileListPaths != second.inputFileListPaths { + result.append(.init(context: "inputFileListPaths", + first: "\(describe(inputFileListPaths))", + second: "\(describe(second.inputFileListPaths))")) + } + if outputFileListPaths != second.outputFileListPaths { + result.append(.init(context: "outputFileListPaths", + first: "\(describe(outputFileListPaths))", + second: "\(describe(second.outputFileListPaths))")) + } + return result + } +} diff --git a/Sources/XCDiffCore/ComparatorType.swift b/Sources/XCDiffCore/ComparatorType.swift index 6921fa9..f217cdf 100644 --- a/Sources/XCDiffCore/ComparatorType.swift +++ b/Sources/XCDiffCore/ComparatorType.swift @@ -24,6 +24,7 @@ public enum ComparatorType { case headers case sources case resources + case runScripts case configurations case settings case resolvedSettings @@ -55,6 +56,8 @@ public enum ComparatorType { return SourcesComparator() case .resources: return ResourcesComparator() + case .runScripts: + return RunScriptComparator() case .configurations: return ConfigurationsComparator() case .settings: @@ -87,6 +90,7 @@ public extension Array where Element == ComparatorType { .headers, .sources, .resources, + .runScripts, .configurations, .settings, .resolvedSettings, @@ -107,6 +111,7 @@ public extension Array where Element == ComparatorType { .headers, .sources, .resources, + .runScripts, .configurations, .settings, .sourceTrees, diff --git a/Tests/XCDiffCommandTests/CommandsRunnerTests.swift b/Tests/XCDiffCommandTests/CommandsRunnerTests.swift index 4a82dd2..8d512d2 100644 --- a/Tests/XCDiffCommandTests/CommandsRunnerTests.swift +++ b/Tests/XCDiffCommandTests/CommandsRunnerTests.swift @@ -75,6 +75,12 @@ final class CommandsRunnerTests: XCTestCase { ✅ RESOURCES > "ProjectFramework" target ✅ RESOURCES > "ProjectTests" target ✅ RESOURCES > "ProjectUITests" target + ✅ RUN_SCRIPTS > "MismatchingLibrary" target + ✅ RUN_SCRIPTS > "Project" target > "Second script" build phase + ✅ RUN_SCRIPTS > "Project" target > "ShellScript" build phase + ✅ RUN_SCRIPTS > "ProjectFramework" target + ✅ RUN_SCRIPTS > "ProjectTests" target + ✅ RUN_SCRIPTS > "ProjectUITests" target ✅ CONFIGURATIONS > Root project ✅ SETTINGS > Root project > "Debug" configuration > Base configuration ✅ SETTINGS > Root project > "Debug" configuration > Values diff --git a/Tests/XCDiffCoreTests/Comparator/BuildPhasesComparatorTests.swift b/Tests/XCDiffCoreTests/Comparator/BuildPhasesComparatorTests.swift index dbd889c..2ae029f 100644 --- a/Tests/XCDiffCoreTests/Comparator/BuildPhasesComparatorTests.swift +++ b/Tests/XCDiffCoreTests/Comparator/BuildPhasesComparatorTests.swift @@ -115,15 +115,15 @@ final class BuildPhasesComparatorTests: XCTestCase { let first = project() .addTarget(name: "Target1", productType: .application) { target in target.addBuildPhase(.copyFiles(.plugins)) { _ in } - target.addBuildPhase(.shellScripts) { $0.setName("Shell 1") } - target.addBuildPhase(.shellScripts) { $0.setName("Shell 2") } - target.addBuildPhase(.shellScripts) { $0.setName("Shell 3") } + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Shell 1"))) { _ in } + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Shell 2"))) { _ in } + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Shell 3"))) { _ in } } .projectDescriptor() let second = project() .addTarget(name: "Target1", productType: .application) { target in target.addBuildPhase(.copyFiles(.plugins)) { _ in } - target.addBuildPhase(.shellScripts) { $0.setName("Shell 1") } + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Shell 1"))) { _ in } } .projectDescriptor() @@ -143,15 +143,15 @@ final class BuildPhasesComparatorTests: XCTestCase { let first = project() .addTarget(name: "Target1", productType: .application) { target in target.addBuildPhase(.copyFiles(.plugins)) { _ in } - target.addBuildPhase(.shellScripts) { $0.setName("Shell 2") } - target.addBuildPhase(.shellScripts) { $0.setName("Shell 3") } - target.addBuildPhase(.shellScripts) { $0.setName("Shell 1") } + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Shell 2"))) { _ in } + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Shell 3"))) { _ in } + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Shell 1"))) { _ in } } .projectDescriptor() let second = project() .addTarget(name: "Target1", productType: .application) { target in target.addBuildPhase(.copyFiles(.plugins)) { _ in } - target.addBuildPhase(.shellScripts) { $0.setName("Shell 1") } + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Shell 1"))) { _ in } } .projectDescriptor() @@ -171,13 +171,13 @@ final class BuildPhasesComparatorTests: XCTestCase { let first = project() .addTarget(name: "Target1", productType: .application) { target in target.addBuildPhase(.copyFiles(.plugins)) { _ in } - target.addBuildPhase(.shellScripts) { $0.setName("Shell A") } + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Shell A"))) { _ in } } .projectDescriptor() let second = project() .addTarget(name: "Target1", productType: .application) { target in target.addBuildPhase(.copyFiles(.plugins)) { _ in } - target.addBuildPhase(.shellScripts) { $0.setName("Shell B") } + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Shell B"))) { _ in } } .projectDescriptor() diff --git a/Tests/XCDiffCoreTests/Comparator/ComparatorTypeTests.swift b/Tests/XCDiffCoreTests/Comparator/ComparatorTypeTests.swift index d1002cb..b7338d0 100644 --- a/Tests/XCDiffCoreTests/Comparator/ComparatorTypeTests.swift +++ b/Tests/XCDiffCoreTests/Comparator/ComparatorTypeTests.swift @@ -29,6 +29,7 @@ final class ComperatorTypeTests: XCTestCase { "headers", "sources", "resources", + "run_scripts", "configurations", "settings", "resolved_settings", diff --git a/Tests/XCDiffCoreTests/Comparator/RunScriptComparatorTests.swift b/Tests/XCDiffCoreTests/Comparator/RunScriptComparatorTests.swift new file mode 100644 index 0000000..05725d1 --- /dev/null +++ b/Tests/XCDiffCoreTests/Comparator/RunScriptComparatorTests.swift @@ -0,0 +1,538 @@ +// +// Copyright 2022 Bloomberg Finance L.P. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation +@testable import XCDiffCore +import XCTest + +// swiftlint:disable file_length +// swiftlint:disable:next type_body_length +final class RunScriptComparatorTests: XCTestCase { + private var subject: RunScriptComparator! + + override func setUp() { + subject = RunScriptComparator() + } + + func testCompare_whenNoRunScripts_noDifference() throws { + // Given + let first = project() + .addTarget(name: "Target1") + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [CompareResult(tag: "run_scripts", + context: ["\"Target1\" target"], + description: nil, + onlyInFirst: [], + onlyInSecond: [], + differentValues: [])]) + } + + func testCompare_whenRunScriptBuildPhaseOnlyInFirst_noDifference() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [.init(tag: "run_scripts", context: ["\"Target1\" target"])]) + } + + func testCompare_whenMoreThanOneRunScriptBuildPhaseWithTheSameNameInFirst() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Run Script 1"))) { _ in } + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Run Script 1"))) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Run Script 1"))) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"Run Script 1\" build phase"]), + .init(tag: "run_scripts", context: ["\"Target1\" target", "\"Run Script 1\" build phase"], + description: "The build phase does not exist in the second project", + onlyInFirst: ["Duplicated build phase name"]), + ]) + } + + func testCompare_whenMoreThanOneRunScriptBuildPhaseWithTheSameNameInSecond() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Run Script 1"))) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Run Script 1"))) { _ in } + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(name: "Run Script 1"))) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"Run Script 1\" build phase"]), + .init(tag: "run_scripts", context: ["\"Target1\" target", "\"Run Script 1\" build phase"], + description: "The build phase does not exist in the first project", + onlyInSecond: ["Duplicated build phase name"]), + ]) + } + + func testCompare_whenRunScriptBuildPhaseOnlyInSecond_noDifference() throws { + // Given + let first = project() + .addTarget(name: "Target1") + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [.init(tag: "run_scripts", context: ["\"Target1\" target"])]) + } + + func testCompare_whenSameRunScriptBuildPhaseInBoth_noDifference() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", context: ["\"Target1\" target", "\"ShellScript\" build phase"]), + ]) + } + + func testCompare_whenInputPathOnlyInFirst() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(inputPaths: ["$SRCROOT/somefile.txt"]))) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"ShellScript\" build phase"], + differentValues: [ + .init(context: "inputPaths", + first: #"["$SRCROOT/somefile.txt"]"#, + second: "[]"), + ]), + ]) + } + + func testCompare_whenInputPathOnlyInSecond() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(inputPaths: ["$SRCROOT/somefile.txt"]))) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"ShellScript\" build phase"], + differentValues: [ + .init(context: "inputPaths", + first: "[]", + second: #"["$SRCROOT/somefile.txt"]"#), + ]), + ]) + } + + func testCompare_whenOutputPathOnlyInFirst() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase( + outputPaths: ["$SRCROOT/somefile.txt"] + ))) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"ShellScript\" build phase"], + differentValues: [ + .init(context: "outputPaths", + first: #"["$SRCROOT/somefile.txt"]"#, + second: "[]"), + ]), + ]) + } + + func testCompare_whenOutputPathOnlyInSecond() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase( + outputPaths: ["$SRCROOT/somefile.txt"] + ))) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"ShellScript\" build phase"], + differentValues: [ + .init(context: "outputPaths", + first: "[]", + second: #"["$SRCROOT/somefile.txt"]"#), + ]), + ]) + } + + func testCompare_whenShellPathIsDifferent() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(shellPath: "/bin/fish"))) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(shellPath: "/bin/zsh"))) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"ShellScript\" build phase"], + differentValues: [ + .init(context: "shellPath", + first: "/bin/fish", + second: "/bin/zsh"), + ]), + ]) + } + + func testCompare_whenShellScriptIsDifferent() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(shellScript: "myscript.py"))) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(shellScript: "yourscript.py"))) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"ShellScript\" build phase"], + differentValues: [ + .init(context: "shellScript", + first: "myscript.py", + second: "yourscript.py"), + ]), + ]) + } + + func testCompare_whenShowEnvVarsInLogIsDifferent() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(showEnvVarsInLog: true))) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(showEnvVarsInLog: false))) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"ShellScript\" build phase"], + differentValues: [ + .init(context: "showEnvVarsInLog", + first: "true", + second: "false"), + ]), + ]) + } + + func testCompare_whenAlwaysOutOfDateIsDifferent() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(alwaysOutOfDate: true))) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(alwaysOutOfDate: false))) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"ShellScript\" build phase"], + differentValues: [ + .init(context: "alwaysOutOfDate", + first: "true", + second: "false"), + ]), + ]) + } + + func testCompare_whenDependencyFileIsDifferent() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(dependencyFile: "myfile.d"))) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase(dependencyFile: "yourfile.d"))) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"ShellScript\" build phase"], + differentValues: [ + .init(context: "dependencyFile", + first: "myfile.d", + second: "yourfile.d"), + ]), + ]) + } + + func testCompare_whenInputFileListPathOnlyInFirst() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { buildPhase in + buildPhase.setInputFileListPaths(["$SRCROOT/somefile.txt"]) + } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"ShellScript\" build phase"], + differentValues: [ + .init(context: "inputFileListPaths", + first: #"["$SRCROOT/somefile.txt"]"#, + second: "nil"), + ]), + ]) + } + + func testCompare_whenInputFileListPathPathOnlyInSecond() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { buildPhase in + buildPhase.setInputFileListPaths(["$SRCROOT/somefile.txt"]) + } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"ShellScript\" build phase"], + differentValues: [ + .init(context: "inputFileListPaths", + first: "nil", + second: #"["$SRCROOT/somefile.txt"]"#), + ]), + ]) + } + + func testCompare_whenOutputFileListPathOnlyInFirst() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { buildPhase in + buildPhase.setOutputFileListPaths(["$SRCROOT/somefile.txt"]) + } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { _ in } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"ShellScript\" build phase"], + differentValues: [ + .init(context: "outputFileListPaths", + first: #"["$SRCROOT/somefile.txt"]"#, + second: "nil"), + ]), + ]) + } + + func testCompare_whenOutputFileListPathPathOnlyInSecond() throws { + // Given + let first = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { _ in } + } + .projectDescriptor() + let second = project() + .addTarget(name: "Target1") { target in + target.addBuildPhase(.shellScripts(RunScriptBuildPhase())) { buildPhase in + buildPhase.setOutputFileListPaths(["$SRCROOT/somefile.txt"]) + } + } + .projectDescriptor() + + // When + let actual = try subject.compare(first, second, parameters: .all) + + // Then + XCTAssertEqual(actual, [ + .init(tag: "run_scripts", + context: ["\"Target1\" target", "\"ShellScript\" build phase"], + differentValues: [ + .init(context: "outputFileListPaths", + first: "nil", + second: #"["$SRCROOT/somefile.txt"]"#), + ]), + ]) + } +} diff --git a/Tests/XCDiffCoreTests/Helpers/PBXBuildPhaseBuilder.swift b/Tests/XCDiffCoreTests/Helpers/PBXBuildPhaseBuilder.swift index 4d5abf5..22092a7 100644 --- a/Tests/XCDiffCoreTests/Helpers/PBXBuildPhaseBuilder.swift +++ b/Tests/XCDiffCoreTests/Helpers/PBXBuildPhaseBuilder.swift @@ -76,8 +76,15 @@ final class PBXBuildPhaseBuilder { buildPhase = PBXHeadersBuildPhase(files: buildFiles) case .frameworks: buildPhase = PBXFrameworksBuildPhase(files: buildFiles) - case .shellScripts: - buildPhase = PBXShellScriptBuildPhase(files: buildFiles, name: name) + case let .shellScripts(runScriptBuildPhase): + buildPhase = PBXShellScriptBuildPhase(name: runScriptBuildPhase.name, + inputPaths: runScriptBuildPhase.inputPaths, + outputPaths: runScriptBuildPhase.outputPaths, + shellPath: runScriptBuildPhase.shellPath, + shellScript: runScriptBuildPhase.shellScript, + showEnvVarsInLog: runScriptBuildPhase.showEnvVarsInLog, + alwaysOutOfDate: runScriptBuildPhase.alwaysOutOfDate, + dependencyFile: runScriptBuildPhase.dependencyFile) case let .copyFiles(copyBuildPhase): buildPhase = PBXCopyFilesBuildPhase(dstPath: copyBuildPhase.dstPath, dstSubfolderSpec: .from(copyBuildPhase.dstSubfolderSpec), diff --git a/Tests/XCDiffCoreTests/Helpers/PBXNativeTargetBuilder.swift b/Tests/XCDiffCoreTests/Helpers/PBXNativeTargetBuilder.swift index d5d9985..526d89d 100644 --- a/Tests/XCDiffCoreTests/Helpers/PBXNativeTargetBuilder.swift +++ b/Tests/XCDiffCoreTests/Helpers/PBXNativeTargetBuilder.swift @@ -40,11 +40,40 @@ struct CopyFilesBuildPhase { var dstPath: String? } +struct RunScriptBuildPhase { + var name: String? + var inputPaths: [String] + var outputPaths: [String] + var shellPath: String + var shellScript: String? + var showEnvVarsInLog: Bool + var alwaysOutOfDate: Bool + var dependencyFile: String? + + init(name: String? = nil, + inputPaths: [String] = [], + outputPaths: [String] = [], + shellPath: String = "/bin/sh", + shellScript: String? = nil, + showEnvVarsInLog: Bool = false, + alwaysOutOfDate: Bool = false, + dependencyFile: String? = nil) { + self.name = name + self.inputPaths = inputPaths + self.outputPaths = outputPaths + self.shellPath = shellPath + self.shellScript = shellScript + self.showEnvVarsInLog = showEnvVarsInLog + self.alwaysOutOfDate = alwaysOutOfDate + self.dependencyFile = dependencyFile + } +} + enum BuildPhase { case sources case frameworks case resources - case shellScripts + case shellScripts(RunScriptBuildPhase = RunScriptBuildPhase()) case copyFiles(CopyFilesBuildPhase) case headers }