# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.

name: FBSDKCoreKit

include:
  - ../xcodegen_project_common.yml

projectReferences:
  FBSDKCoreKit_Basics:
    path: ../FBSDKCoreKit_Basics/FBSDKCoreKit_Basics.xcodeproj
  FBAEMKit:
    path: ../FBAEMKit/FBAEMKit.xcodeproj
  TestTools:
    path: ../TestTools/TestTools.xcodeproj

configFiles:
  Debug: Configurations/Shared/Configuration/Debug.xcconfig
  Release: Configurations/Shared/Configuration/Release.xcconfig

settings:
  base:
    # Some iOS defaults will be overridden by Xcodegen.
    # We need to explicitly set them to maintain parity with
    # the project file being replaced
    CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER: NO
    SWIFT_OPTIMIZATION_LEVEL: -O

targets:
  FBSDKCoreKit-Static:
    type: framework
    platform: iOS
    productName: FBSDKCoreKit
    sources:
      - path: FBSDKCoreKit/include
        headerVisibility: public
      - path: FBSDKCoreKit
        headerVisibility: project
        createIntermediateGroups: true
        excludes:
          - include
          - FBSDKCoreKit.modulemap
          - Device/*.[h,m]
          - Info.plist
      - path: FBSDKCoreKit/Info.plist
        group: FBSDKCoreKit/Supporting Files
        createIntermediateGroups: true
    configFiles:
      Debug: Configurations/FBSDKCoreKit-Static.xcconfig
      Release: Configurations/FBSDKCoreKit-Static.xcconfig
    dependencies:
      - target: FBAEMKit/FBAEMKit-Static
        link: false
      - target: FBSDKCoreKit_Basics/FBSDKCoreKit_Basics-Static
        link: false
      - sdk: SafariServices.framework
      - sdk: WebKit.framework
    preBuildScripts:
      - name: Run Swiftlint
        showEnvVars: false
        script: ../scripts/build_phase_swiftlint.sh
    settings:
      CLANG_WARN_STRICT_PROTOTYPES: NO
      FB_BITCODE_FLAG[sdk=iphoneos11.0]: -fembed-bitcode
      GCC_PREFIX_HEADER: $(SRCROOT)/FBSDKCoreKit/FBSDKCoreKit-Prefix-Header.h
      CPP_PREFIX_HEADER: $(SRCROOT)/FBSDKCoreKit/FBSDKCoreKit-Prefix-Header.h
  FBSDKCoreKit-Dynamic:
    type: framework
    platform: iOS
    productName: FBSDKCoreKit
    sources:
      - path: FBSDKCoreKit/include
        headerVisibility: public
      - path: FBSDKCoreKit
        headerVisibility: project
        createIntermediateGroups: true
        excludes:
          - Device/*.[h,m]
          - include
          - FBSDKCoreKit.modulemap
          - FBSDKDeviceViewControllerBase.m
          - Info.plist
      - path: FBSDKCoreKit/Info.plist
        group: FBSDKCoreKit/Supporting Files
        createIntermediateGroups: true
    configFiles:
      Debug: Configurations/FBSDKCoreKit-Dynamic.xcconfig
      Release: Configurations/FBSDKCoreKit-Dynamic.xcconfig
    dependencies:
      - target: FBAEMKit/FBAEMKit-Dynamic
      - target: FBSDKCoreKit_Basics/FBSDKCoreKit_Basics-Dynamic
      - sdk: Accelerate.framework
        weak: true
      - sdk: SafariServices.framework
        weak: true
      - sdk: AdSupport.framework
      - sdk: CoreGraphics.framework
      - sdk: StoreKit.framework
        weak: true
      - sdk: UIKit.framework
      - sdk: WebKit.framework
        weak: true
      - sdk: libz.tbd
    preBuildScripts:
      - name: Run Swiftlint
        showEnvVars: false
        script: ../scripts/build_phase_swiftlint.sh
    settings:
      CLANG_WARN_STRICT_PROTOTYPES: NO
      GCC_PREFIX_HEADER: $(SRCROOT)/FBSDKCoreKit/FBSDKCoreKit-Prefix-Header.h
      CPP_PREFIX_HEADER: $(SRCROOT)/FBSDKCoreKit/FBSDKCoreKit-Prefix-Header.h
  FBSDKCoreKit_TV-Static:
    type: framework
    platform: tvOS
    productName: FBSDKCoreKit
    sources:
      - path: FBSDKCoreKit/AppEvents
        headerVisibility: project
        createIntermediateGroups: true
        excludes:
          - Internal/AAM
          - Internal/AEM
          - Internal/Codeless
          - Internal/SKAdNetwork
          - Internal/SuggestedEvents
          - Internal/Integrity/FBSDKIntegrityManager*
          - Internal/Integrity/FBSDKIntegrityManager+AppEventsParametersProcessing.h
          - Internal/ML
          - Internal/Codeless
          - Internal/ViewHierarchy
          - Internal/FBSDKFeatureExtracting*
          - Internal/FBSDKHybridAppEventsScriptMessageHandler*
          - Internal/FBSDKAppEventsNumberParser*
      - path: FBSDKCoreKit/GraphAPI
        createIntermediateGroups: true
        excludes:
          - FBSDKGraphErrorRecoveryProcessor*
      - path: FBSDKCoreKit/Internal
        createIntermediateGroups: true
        headerVisibility: project
        excludes:
          - FBSDKAuthenticationStatusUtility*
          - FBSDKBackgroundEventLogger*
          - FBSDKContainerViewController*
          - FBSDKInternalUtility+WindowFinding*
          - FBSDKRulesFromKeyProvider.h
          - FBSDKProfile+Internal*
          - FBSDKProfile+ProfileProtocols*
          - FBSDKProfilePictureView+Internal*
          - FBSDKProfileProtocols*
          - FBSDKMeasurementEvent*
          - FBSDKMacCatalystDetermining*
          - FBSDKURL_Internal.h
          - FBSDKAppLink*
          - UIApplication+URLOpener.h
          - BridgeAPI
          - UI/FBSDKCloseIcon*
          - UI/FBSDKHumanSilhouette*
          - WebDialog
      - path: FBSDKCoreKit
        headerVisibility: project
        excludes:
          - AppEvents
          - AppLink
          - BridgeAPI
          - GraphAPI
          - Internal
          - include
          - FBSDKBridgeAPI*
          - FBSDKMeasurementEvent*
          - FBSDKMutableCopying*
          - FBSDKProfile*
          - FBSDKShareDialogConfiguration*
          - FBSDKURL.*
          - FBSDKURLHosting*
          - FBSDKURLOpen*
          - FBSDKWebDialog*
          - FBSDKCoreKit.modulemap
          - Info.plist
      - path: FBSDKCoreKit/include
        headerVisibility: public
        excludes:
          - FBSDKAppLink*
          - FBSDKBridgeAPI*
          - FBSDKGraphErrorRecoveryProcessor*
          - FBSDKBridgeAPI*
          - FBSDKMeasurementEvent*
          - FBSDKMutableCopying*
          - FBSDKProfile*
          - FBSDKShareDialogConfiguration*
          - FBSDKURL.*
          - FBSDKURLHosting*
          - FBSDKURLOpen*
          - FBSDKWebDialog*
          - FBSDKWebViewAppLinkResolver*
          - FBSDKWindowFinding*
          - FBSDKInternalUtility+URLHosting*
      - path: FBSDKCoreKit/Info.plist
        group: FBSDKCoreKit/Supporting Files
        createIntermediateGroups: true
    configFiles:
      Debug: Configurations/FBSDKCoreKit-tvOS-Static.xcconfig
      Release: Configurations/FBSDKCoreKit-tvOS-Static.xcconfig
    dependencies:
      - target: FBAEMKit/FBAEMKit_TV-Static
        link: false
      - target: FBSDKCoreKit_Basics/FBSDKCoreKit_Basics_TV-Static
        link: false
    preBuildScripts:
      - name: Run Swiftlint
        showEnvVars: false
        script: ../scripts/build_phase_swiftlint.sh
    settings:
      GCC_PREFIX_HEADER: $(SRCROOT)/FBSDKCoreKit/FBSDKCoreKit-Prefix-Header.h
      CPP_PREFIX_HEADER: $(SRCROOT)/FBSDKCoreKit/FBSDKCoreKit-Prefix-Header.h
  FBSDKCoreKit_TV-Dynamic:
    type: framework
    platform: tvOS
    productName: FBSDKCoreKit
    sources:
      - path: FBSDKCoreKit/AppEvents
        headerVisibility: project
        createIntermediateGroups: true
        excludes:
          - Internal/AAM
          - Internal/AEM
          - Internal/Codeless
          - Internal/SKAdNetwork
          - Internal/SuggestedEvents
          - Internal/Integrity/FBSDKIntegrityManager*
          - Internal/Integrity/FBSDKIntegrityManager+AppEventsParametersProcessing.h
          - Internal/ML
          - Internal/Codeless
          - Internal/ViewHierarchy
          - Internal/FBSDKFeatureExtracting*
          - Internal/FBSDKHybridAppEventsScriptMessageHandler*
          - Internal/FBSDKAppEventsNumberParser*
      - path: FBSDKCoreKit/GraphAPI
        createIntermediateGroups: true
        excludes:
          - FBSDKGraphErrorRecoveryProcessor*
      - path: FBSDKCoreKit/Internal
        createIntermediateGroups: true
        headerVisibility: project
        excludes:
          - FBSDKAuthenticationStatusUtility*
          - FBSDKBackgroundEventLogger*
          - FBSDKContainerViewController*
          - FBSDKInternalUtility+WindowFinding*
          - FBSDKRulesFromKeyProvider.h
          - FBSDKProfile+Internal*
          - FBSDKProfile+ProfileProtocols*
          - FBSDKProfilePictureView+Internal*
          - FBSDKProfileProtocols*
          - FBSDKMeasurementEvent*
          - FBSDKMacCatalystDetermining*
          - FBSDKURL_Internal.h
          - FBSDKAppLink*
          - UIApplication+URLOpener.h
          - BridgeAPI
          - UI/FBSDKCloseIcon*
          - UI/FBSDKHumanSilhouette*
          - WebDialog
      - path: FBSDKCoreKit
        headerVisibility: project
        excludes:
          - AppEvents
          - AppLink
          - BridgeAPI
          - GraphAPI
          - Internal
          - include
          - FBSDKBridgeAPI*
          - FBSDKCoreKit.modulemap
          - FBSDKMeasurementEvent*
          - FBSDKMutableCopying*
          - FBSDKProfile*
          - FBSDKShareDialogConfiguration*
          - FBSDKURL.*
          - FBSDKURLHosting*
          - FBSDKURLOpen*
          - FBSDKWebDialog*
          - FBSDKWindowFinding*
          - Info.plist
      - path: FBSDKCoreKit/include
        headerVisibility: public
        excludes:
          - FBSDKAppLink*
          - FBSDKBridgeAPI*
          - FBSDKGraphErrorRecoveryProcessor*
          - FBSDKBridgeAPI*
          - FBSDKMeasurementEvent*
          - FBSDKMutableCopying*
          - FBSDKProfile*
          - FBSDKShareDialogConfiguration*
          - FBSDKURL.*
          - FBSDKURLHosting*
          - FBSDKURLOpen*
          - FBSDKWebDialog*
          - FBSDKWebViewAppLinkResolver*
          - FBSDKWindowFinding*
          - Info.plist
          - FBSDKInternalUtility+URLHosting*
      - path: FBSDKCoreKit/Info.plist
        group: FBSDKCoreKit/Supporting Files
        createIntermediateGroups: true
    configFiles:
      Debug: Configurations/FBSDKCoreKit-tvOS-Dynamic.xcconfig
      Release: Configurations/FBSDKCoreKit-tvOS-Dynamic.xcconfig
    dependencies:
      - target: FBSDKCoreKit_Basics/FBSDKCoreKit_Basics_TV-Dynamic
      - target: FBAEMKit/FBAEMKit_TV-Dynamic
      - sdk: AdSupport.framework
      - sdk: CoreGraphics.framework
      - sdk: CoreImage.framework
      - sdk: libz.tbd
      - sdk: StoreKit.framework
      - sdk: UIKit.framework
    preBuildScripts:
      - name: Run Swiftlint
        showEnvVars: false
        script: ../scripts/build_phase_swiftlint.sh
    settings:
      GCC_PREFIX_HEADER: $(SRCROOT)/FBSDKCoreKit/FBSDKCoreKit-Prefix-Header.h
      CPP_PREFIX_HEADER: $(SRCROOT)/FBSDKCoreKit/FBSDKCoreKit-Prefix-Header.h
  FBSDKCoreKitTests:
    type: bundle.unit-test
    platform: iOS
    sources:
      - path: FBSDKCoreKitTests
        excludes:
          - .swiftlint.yml
    configFiles:
      Debug: Configurations/FBSDKCoreKitTests.xcconfig
      Release: Configurations/FBSDKCoreKitTests.xcconfig
    dependencies:
      - target: FBSDKCoreKit-Dynamic
        link: false
        embed: false
      - target: TestTools/TestTools
        link: false
        embed: false
      - sdk: Accelerate.framework
    settings:
      GCC_WARN_UNUSED_FUNCTION: NO

schemes:
  FBSDKCoreKit-Static:
    build:
      targets:
        FBSDKCoreKit-Static: all
  FBSDKCoreKit-Dynamic:
    build:
      targets:
        FBSDKCoreKit-Dynamic: all
    test:
      targets:
        - FBSDKCoreKitTests
      gatherCoverageData: true
      coverageTargets:
        - FBSDKCoreKit-Dynamic
  FBSDKCoreKit_TV-Static:
    build:
      targets:
        FBSDKCoreKit_TV-Static: all
  FBSDKCoreKit_TV-Dynamic:
    build:
      targets:
        FBSDKCoreKit_TV-Dynamic: all
