Skip to content

Commit

Permalink
[APP-2867] Fix project structure to push to cocoapods and SPM from on…
Browse files Browse the repository at this point in the history
…e codebase (#83)

* moved public header to include folder

* fixed ExampleSwift - Local build issue

* added PrivacyInfo.xcprivacy for cocoapods and SPM

* added template
  • Loading branch information
Vladimir Espinola Lezcano authored May 22, 2024
1 parent ab9b872 commit d2eaaa1
Show file tree
Hide file tree
Showing 21 changed files with 120 additions and 113 deletions.
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## PR Type
What kind of change does this PR introduce?
- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no API changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] Tests
- [x] Other

[Jira Link](https://jira/x)

## What's new?

## Testing

## Screenshots
66 changes: 4 additions & 62 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/* Begin PBXBuildFile section */
5806DE7529774E0700C18FFA /* ProductViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5806DE7429774E0700C18FFA /* ProductViewController.m */; };
5806DE7629774E0700C18FFA /* ProductViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5806DE7429774E0700C18FFA /* ProductViewController.m */; };
58317968292EEEAA0003D6B0 /* (null) in Sources */ = {isa = PBXBuildFile; };
58317968292EEEAA0003D6B0 /* BuildFile in Sources */ = {isa = PBXBuildFile; };
58317969292EEEAA0003D6B0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 69CCAF5628DCDE57007620BD /* ViewController.m */; };
5831796A292EEEAA0003D6B0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 69CCAF5028DCDE57007620BD /* AppDelegate.m */; };
5831796D292EEEAA0003D6B0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 69CCAF6128DCDE5A007620BD /* main.m */; };
Expand All @@ -19,7 +19,7 @@
58317974292EEEAA0003D6B0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 69CCAF5828DCDE57007620BD /* Main.storyboard */; };
588B597529B94AB100E3BA33 /* attentive_ios_sdk_framework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 588B597429B94AB100E3BA33 /* attentive_ios_sdk_framework.framework */; };
588B597629B94AB100E3BA33 /* attentive_ios_sdk_framework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 588B597429B94AB100E3BA33 /* attentive_ios_sdk_framework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
58D52E3F292EDA1600CF32DE /* (null) in Sources */ = {isa = PBXBuildFile; };
58D52E3F292EDA1600CF32DE /* BuildFile in Sources */ = {isa = PBXBuildFile; };
69CCAF5128DCDE57007620BD /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 69CCAF5028DCDE57007620BD /* AppDelegate.m */; };
69CCAF5428DCDE57007620BD /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 69CCAF5328DCDE57007620BD /* SceneDelegate.m */; };
69CCAF5728DCDE57007620BD /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 69CCAF5628DCDE57007620BD /* ViewController.m */; };
Expand All @@ -28,7 +28,6 @@
69CCAF5F28DCDE5A007620BD /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 69CCAF5D28DCDE5A007620BD /* LaunchScreen.storyboard */; };
69CCAF6228DCDE5A007620BD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 69CCAF6128DCDE5A007620BD /* main.m */; };
69D3C14C299EF2D10027934F /* CreativeUITest.m in Sources */ = {isa = PBXBuildFile; fileRef = 69D3C14B299EF2D10027934F /* CreativeUITest.m */; };
C77C85E38A76EFB4A30A63ED /* Pods_Example___Pod.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0E225173AF4DB16299D85458 /* Pods_Example___Pod.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -56,7 +55,6 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0E225173AF4DB16299D85458 /* Pods_Example___Pod.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = "Pods_Example___Pod.framework"; sourceTree = BUILT_PRODUCTS_DIR; };
5806DE7329774E0700C18FFA /* ProductViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProductViewController.h; sourceTree = "<group>"; };
5806DE7429774E0700C18FFA /* ProductViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ProductViewController.m; sourceTree = "<group>"; };
58317979292EEEAA0003D6B0 /* Example - Local.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example - Local.app"; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -78,10 +76,6 @@
69CCAF6128DCDE5A007620BD /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
69D3C149299EF2D10027934F /* CreativeUITest.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CreativeUITest.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
69D3C14B299EF2D10027934F /* CreativeUITest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CreativeUITest.m; sourceTree = "<group>"; };
6F479792BC83079236F72CF1 /* Pods-Example - Pod.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example - Pod.debug.xcconfig"; path = "Target Support Files/Pods-Example - Pod/Pods-Example - Pod.debug.xcconfig"; sourceTree = "<group>"; };
7B8828B08D7E2DB6703354E8 /* Pods-Example - Pod.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example - Pod.release.xcconfig"; path = "Target Support Files/Pods-Example - Pod/Pods-Example - Pod.release.xcconfig"; sourceTree = "<group>"; };
A6F5932642D2BF98834A4354 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = "<group>"; };
FDEDF14001E311BED132C759 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -97,7 +91,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C77C85E38A76EFB4A30A63ED /* Pods_Example___Pod.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -117,7 +110,6 @@
588B597429B94AB100E3BA33 /* attentive_ios_sdk_framework.framework */,
58317993292EF6F70003D6B0 /* attentive_ios_sdk.framework */,
5831797A292EEEB30003D6B0 /* attentive_ios_sdk.framework */,
0E225173AF4DB16299D85458 /* Pods_Example___Pod.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -183,10 +175,6 @@
EDCC1EF80CD40101E2B817BD /* Pods */ = {
isa = PBXGroup;
children = (
FDEDF14001E311BED132C759 /* Pods-Example.release.xcconfig */,
A6F5932642D2BF98834A4354 /* Pods-Example.debug.xcconfig */,
6F479792BC83079236F72CF1 /* Pods-Example - Pod.debug.xcconfig */,
7B8828B08D7E2DB6703354E8 /* Pods-Example - Pod.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
Expand Down Expand Up @@ -216,11 +204,9 @@
isa = PBXNativeTarget;
buildConfigurationList = 69CCAF6528DCDE5A007620BD /* Build configuration list for PBXNativeTarget "Example - Pod" */;
buildPhases = (
931AB5B61812DF093717F762 /* [CP] Check Pods Manifest.lock */,
69CCAF4828DCDE57007620BD /* Sources */,
69CCAF4928DCDE57007620BD /* Frameworks */,
69CCAF4A28DCDE57007620BD /* Resources */,
6C1D47BB83FAE0FB7488E601 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -317,55 +303,13 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
6C1D47BB83FAE0FB7488E601 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Example - Pod/Pods-Example - Pod-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Example - Pod/Pods-Example - Pod-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example - Pod/Pods-Example - Pod-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
931AB5B61812DF093717F762 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Example - Pod-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
58317966292EEEAA0003D6B0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5806DE7629774E0700C18FFA /* ProductViewController.m in Sources */,
58317968292EEEAA0003D6B0 /* (null) in Sources */,
58317968292EEEAA0003D6B0 /* BuildFile in Sources */,
58317969292EEEAA0003D6B0 /* ViewController.m in Sources */,
5831796A292EEEAA0003D6B0 /* AppDelegate.m in Sources */,
5831796D292EEEAA0003D6B0 /* main.m in Sources */,
Expand All @@ -378,7 +322,7 @@
buildActionMask = 2147483647;
files = (
5806DE7529774E0700C18FFA /* ProductViewController.m in Sources */,
58D52E3F292EDA1600CF32DE /* (null) in Sources */,
58D52E3F292EDA1600CF32DE /* BuildFile in Sources */,
69CCAF5728DCDE57007620BD /* ViewController.m in Sources */,
69CCAF5128DCDE57007620BD /* AppDelegate.m in Sources */,
69CCAF6228DCDE5A007620BD /* main.m in Sources */,
Expand Down Expand Up @@ -600,7 +544,6 @@
};
69CCAF6628DCDE5A007620BD /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 6F479792BC83079236F72CF1 /* Pods-Example - Pod.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand Down Expand Up @@ -630,7 +573,6 @@
};
69CCAF6728DCDE5A007620BD /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7B8828B08D7E2DB6703354E8 /* Pods-Example - Pod.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand Down
18 changes: 16 additions & 2 deletions ExampleSwift/ExampleSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
588EB7242995BC3A00C0163A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 588EB7182995BBB700C0163A /* LaunchScreen.storyboard */; };
588EB7252995BC3A00C0163A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 587DC5C3299554B00082F8D0 /* Assets.xcassets */; };
588EB7262995BC3A00C0163A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 587DC5C82995551A0082F8D0 /* Main.storyboard */; };
FB0E49E92BFBBA2F0025E281 /* attentive_ios_sdk_framework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB0E49E82BFBBA2F0025E281 /* attentive_ios_sdk_framework.framework */; };
FB0E49EA2BFBBA2F0025E281 /* attentive_ios_sdk_framework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FB0E49E82BFBBA2F0025E281 /* attentive_ios_sdk_framework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -31,6 +33,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
FB0E49EA2BFBBA2F0025E281 /* attentive_ios_sdk_framework.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -48,13 +51,15 @@
587DC5CE2995748B0082F8D0 /* ProductViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductViewController.swift; sourceTree = "<group>"; };
588EB7192995BBB700C0163A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = SOURCE_ROOT; };
588EB72C2995BC3A00C0163A /* ExampleSwift - SPM.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ExampleSwift - SPM.app"; sourceTree = BUILT_PRODUCTS_DIR; };
FB0E49E82BFBBA2F0025E281 /* attentive_ios_sdk_framework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = attentive_ios_sdk_framework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
58389AA72987647900A31A35 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FB0E49E92BFBBA2F0025E281 /* attentive_ios_sdk_framework.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -75,6 +80,7 @@
58389AAC2987647900A31A35 /* ExampleSwift */,
587DC5C5299554DF0082F8D0 /* Supporting Files */,
58389AAB2987647900A31A35 /* Products */,
FB0E49E72BFBBA2F0025E281 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -118,6 +124,14 @@
path = "ExampleSwift/Supporting Files";
sourceTree = "<group>";
};
FB0E49E72BFBBA2F0025E281 /* Frameworks */ = {
isa = PBXGroup;
children = (
FB0E49E82BFBBA2F0025E281 /* attentive_ios_sdk_framework.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -412,7 +426,7 @@
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "ExampleSwift/attentive-ios-sdk-local-bridging-header.h";
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down Expand Up @@ -455,7 +469,7 @@
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "ExampleSwift/attentive-ios-sdk-local-bridging-header.h";
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down
7 changes: 4 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ let package = Package(
platforms: [.iOS(.v12)],
products: [
.library(name: "ATTNSDKFramework", targets: ["ATTNSDKFramework"])

],
targets: [
.target(
name: "ATTNSDKFramework",
path: "Sources/"
name: "ATTNSDKFramework",
path: "Sources",
resources: [ .process("Resources") ],
publicHeadersPath: "include"
)
]
)
2 changes: 1 addition & 1 deletion Sources/Internal/ATTNInfoEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef ATTNInfoEvent_h
#define ATTNInfoEvent_h

#import "../ATTNEvent.h"
#import "ATTNEvent.h"

NS_ASSUME_NONNULL_BEGIN

Expand Down
23 changes: 23 additions & 0 deletions Sources/Resources/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyTrackingDomains</key>
<array/>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
</array>
</dict>
</plist>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 0 additions & 18 deletions Sources/include/ATTNSDKFramework.h

This file was deleted.

File renamed without changes.
4 changes: 1 addition & 3 deletions attentive-ios-sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ The Attentive IOS SDK provides the functionality to render Attentive signup unit

s.source_files = 'Sources/**/*'

# s.resource_bundles = {
# 'attentive-ios-sdk' => ['attentive-ios-sdk/Assets/*.png']
# }
s.resource_bundles = {'attentive-ios-sdk' => ['Sources/Resources/PrivacyInfo.xcprivacy']}

# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
Expand Down
Loading

0 comments on commit d2eaaa1

Please sign in to comment.