From 76ab3de4f9b4cc90f12d6b721a451696a51e9433 Mon Sep 17 00:00:00 2001 From: Aleksandar Vacic Date: Tue, 31 Jul 2018 20:42:20 +0200 Subject: [PATCH 1/4] Another approach: - remove CommonCrypto file(s) from the file system - added new aggregate target which conditionally builds CommonCrypto - link to that target in all 4 of our targets Per: https://stackoverflow.com/a/42852743/108859 re #102 --- CommonCrypto/module.modulemap | 4 - CommonCrypto/shim.h | 1 - JWT.xcodeproj/project.pbxproj | 116 ++++++++++++++++++ .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++ 4 files changed, 124 insertions(+), 5 deletions(-) delete mode 100644 CommonCrypto/module.modulemap delete mode 100644 CommonCrypto/shim.h create mode 100644 JWT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/CommonCrypto/module.modulemap b/CommonCrypto/module.modulemap deleted file mode 100644 index b70f7d6..0000000 --- a/CommonCrypto/module.modulemap +++ /dev/null @@ -1,4 +0,0 @@ -module CommonCrypto [system] { - header "shim.h" - export * -} diff --git a/CommonCrypto/shim.h b/CommonCrypto/shim.h deleted file mode 100644 index c332624..0000000 --- a/CommonCrypto/shim.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/JWT.xcodeproj/project.pbxproj b/JWT.xcodeproj/project.pbxproj index 6c895b0..27caa47 100644 --- a/JWT.xcodeproj/project.pbxproj +++ b/JWT.xcodeproj/project.pbxproj @@ -6,6 +6,20 @@ objectVersion = 46; objects = { +/* Begin PBXAggregateTarget section */ + D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */ = { + isa = PBXAggregateTarget; + buildConfigurationList = D0A831672110E20A00DEA3E1 /* Build configuration list for PBXAggregateTarget "CommonCryptoModuleMap" */; + buildPhases = ( + D0A8316A2110E23200DEA3E1 /* ShellScript */, + ); + dependencies = ( + ); + name = CommonCryptoModuleMap; + productName = CommonCryptoModuleMap; + }; +/* End PBXAggregateTarget section */ + /* Begin PBXBuildFile section */ 271E10801F90253300B5033C /* JWA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 271E107F1F90253300B5033C /* JWA.swift */; }; 271E10811F90253300B5033C /* JWA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 271E107F1F90253300B5033C /* JWA.swift */; }; @@ -77,6 +91,34 @@ remoteGlobalIDString = 279D639B1AD07FFF0024E2BC; remoteInfo = JWT; }; + D0A8316B2110E2A700DEA3E1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 279D63931AD07FFF0024E2BC /* Project object */; + proxyType = 1; + remoteGlobalIDString = D0A831662110E20A00DEA3E1; + remoteInfo = CommonCryptoModuleMap; + }; + D0A8316D2110E2AF00DEA3E1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 279D63931AD07FFF0024E2BC /* Project object */; + proxyType = 1; + remoteGlobalIDString = D0A831662110E20A00DEA3E1; + remoteInfo = CommonCryptoModuleMap; + }; + D0A8316F2110E2B500DEA3E1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 279D63931AD07FFF0024E2BC /* Project object */; + proxyType = 1; + remoteGlobalIDString = D0A831662110E20A00DEA3E1; + remoteInfo = CommonCryptoModuleMap; + }; + D0A831712110E2BC00DEA3E1 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 279D63931AD07FFF0024E2BC /* Project object */; + proxyType = 1; + remoteGlobalIDString = D0A831662110E20A00DEA3E1; + remoteInfo = CommonCryptoModuleMap; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -308,6 +350,7 @@ buildRules = ( ); dependencies = ( + D0A8316C2110E2A700DEA3E1 /* PBXTargetDependency */, ); name = "JWT-OSX"; productName = JWT; @@ -344,6 +387,7 @@ buildRules = ( ); dependencies = ( + D0A8316E2110E2AF00DEA3E1 /* PBXTargetDependency */, ); name = "JWT-iOS"; productName = JWT; @@ -362,6 +406,7 @@ buildRules = ( ); dependencies = ( + D0A831702110E2B500DEA3E1 /* PBXTargetDependency */, ); name = "JWT-tvOS"; productName = JWT; @@ -380,6 +425,7 @@ buildRules = ( ); dependencies = ( + D0A831722110E2BC00DEA3E1 /* PBXTargetDependency */, ); name = "JWT-watchOS"; productName = JWT; @@ -403,6 +449,10 @@ 279D63A61AD07FFF0024E2BC = { CreatedOnToolsVersion = 6.2; }; + D0A831662110E20A00DEA3E1 = { + CreatedOnToolsVersion = 10.0; + ProvisioningStyle = Automatic; + }; }; }; buildConfigurationList = 279D63961AD07FFF0024E2BC /* Build configuration list for PBXProject "JWT" */; @@ -422,6 +472,7 @@ CD9B62251C7753EC005D4844 /* JWT-tvOS */, CD9B62371C7753FB005D4844 /* JWT-watchOS */, 279D63A61AD07FFF0024E2BC /* JWTTests */, + D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */, ); }; /* End PBXProject section */ @@ -464,6 +515,26 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + D0A8316A2110E23200DEA3E1 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "COMMON_CRYPTO_DIR=\"${SDKROOT}/usr/include/CommonCrypto\"\nif [ -f \"${COMMON_CRYPTO_DIR}/module.modulemap\" ]\nthen\necho \"CommonCrypto already exists, skipping\"\nelse\n# This if-statement means we'll only run the main script if the CommonCryptoModuleMap directory doesn't exist\n# Because otherwise the rest of the script causes a full recompile for anything where CommonCrypto is a dependency\n# Do a \"Clean Build Folder\" to remove this directory and trigger the rest of the script to run\nif [ -d \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap\" ]; then\necho \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap directory already exists, so skipping the rest of the script.\"\nexit 0\nfi\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap\"\ncat < \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap/module.modulemap\"\nmodule CommonCrypto [system] {\nheader \"${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h\"\nexport *\n}\nEOF\nfi\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 279D63971AD07FFF0024E2BC /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -563,6 +634,26 @@ target = 279D639B1AD07FFF0024E2BC /* JWT-OSX */; targetProxy = 279D63A91AD07FFF0024E2BC /* PBXContainerItemProxy */; }; + D0A8316C2110E2A700DEA3E1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */; + targetProxy = D0A8316B2110E2A700DEA3E1 /* PBXContainerItemProxy */; + }; + D0A8316E2110E2AF00DEA3E1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */; + targetProxy = D0A8316D2110E2AF00DEA3E1 /* PBXContainerItemProxy */; + }; + D0A831702110E2B500DEA3E1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */; + targetProxy = D0A8316F2110E2B500DEA3E1 /* PBXContainerItemProxy */; + }; + D0A831722110E2BC00DEA3E1 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */; + targetProxy = D0A831712110E2BC00DEA3E1 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -858,6 +949,22 @@ }; name = Release; }; + D0A831682110E20A00DEA3E1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + D0A831692110E20A00DEA3E1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -915,6 +1022,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + D0A831672110E20A00DEA3E1 /* Build configuration list for PBXAggregateTarget "CommonCryptoModuleMap" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D0A831682110E20A00DEA3E1 /* Debug */, + D0A831692110E20A00DEA3E1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 279D63931AD07FFF0024E2BC /* Project object */; diff --git a/JWT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/JWT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/JWT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + From 8e7d73fde4d4fd9c13413f9913a5a65f858c871d Mon Sep 17 00:00:00 2001 From: Aleksandar Vacic Date: Tue, 31 Jul 2018 21:07:40 +0200 Subject: [PATCH 2/4] Added all supported platforms: tvOS, iOS, macOS, watchOS re #102 --- JWT.xcodeproj/project.pbxproj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/JWT.xcodeproj/project.pbxproj b/JWT.xcodeproj/project.pbxproj index 27caa47..a22afd7 100644 --- a/JWT.xcodeproj/project.pbxproj +++ b/JWT.xcodeproj/project.pbxproj @@ -521,17 +521,13 @@ buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( ); - outputFileListPaths = ( - ); outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "COMMON_CRYPTO_DIR=\"${SDKROOT}/usr/include/CommonCrypto\"\nif [ -f \"${COMMON_CRYPTO_DIR}/module.modulemap\" ]\nthen\necho \"CommonCrypto already exists, skipping\"\nelse\n# This if-statement means we'll only run the main script if the CommonCryptoModuleMap directory doesn't exist\n# Because otherwise the rest of the script causes a full recompile for anything where CommonCrypto is a dependency\n# Do a \"Clean Build Folder\" to remove this directory and trigger the rest of the script to run\nif [ -d \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap\" ]; then\necho \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap directory already exists, so skipping the rest of the script.\"\nexit 0\nfi\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap\"\ncat < \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap/module.modulemap\"\nmodule CommonCrypto [system] {\nheader \"${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h\"\nexport *\n}\nEOF\nfi\n"; + shellScript = "COMMON_CRYPTO_DIR=\"${SDKROOT}/usr/include/CommonCrypto\"\nif [ -f \"${COMMON_CRYPTO_DIR}/module.modulemap\" ]\nthen\necho \"CommonCrypto already exists, skipping\"\nelse\n# This if-statement means we'll only run the main script if the CommonCryptoModuleMap directory doesn't exist\n# Because otherwise the rest of the script causes a full recompile for anything where CommonCrypto is a dependency\n# Do a \"Clean Build Folder\" to remove this directory and trigger the rest of the script to run\nif [ -d \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap\" ]; then\necho \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap directory already exists, so skipping the rest of the script.\"\nexit 0\nfi\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap\"\ncat < \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap/module.modulemap\"\nmodule CommonCrypto [system] {\n header \"${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h\"\n export *\n}\nEOF\necho \"Built ${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap directory\"\nfi"; }; /* End PBXShellScriptBuildPhase section */ @@ -847,6 +843,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.cocode.$(PRODUCT_NAME:rfc1034identifier)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_INCLUDE_PATHS = "$(inherited) ${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap"; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -866,6 +863,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.cocode.$(PRODUCT_NAME:rfc1034identifier)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_INCLUDE_PATHS = "$(inherited) ${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -954,6 +952,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvsimulator appletvos watchsimulator watchos"; }; name = Debug; }; @@ -962,6 +961,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvsimulator appletvos watchsimulator watchos"; }; name = Release; }; From a34ec71108c0503e77f6d4381acdb3148ae084c0 Mon Sep 17 00:00:00 2001 From: Aleksandar Vacic Date: Wed, 1 Aug 2018 11:36:18 +0200 Subject: [PATCH 3/4] A better approach - no additional target - run script before Compile Sources re #102 --- Build-Phases/common-crypto.sh | 26 ++++++ JWT.xcodeproj/project.pbxproj | 151 ++++++++++++---------------------- 2 files changed, 77 insertions(+), 100 deletions(-) create mode 100755 Build-Phases/common-crypto.sh diff --git a/Build-Phases/common-crypto.sh b/Build-Phases/common-crypto.sh new file mode 100755 index 0000000..6e0e0fa --- /dev/null +++ b/Build-Phases/common-crypto.sh @@ -0,0 +1,26 @@ +COMMON_CRYPTO_DIR="${SDKROOT}/usr/include/CommonCrypto" +if [ -f "${COMMON_CRYPTO_DIR}/module.modulemap" ] +then + echo "CommonCrypto already exists, skipping" +else + # This if-statement means we'll only run the main script if the + # CommonCrypto.framework directory doesn't exist because otherwise + # the rest of the script causes a full recompile for anything + # where CommonCrypto is a dependency + # Do a "Clean Build Folder" to remove this directory and trigger + # the rest of the script to run + FRAMEWORK_DIR="${BUILT_PRODUCTS_DIR}/CommonCrypto.framework" + + if [ -d "${FRAMEWORK_DIR}" ]; then + echo "${FRAMEWORK_DIR} already exists, so skipping the rest of the script." + exit 0 + fi + + mkdir -p "${FRAMEWORK_DIR}/Modules" + echo "module CommonCrypto [system] { + header \"${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h\" + export * + }" >> "${FRAMEWORK_DIR}/Modules/module.modulemap" + + ln -sf "${SDKROOT}/usr/include/CommonCrypto" "${FRAMEWORK_DIR}/Headers" +fi diff --git a/JWT.xcodeproj/project.pbxproj b/JWT.xcodeproj/project.pbxproj index a22afd7..0ba44cd 100644 --- a/JWT.xcodeproj/project.pbxproj +++ b/JWT.xcodeproj/project.pbxproj @@ -6,20 +6,6 @@ objectVersion = 46; objects = { -/* Begin PBXAggregateTarget section */ - D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */ = { - isa = PBXAggregateTarget; - buildConfigurationList = D0A831672110E20A00DEA3E1 /* Build configuration list for PBXAggregateTarget "CommonCryptoModuleMap" */; - buildPhases = ( - D0A8316A2110E23200DEA3E1 /* ShellScript */, - ); - dependencies = ( - ); - name = CommonCryptoModuleMap; - productName = CommonCryptoModuleMap; - }; -/* End PBXAggregateTarget section */ - /* Begin PBXBuildFile section */ 271E10801F90253300B5033C /* JWA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 271E107F1F90253300B5033C /* JWA.swift */; }; 271E10811F90253300B5033C /* JWA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 271E107F1F90253300B5033C /* JWA.swift */; }; @@ -91,34 +77,6 @@ remoteGlobalIDString = 279D639B1AD07FFF0024E2BC; remoteInfo = JWT; }; - D0A8316B2110E2A700DEA3E1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 279D63931AD07FFF0024E2BC /* Project object */; - proxyType = 1; - remoteGlobalIDString = D0A831662110E20A00DEA3E1; - remoteInfo = CommonCryptoModuleMap; - }; - D0A8316D2110E2AF00DEA3E1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 279D63931AD07FFF0024E2BC /* Project object */; - proxyType = 1; - remoteGlobalIDString = D0A831662110E20A00DEA3E1; - remoteInfo = CommonCryptoModuleMap; - }; - D0A8316F2110E2B500DEA3E1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 279D63931AD07FFF0024E2BC /* Project object */; - proxyType = 1; - remoteGlobalIDString = D0A831662110E20A00DEA3E1; - remoteInfo = CommonCryptoModuleMap; - }; - D0A831712110E2BC00DEA3E1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 279D63931AD07FFF0024E2BC /* Project object */; - proxyType = 1; - remoteGlobalIDString = D0A831662110E20A00DEA3E1; - remoteInfo = CommonCryptoModuleMap; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -153,6 +111,7 @@ CD9B62351C7753EC005D4844 /* JWT.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JWT.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CD9B62471C7753FB005D4844 /* JWT.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JWT.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CE8198B6E30BA6B8F8125FA7 /* Pods_JWTTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_JWTTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D0882E042111B6460012248F /* Build-Phases */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "Build-Phases"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -218,6 +177,7 @@ 279D63921AD07FFF0024E2BC = { isa = PBXGroup; children = ( + D0882E042111B6460012248F /* Build-Phases */, 520A711B1C469F440005C709 /* Package.swift */, 520A71121C469F010005C709 /* Sources */, 279D639E1AD07FFF0024E2BC /* Sources */, @@ -342,6 +302,7 @@ isa = PBXNativeTarget; buildConfigurationList = 279D63B21AD07FFF0024E2BC /* Build configuration list for PBXNativeTarget "JWT-OSX" */; buildPhases = ( + D0882DFF2111B2CE0012248F /* Run Script: CommonCrypto */, 279D63971AD07FFF0024E2BC /* Sources */, 279D63981AD07FFF0024E2BC /* Frameworks */, 279D63991AD07FFF0024E2BC /* Headers */, @@ -350,7 +311,6 @@ buildRules = ( ); dependencies = ( - D0A8316C2110E2A700DEA3E1 /* PBXTargetDependency */, ); name = "JWT-OSX"; productName = JWT; @@ -379,6 +339,7 @@ isa = PBXNativeTarget; buildConfigurationList = CD9B62201C7753D8005D4844 /* Build configuration list for PBXNativeTarget "JWT-iOS" */; buildPhases = ( + D0882E012111B5C70012248F /* Run Script: CommonCrypto */, CD9B62161C7753D8005D4844 /* Sources */, CD9B621B1C7753D8005D4844 /* Frameworks */, CD9B621D1C7753D8005D4844 /* Headers */, @@ -387,7 +348,6 @@ buildRules = ( ); dependencies = ( - D0A8316E2110E2AF00DEA3E1 /* PBXTargetDependency */, ); name = "JWT-iOS"; productName = JWT; @@ -398,6 +358,7 @@ isa = PBXNativeTarget; buildConfigurationList = CD9B62321C7753EC005D4844 /* Build configuration list for PBXNativeTarget "JWT-tvOS" */; buildPhases = ( + D0882E022111B5DC0012248F /* Run Script: CommonCrypto */, CD9B62281C7753EC005D4844 /* Sources */, CD9B622D1C7753EC005D4844 /* Frameworks */, CD9B622F1C7753EC005D4844 /* Headers */, @@ -406,7 +367,6 @@ buildRules = ( ); dependencies = ( - D0A831702110E2B500DEA3E1 /* PBXTargetDependency */, ); name = "JWT-tvOS"; productName = JWT; @@ -417,6 +377,7 @@ isa = PBXNativeTarget; buildConfigurationList = CD9B62441C7753FB005D4844 /* Build configuration list for PBXNativeTarget "JWT-watchOS" */; buildPhases = ( + D0882E032111B5EE0012248F /* Run Script: CommonCrypto */, CD9B623A1C7753FB005D4844 /* Sources */, CD9B623F1C7753FB005D4844 /* Frameworks */, CD9B62411C7753FB005D4844 /* Headers */, @@ -425,7 +386,6 @@ buildRules = ( ); dependencies = ( - D0A831722110E2BC00DEA3E1 /* PBXTargetDependency */, ); name = "JWT-watchOS"; productName = JWT; @@ -449,10 +409,6 @@ 279D63A61AD07FFF0024E2BC = { CreatedOnToolsVersion = 6.2; }; - D0A831662110E20A00DEA3E1 = { - CreatedOnToolsVersion = 10.0; - ProvisioningStyle = Automatic; - }; }; }; buildConfigurationList = 279D63961AD07FFF0024E2BC /* Build configuration list for PBXProject "JWT" */; @@ -472,7 +428,6 @@ CD9B62251C7753EC005D4844 /* JWT-tvOS */, CD9B62371C7753FB005D4844 /* JWT-watchOS */, 279D63A61AD07FFF0024E2BC /* JWTTests */, - D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */, ); }; /* End PBXProject section */ @@ -516,18 +471,61 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - D0A8316A2110E23200DEA3E1 /* ShellScript */ = { + D0882DFF2111B2CE0012248F /* Run Script: CommonCrypto */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script: CommonCrypto"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "$SRCROOT/Build-Phases/common-crypto.sh"; + }; + D0882E012111B5C70012248F /* Run Script: CommonCrypto */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script: CommonCrypto"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "$SRCROOT/Build-Phases/common-crypto.sh"; + }; + D0882E022111B5DC0012248F /* Run Script: CommonCrypto */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); + name = "Run Script: CommonCrypto"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "COMMON_CRYPTO_DIR=\"${SDKROOT}/usr/include/CommonCrypto\"\nif [ -f \"${COMMON_CRYPTO_DIR}/module.modulemap\" ]\nthen\necho \"CommonCrypto already exists, skipping\"\nelse\n# This if-statement means we'll only run the main script if the CommonCryptoModuleMap directory doesn't exist\n# Because otherwise the rest of the script causes a full recompile for anything where CommonCrypto is a dependency\n# Do a \"Clean Build Folder\" to remove this directory and trigger the rest of the script to run\nif [ -d \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap\" ]; then\necho \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap directory already exists, so skipping the rest of the script.\"\nexit 0\nfi\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap\"\ncat < \"${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap/module.modulemap\"\nmodule CommonCrypto [system] {\n header \"${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h\"\n export *\n}\nEOF\necho \"Built ${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap directory\"\nfi"; + shellScript = "$SRCROOT/Build-Phases/common-crypto.sh"; + }; + D0882E032111B5EE0012248F /* Run Script: CommonCrypto */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script: CommonCrypto"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "$SRCROOT/Build-Phases/common-crypto.sh"; }; /* End PBXShellScriptBuildPhase section */ @@ -630,26 +628,6 @@ target = 279D639B1AD07FFF0024E2BC /* JWT-OSX */; targetProxy = 279D63A91AD07FFF0024E2BC /* PBXContainerItemProxy */; }; - D0A8316C2110E2A700DEA3E1 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */; - targetProxy = D0A8316B2110E2A700DEA3E1 /* PBXContainerItemProxy */; - }; - D0A8316E2110E2AF00DEA3E1 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */; - targetProxy = D0A8316D2110E2AF00DEA3E1 /* PBXContainerItemProxy */; - }; - D0A831702110E2B500DEA3E1 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */; - targetProxy = D0A8316F2110E2B500DEA3E1 /* PBXContainerItemProxy */; - }; - D0A831722110E2BC00DEA3E1 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = D0A831662110E20A00DEA3E1 /* CommonCryptoModuleMap */; - targetProxy = D0A831712110E2BC00DEA3E1 /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -947,24 +925,6 @@ }; name = Release; }; - D0A831682110E20A00DEA3E1 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - PRODUCT_NAME = "$(TARGET_NAME)"; - SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvsimulator appletvos watchsimulator watchos"; - }; - name = Debug; - }; - D0A831692110E20A00DEA3E1 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - PRODUCT_NAME = "$(TARGET_NAME)"; - SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos appletvsimulator appletvos watchsimulator watchos"; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1022,15 +982,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - D0A831672110E20A00DEA3E1 /* Build configuration list for PBXAggregateTarget "CommonCryptoModuleMap" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - D0A831682110E20A00DEA3E1 /* Debug */, - D0A831692110E20A00DEA3E1 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = 279D63931AD07FFF0024E2BC /* Project object */; From c6e764ee1015d82446949bf507f23f8b63a33fb3 Mon Sep 17 00:00:00 2001 From: Aleksandar Vacic Date: Mon, 17 Sep 2018 20:43:20 +0200 Subject: [PATCH 4/4] Moved the script file into Build Settings. Should simplify CocoaPods integration --- Build-Phases/common-crypto.sh | 26 -------------------------- JWT.xcodeproj/project.pbxproj | 10 ++++------ 2 files changed, 4 insertions(+), 32 deletions(-) delete mode 100755 Build-Phases/common-crypto.sh diff --git a/Build-Phases/common-crypto.sh b/Build-Phases/common-crypto.sh deleted file mode 100755 index 6e0e0fa..0000000 --- a/Build-Phases/common-crypto.sh +++ /dev/null @@ -1,26 +0,0 @@ -COMMON_CRYPTO_DIR="${SDKROOT}/usr/include/CommonCrypto" -if [ -f "${COMMON_CRYPTO_DIR}/module.modulemap" ] -then - echo "CommonCrypto already exists, skipping" -else - # This if-statement means we'll only run the main script if the - # CommonCrypto.framework directory doesn't exist because otherwise - # the rest of the script causes a full recompile for anything - # where CommonCrypto is a dependency - # Do a "Clean Build Folder" to remove this directory and trigger - # the rest of the script to run - FRAMEWORK_DIR="${BUILT_PRODUCTS_DIR}/CommonCrypto.framework" - - if [ -d "${FRAMEWORK_DIR}" ]; then - echo "${FRAMEWORK_DIR} already exists, so skipping the rest of the script." - exit 0 - fi - - mkdir -p "${FRAMEWORK_DIR}/Modules" - echo "module CommonCrypto [system] { - header \"${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h\" - export * - }" >> "${FRAMEWORK_DIR}/Modules/module.modulemap" - - ln -sf "${SDKROOT}/usr/include/CommonCrypto" "${FRAMEWORK_DIR}/Headers" -fi diff --git a/JWT.xcodeproj/project.pbxproj b/JWT.xcodeproj/project.pbxproj index 0ba44cd..7a77318 100644 --- a/JWT.xcodeproj/project.pbxproj +++ b/JWT.xcodeproj/project.pbxproj @@ -111,7 +111,6 @@ CD9B62351C7753EC005D4844 /* JWT.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JWT.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CD9B62471C7753FB005D4844 /* JWT.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JWT.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CE8198B6E30BA6B8F8125FA7 /* Pods_JWTTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_JWTTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - D0882E042111B6460012248F /* Build-Phases */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "Build-Phases"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -177,7 +176,6 @@ 279D63921AD07FFF0024E2BC = { isa = PBXGroup; children = ( - D0882E042111B6460012248F /* Build-Phases */, 520A711B1C469F440005C709 /* Package.swift */, 520A71121C469F010005C709 /* Sources */, 279D639E1AD07FFF0024E2BC /* Sources */, @@ -483,7 +481,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "$SRCROOT/Build-Phases/common-crypto.sh"; + shellScript = "COMMON_CRYPTO_DIR=\"${SDKROOT}/usr/include/CommonCrypto\"\nif [ -f \"${COMMON_CRYPTO_DIR}/module.modulemap\" ]\nthen\necho \"CommonCrypto already exists, skipping\"\nelse\n# This if-statement means we will only run the main script if the\n# CommonCrypto.framework directory does not exist because otherwise\n# the rest of the script causes a full recompile for anything\n# where CommonCrypto is a dependency\n# Do a \"Clean Build Folder\" to remove this directory and trigger\n# the rest of the script to run\nFRAMEWORK_DIR=\"${BUILT_PRODUCTS_DIR}/CommonCrypto.framework\"\n\nif [ -d \"${FRAMEWORK_DIR}\" ]; then\necho \"${FRAMEWORK_DIR} already exists, so skipping the rest of the script.\"\nexit 0\nfi\n\nmkdir -p \"${FRAMEWORK_DIR}/Modules\"\necho \"module CommonCrypto [system] {\nheader \\\"${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h\\\"\nexport *\n}\" >> \"${FRAMEWORK_DIR}/Modules/module.modulemap\"\n\nln -sf \"${SDKROOT}/usr/include/CommonCrypto\" \"${FRAMEWORK_DIR}/Headers\"\nfi\n"; }; D0882E012111B5C70012248F /* Run Script: CommonCrypto */ = { isa = PBXShellScriptBuildPhase; @@ -497,7 +495,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "$SRCROOT/Build-Phases/common-crypto.sh"; + shellScript = "COMMON_CRYPTO_DIR=\"${SDKROOT}/usr/include/CommonCrypto\"\nif [ -f \"${COMMON_CRYPTO_DIR}/module.modulemap\" ]\nthen\necho \"CommonCrypto already exists, skipping\"\nelse\n# This if-statement means we will only run the main script if the\n# CommonCrypto.framework directory does not exist because otherwise\n# the rest of the script causes a full recompile for anything\n# where CommonCrypto is a dependency\n# Do a \"Clean Build Folder\" to remove this directory and trigger\n# the rest of the script to run\nFRAMEWORK_DIR=\"${BUILT_PRODUCTS_DIR}/CommonCrypto.framework\"\n\nif [ -d \"${FRAMEWORK_DIR}\" ]; then\necho \"${FRAMEWORK_DIR} already exists, so skipping the rest of the script.\"\nexit 0\nfi\n\nmkdir -p \"${FRAMEWORK_DIR}/Modules\"\necho \"module CommonCrypto [system] {\nheader \\\"${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h\\\"\nexport *\n}\" >> \"${FRAMEWORK_DIR}/Modules/module.modulemap\"\n\nln -sf \"${SDKROOT}/usr/include/CommonCrypto\" \"${FRAMEWORK_DIR}/Headers\"\nfi\n"; }; D0882E022111B5DC0012248F /* Run Script: CommonCrypto */ = { isa = PBXShellScriptBuildPhase; @@ -511,7 +509,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "$SRCROOT/Build-Phases/common-crypto.sh"; + shellScript = "COMMON_CRYPTO_DIR=\"${SDKROOT}/usr/include/CommonCrypto\"\nif [ -f \"${COMMON_CRYPTO_DIR}/module.modulemap\" ]\nthen\necho \"CommonCrypto already exists, skipping\"\nelse\n# This if-statement means we will only run the main script if the\n# CommonCrypto.framework directory does not exist because otherwise\n# the rest of the script causes a full recompile for anything\n# where CommonCrypto is a dependency\n# Do a \"Clean Build Folder\" to remove this directory and trigger\n# the rest of the script to run\nFRAMEWORK_DIR=\"${BUILT_PRODUCTS_DIR}/CommonCrypto.framework\"\n\nif [ -d \"${FRAMEWORK_DIR}\" ]; then\necho \"${FRAMEWORK_DIR} already exists, so skipping the rest of the script.\"\nexit 0\nfi\n\nmkdir -p \"${FRAMEWORK_DIR}/Modules\"\necho \"module CommonCrypto [system] {\nheader \\\"${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h\\\"\nexport *\n}\" >> \"${FRAMEWORK_DIR}/Modules/module.modulemap\"\n\nln -sf \"${SDKROOT}/usr/include/CommonCrypto\" \"${FRAMEWORK_DIR}/Headers\"\nfi\n"; }; D0882E032111B5EE0012248F /* Run Script: CommonCrypto */ = { isa = PBXShellScriptBuildPhase; @@ -525,7 +523,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "$SRCROOT/Build-Phases/common-crypto.sh"; + shellScript = "COMMON_CRYPTO_DIR=\"${SDKROOT}/usr/include/CommonCrypto\"\nif [ -f \"${COMMON_CRYPTO_DIR}/module.modulemap\" ]\nthen\necho \"CommonCrypto already exists, skipping\"\nelse\n# This if-statement means we will only run the main script if the\n# CommonCrypto.framework directory does not exist because otherwise\n# the rest of the script causes a full recompile for anything\n# where CommonCrypto is a dependency\n# Do a \"Clean Build Folder\" to remove this directory and trigger\n# the rest of the script to run\nFRAMEWORK_DIR=\"${BUILT_PRODUCTS_DIR}/CommonCrypto.framework\"\n\nif [ -d \"${FRAMEWORK_DIR}\" ]; then\necho \"${FRAMEWORK_DIR} already exists, so skipping the rest of the script.\"\nexit 0\nfi\n\nmkdir -p \"${FRAMEWORK_DIR}/Modules\"\necho \"module CommonCrypto [system] {\nheader \\\"${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h\\\"\nexport *\n}\" >> \"${FRAMEWORK_DIR}/Modules/module.modulemap\"\n\nln -sf \"${SDKROOT}/usr/include/CommonCrypto\" \"${FRAMEWORK_DIR}/Headers\"\nfi\n"; }; /* End PBXShellScriptBuildPhase section */