Skip to content

Commit 667d39d

Browse files
committed
ci: add Test project, CI job for IL2CCP testing
1 parent be3d4b4 commit 667d39d

108 files changed

Lines changed: 13935 additions & 5 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-test.yml

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,53 @@ jobs:
4343
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
4444
with:
4545
targetPlatform: ${{ matrix.targetPlatform }}
46-
# - uses: actions/upload-artifact@v2
47-
# with:
48-
# name: Build-${{ matrix.targetPlatform }}
49-
# path: build/${{ matrix.targetPlatform }}
46+
buildAndroidSampleApp:
47+
name: Build Android Sample app
48+
needs: [pr-branch-check-name, pr-title-check, pr-branch-target-gitflow]
49+
if: always() && !failure()
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: "Checkout"
53+
uses: actions/checkout@v2
54+
with:
55+
fetch-depth: 0
56+
lfs: true
57+
- name: Setup Unity
58+
uses: kuler90/setup-unity@v1
59+
with:
60+
unity-version: 2020.3.32f1
61+
unity-modules: android
62+
- name: Activate Unity
63+
uses: kuler90/activate-unity@v1
64+
with:
65+
unity-username: ${{ secrets.UNITY_EMAIL }}
66+
unity-password: ${{ secrets.UNITY_PASSWORD }}
67+
unity-serial: ${{ secrets.UNITY_SERIAL }}
68+
- name: "Build Android Sample app"
69+
run: ./buildscript.sh; ./testAndroidBuild.sh
70+
buildiOSSampleApp:
71+
name: Build Android Sample app
72+
needs: [pr-branch-check-name, pr-title-check, pr-branch-target-gitflow]
73+
if: always() && !failure()
74+
runs-on: ubuntu-latest
75+
steps:
76+
- name: "Checkout"
77+
uses: actions/checkout@v2
78+
with:
79+
fetch-depth: 0
80+
lfs: true
81+
- name: Setup Unity
82+
uses: kuler90/setup-unity@v1
83+
with:
84+
unity-version: 2020.3.32f1
85+
unity-modules: android
86+
- name: Activate Unity
87+
uses: kuler90/activate-unity@v1
88+
with:
89+
unity-username: ${{ secrets.UNITY_EMAIL }}
90+
unity-password: ${{ secrets.UNITY_PASSWORD }}
91+
unity-serial: ${{ secrets.UNITY_SERIAL }}
92+
- name: "Build iOS Sample app"
93+
run: ./buildscript.sh; ./testIOSBuild.sh
94+
95+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
using UnityEditor;
3+
using UnityEditor.Callbacks;
4+
#if UNITY_IOS
5+
using UnityEditor.iOS.Xcode;
6+
using UnityEditor.iOS.Xcode.Extensions;
7+
#endif
8+
9+
namespace mParticle
10+
{
11+
public class BuildPostProcessor
12+
{
13+
[PostProcessBuild]
14+
public static void OnPostProcessBuild(BuildTarget target, string path)
15+
{
16+
#if UNITY_IOS
17+
if (target == BuildTarget.iOS)
18+
{
19+
// Get project into C#
20+
var projectPath = PBXProject.GetPBXProjectPath(path);
21+
var project = new PBXProject();
22+
project.ReadFromFile(projectPath);
23+
24+
// Fix Xcode build settings
25+
var projectGUID = project.ProjectGuid();
26+
project.SetBuildProperty(projectGUID, "VALIDATE_WORKSPACE", "YES");
27+
project.SetBuildProperty(projectGUID, "GCC_ENABLE_OBJC_EXCEPTIONS", "YES");
28+
29+
// Embed mParticle framework
30+
var mainTargetGUID = project.GetUnityMainTargetGuid();
31+
var frameworkFileGUID = project.FindFileGuidByProjectPath("Frameworks/Plugins/iOS/mParticle_Apple_SDK.framework");
32+
project.AddFileToEmbedFrameworks(mainTargetGUID, frameworkFileGUID);
33+
34+
// Overwrite
35+
project.WriteToFile(projectPath);
36+
}
37+
#endif
38+
}
39+
}
40+
}
408 KB
Binary file not shown.
402 KB
Binary file not shown.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#ifndef mParticle_mParticleUnity_h
2+
#define mParticle_mParticleUnity_h
3+
4+
void _Initialize(const char *optionsJSON);
5+
int _GetEnvironment(void *empty);
6+
void _SetOptOut(int optOut);
7+
void _SetUploadInterval(int uploadInterval);
8+
9+
void _LogEvent(const char *mpEvent);
10+
void _LogCommerceEvent(const char *commerceEventJSON);
11+
void _LogScreen(const char *screenName);
12+
void _SetATTStatus(int status, double timestamp);
13+
14+
void _LeaveBreadcrumb(const char *breadcrumbName);
15+
16+
void _Upload(void);
17+
void _Destroy(void);
18+
19+
20+
char* _Identity_Identify(const char *identityApiRequestJSON);
21+
char* _Identity_Login(const char *identityApiRequestJSON);
22+
char* _Identity_Logout(const char *identityApiRequestJSON);
23+
char* _Identity_Modify(const char *identityApiRequestJSON);
24+
25+
void _Identity_AddIdentityStateListener(void);
26+
void _Identity_RemoveIdentityStateListener(void);
27+
28+
char* _Identity_GetCurrentUser(void);
29+
char* _Identity_GetUser(const char *mpid);
30+
31+
char* _User_SetUserAttribute(const char *mpid, const char *key, const char *value);
32+
char* _User_SetUserAttributes(const char *mpid, const char *attributesJSON);
33+
char* _User_SetUserTag(const char *mpid, const char *tag);
34+
char* _User_RemoveUserAttribute(const char *mpid, const char *key);
35+
char* _User_GetUserAttributes(const char *mpid);
36+
37+
char* _User_GetUserIdentities(const char *mpid);
38+
char* _User_GetCurrentUserMpid(const char *mpid);
39+
40+
#endif
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// FilteredMPIdentityApiRequest.h
3+
//
4+
5+
#import <Foundation/Foundation.h>
6+
#import "FilteredMParticleUser.h"
7+
8+
NS_ASSUME_NONNULL_BEGIN
9+
@class MPIdentityApiRequest;
10+
11+
/**
12+
A filtered version of the identity request object for sending to kits
13+
*/
14+
@interface FilteredMPIdentityApiRequest : NSObject
15+
16+
@property (nonatomic, strong, nullable, readonly) NSString *email;
17+
@property (nonatomic, strong, nullable, readonly) NSString *customerId;
18+
@property (nonatomic, strong, nullable, readonly) NSDictionary<NSNumber *, NSString *> *userIdentities;
19+
20+
- (instancetype)initWithIdentityRequest:(MPIdentityApiRequest *)request kitConfiguration:(MPKitConfiguration *)kitConfiguration;
21+
22+
@end
23+
24+
NS_ASSUME_NONNULL_END
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//
2+
// FilteredMParticleUser.h
3+
//
4+
5+
#import <Foundation/Foundation.h>
6+
7+
@class MParticleUser;
8+
@class MPKitConfiguration;
9+
10+
@interface FilteredMParticleUser : NSObject
11+
12+
@property(readonly, strong, nonnull) NSNumber *userId;
13+
14+
/**
15+
Returns whether this user is currently logged in
16+
*/
17+
@property(readonly) BOOL isLoggedIn;
18+
19+
/**
20+
Gets current user identities (readonly)
21+
@returns A dictionary containing the collection of user identities
22+
@see MPUserIdentity
23+
*/
24+
@property (readonly, strong, nonnull) NSDictionary<NSNumber *, NSString *> *userIdentities;
25+
26+
/**
27+
Gets all user attributes.
28+
@returns A dictionary containing the collection of user attributes.
29+
*/
30+
@property (readonly, strong, nonnull) NSDictionary<NSString *, id> *userAttributes;
31+
32+
- (instancetype _Nonnull )initWithMParticleUser:(MParticleUser *_Nonnull)user kitConfiguration:(MPKitConfiguration *_Nonnull)kitConfiguration;
33+
34+
@end
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
//
2+
// MPAliasRequest.h
3+
//
4+
5+
#import <Foundation/Foundation.h>
6+
#import "MParticleUser.h"
7+
8+
NS_ASSUME_NONNULL_BEGIN
9+
10+
/**
11+
A request to copy data from one user to another, constrained to a particular time period.
12+
13+
Note that this request will not automatically copy user attributes to the destination user--this must be done manually, if desired.
14+
*/
15+
@interface MPAliasRequest : NSObject
16+
17+
/**
18+
Creates a request specifying a source and destination user.
19+
20+
Alias start and end times will be automatically inferred based on the sourceUser's `firstSeen` and `lastSeen` properties.
21+
22+
If the first/last seen dates are earlier than the supported alias max time window, they will be adjusted automatically.
23+
24+
You can obtain user objects by indexing into the array returned by `[MParticle.sharedInstance.identity getAllUsers]` or by calling `[MParticle.sharedInstance.identity getUser:<MPID>]`.
25+
26+
Note that when using the latter method the user IDs must be known to the SDK or the call to `getUser:` will return nil.
27+
*/
28+
+ (MPAliasRequest *)requestWithSourceUser:(MParticleUser *)sourceUser destinationUser:(MParticleUser *)destinationUser;
29+
30+
/**
31+
Creates a request specifying source and destination MPIDs and explicitly providing start and end times.
32+
33+
(MPID is also referred to as the `userId` property on `MParticleUser`.)
34+
35+
Unlike the above method, these dates will be sent to the server without adjusting them to take into account the alias max time window.
36+
37+
You can register a listener to get any errors that may be returned if the start/end times are outside the range accepted by the server. See `MPListenerController#onAliasRequestFinished:`.
38+
39+
Additionally, to support any potential advanced use cases, this method does not require MPIDs to be known to the SDK to perform the alias request.
40+
*/
41+
+ (MPAliasRequest *)requestWithSourceMPID:(NSNumber *)sourceMPID destinationMPID:(NSNumber *)destinationMPID startTime:(NSDate *)startTime endTime:(NSDate *)endTime;
42+
43+
/**
44+
The MPID of the user that has existing data.
45+
*/
46+
@property (nonatomic, strong, readonly) NSNumber *sourceMPID;
47+
48+
/**
49+
The MPID of the user that should receive the copied data.
50+
*/
51+
@property (nonatomic, strong, readonly) NSNumber *destinationMPID;
52+
53+
/**
54+
The timestamp of the earliest data that should be copied, defaults to the source user's first seen timestamp.
55+
*/
56+
@property (nonatomic, strong, readonly) NSDate *startTime;
57+
58+
/**
59+
The timestamp of the latest data that should be copied, defaults to the source user's last seen timestamp.
60+
*/
61+
@property (nonatomic, strong, readonly) NSDate *endTime;
62+
63+
/**
64+
Whether the start/end times were automatically inferred from the source user's firstSeen and lastSeen properties
65+
*/
66+
@property (nonatomic, assign, readonly) BOOL usedFirstLastSeen;
67+
68+
@end
69+
70+
NS_ASSUME_NONNULL_END
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
//
2+
// MPAliasResponse.h
3+
//
4+
5+
#import <Foundation/Foundation.h>
6+
#import "MPAliasRequest.h"
7+
8+
NS_ASSUME_NONNULL_BEGIN
9+
10+
/**
11+
A response object representing the result of an alias request.
12+
*/
13+
@interface MPAliasResponse : NSObject
14+
15+
/**
16+
The HTTP response code returned by the server.
17+
*/
18+
@property (nonatomic, assign) NSInteger responseCode;
19+
20+
/**
21+
A human-readable error message returned by the server.
22+
*/
23+
@property (nonatomic, assign) NSString *errorResponse;
24+
25+
/**
26+
The corresponding alias request for this response.
27+
*/
28+
@property (nonatomic, strong) MPAliasRequest *request;
29+
30+
/**
31+
A random GUID associated with each alias request.
32+
*/
33+
@property (nonatomic, strong) NSString *requestID;
34+
35+
/**
36+
Whether the SDK will automatically try to re-send the alias request.
37+
*/
38+
@property (nonatomic, assign) BOOL willRetry;
39+
40+
/**
41+
Whether the alias request was successfully accepted by the server.
42+
*/
43+
@property (nonatomic, assign) BOOL isSuccessful;
44+
45+
@end
46+
47+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)