Skip to content

Commit 74b7b87

Browse files
committed
webgl
2 parents 1442958 + 01fdea8 commit 74b7b87

File tree

279 files changed

+12852
-539
lines changed

Some content is hidden

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

279 files changed

+12852
-539
lines changed

.github/workflows/linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
VALIDATE_ALL_CODEBASE: true
5858
DEFAULT_BRANCH: main
5959
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60-
FILTER_REGEX_EXCLUDE: (.*src/Packages/Passport/Runtime/ThirdParty/.*|.*src/Packages/Passport/Runtime/Resources/.*|.*Plugins/.*|.*src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/.*)
60+
FILTER_REGEX_EXCLUDE: (.*src/Packages/Passport/Runtime/ThirdParty/.*|.*src/Packages/Passport/Runtime/Resources/.*|.*Plugins/.*|.*src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/.*|.*src/Packages/Orderbook)
6161
VALIDATE_MARKDOWN: false
6262
VALIDATE_GITLEAKS: false
6363
VALIDATE_JSCPD: false

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ jobs:
2525
projectPath: './sample'
2626
githubToken: ${{ secrets.GITHUB_TOKEN }}
2727
testMode: 'EditMode'
28-
- uses: actions/upload-artifact@v2
28+
- uses: actions/upload-artifact@v4
2929
if: always()
3030
with:
3131
name: Test results
3232
path: ${{ steps.passportTest.outputs.artifactsPath }}
3333

34-
- uses: actions/upload-artifact@v2
34+
- uses: actions/upload-artifact@v4
3535
if: always()
3636
with:
3737
name: Coverage results

.github/workflows/update-version.yml

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
---
2-
name: "Update version in package.json"
2+
name: "Update SDK version"
33

44
on:
55
workflow_dispatch:
66
inputs:
7-
version:
8-
description: 'Version to update to (e.g. 1.20.0)'
7+
upgrade_type:
8+
type: choice
9+
description: Upgrade Type
10+
options:
11+
- patch
12+
- minor
13+
# - major
914
required: true
15+
default: patch
16+
17+
env:
18+
UPGRADE_TYPE: ${{ github.event.inputs.upgrade_type || 'patch' }}
1019

1120
jobs:
1221
update:
@@ -37,26 +46,60 @@ jobs:
3746
- name: Install jq
3847
run: sudo apt-get install -y jq
3948

40-
- name: Replace version string
49+
- name: Update Version in package.json
4150
id: replace_version
4251
run: |
43-
FILE=./src/Packages/Passport/package.json
44-
VERSION=${{ github.event.inputs.version }}
45-
jq --arg version "$VERSION" '.version = $version' $FILE > tmp.$$.json && mv tmp.$$.json $FILE
52+
PASSPORT_FILE=./src/Packages/Passport/package.json
53+
MARKETPLACE_FILE=./src/Packages/Marketplace/package.json
54+
55+
CURRENT_VERSION=$(jq -r '.version' $PASSPORT_FILE)
56+
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
57+
58+
# Increment version based on UPGRADE_TYPE
59+
case "$UPGRADE_TYPE" in
60+
major)
61+
MAJOR=$((MAJOR + 1))
62+
MINOR=0
63+
PATCH=0
64+
;;
65+
minor)
66+
MINOR=$((MINOR + 1))
67+
PATCH=0
68+
;;
69+
patch)
70+
PATCH=$((PATCH + 1))
71+
;;
72+
*)
73+
echo "Invalid upgrade type: $UPGRADE_TYPE"
74+
exit 1
75+
;;
76+
esac
77+
78+
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
79+
80+
# Update Passport package.json
81+
jq --arg version "$NEW_VERSION" '.version = $version' $PASSPORT_FILE > tmp.$$.json && mv tmp.$$.json $PASSPORT_FILE
82+
echo "Updated version in Passport package.json from $CURRENT_VERSION to $NEW_VERSION"
83+
84+
# Update Marketplace package.json
85+
jq --arg version "$NEW_VERSION" '.version = $version' $MARKETPLACE_FILE > tmp.$$.json && mv tmp.$$.json $MARKETPLACE_FILE
86+
echo "Updated version in Marketplace package.json from $CURRENT_VERSION to $NEW_VERSION"
87+
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
4688
47-
- name: Replace engine sdk version string
89+
- name: Update SDK Version in SdkVersionInfoHelpers.cs
4890
id: replace_engine_sdk_version
4991
run: |
5092
FILE=./src/Packages/Passport/Runtime/Scripts/Private/Helpers/SdkVersionInfoHelpers.cs
51-
VERSION=${{ github.event.inputs.version }}
52-
sed -i -E "s/[0-9]+\.[0-9]+\.[0-9]+/$VERSION/g" $FILE
93+
NEW_VERSION="${{ steps.replace_version.outputs.version }}"
94+
sed -i -E "s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" $FILE
95+
echo "Updated SDK version in SdkVersionInfoHelpers.cs to $NEW_VERSION"
5396
5497
- uses: gr2m/create-or-update-pull-request-action@v1
5598
env:
5699
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57100
with:
58101
title: "chore: update version"
59102
body: "Update version in package.json"
60-
branch: "chore/update-version-${{ github.event.inputs.version }}"
103+
branch: "chore/update-version-${{ steps.replace_version.outputs.version }}"
61104
commit-message: "chore: update version"
62105
labels: release

Plugins/Mac/WebView.xcodeproj/project.pbxproj renamed to Plugins/Mac/ImmutableWebView.xcodeproj/project.pbxproj

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
81B8C535151078DB000C56DC /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81B8C534151078DB000C56DC /* WebKit.framework */; };
1313
81B8C53815108B89000C56DC /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81B8C53715108B89000C56DC /* Carbon.framework */; };
1414
81E2C20C14C5684A004CE5C2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81E2C20B14C5684A004CE5C2 /* Cocoa.framework */; };
15-
81F4B4D914C6888B001B4465 /* WebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 81F4B4D814C6888B001B4465 /* WebView.mm */; };
15+
81F4B4D914C6888B001B4465 /* ImmutableWebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 81F4B4D814C6888B001B4465 /* ImmutableWebView.mm */; };
1616
/* End PBXBuildFile section */
1717

1818
/* Begin PBXFileReference section */
@@ -23,11 +23,11 @@
2323
8102525614C569D80022296D /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Prefix.pch; path = Resources/Prefix.pch; sourceTree = SOURCE_ROOT; };
2424
81B8C534151078DB000C56DC /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
2525
81B8C53715108B89000C56DC /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; };
26-
81E2C20814C5684A004CE5C2 /* WebView.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WebView.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
26+
81E2C20814C5684A004CE5C2 /* ImmutableWebView.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ImmutableWebView.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
2727
81E2C20B14C5684A004CE5C2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
2828
81E2C20E14C5684A004CE5C2 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
2929
81E2C21014C5684A004CE5C2 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
30-
81F4B4D814C6888B001B4465 /* WebView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebView.mm; path = Sources/WebView.mm; sourceTree = "<group>"; };
30+
81F4B4D814C6888B001B4465 /* ImmutableWebView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ImmutableWebView.mm; path = Sources/ImmutableWebView.mm; sourceTree = "<group>"; };
3131
81F81AEC14D76D2400845D4C /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
3232
/* End PBXFileReference section */
3333

@@ -49,7 +49,7 @@
4949
8102525914C573EB0022296D /* Sources */ = {
5050
isa = PBXGroup;
5151
children = (
52-
81F4B4D814C6888B001B4465 /* WebView.mm */,
52+
81F4B4D814C6888B001B4465 /* ImmutableWebView.mm */,
5353
);
5454
name = Sources;
5555
sourceTree = "<group>";
@@ -67,7 +67,7 @@
6767
81E2C20914C5684A004CE5C2 /* Products */ = {
6868
isa = PBXGroup;
6969
children = (
70-
81E2C20814C5684A004CE5C2 /* WebView.bundle */,
70+
81E2C20814C5684A004CE5C2 /* ImmutableWebView.bundle */,
7171
);
7272
name = Products;
7373
sourceTree = "<group>";
@@ -101,9 +101,9 @@
101101
/* End PBXGroup section */
102102

103103
/* Begin PBXNativeTarget section */
104-
81E2C20714C5684A004CE5C2 /* WebView */ = {
104+
81E2C20714C5684A004CE5C2 /* ImmutableWebView */ = {
105105
isa = PBXNativeTarget;
106-
buildConfigurationList = 81E2C21A14C5684A004CE5C2 /* Build configuration list for PBXNativeTarget "WebView" */;
106+
buildConfigurationList = 81E2C21A14C5684A004CE5C2 /* Build configuration list for PBXNativeTarget "ImmutableWebView" */;
107107
buildPhases = (
108108
81E2C20414C5684A004CE5C2 /* Sources */,
109109
81E2C20514C5684A004CE5C2 /* Frameworks */,
@@ -113,9 +113,9 @@
113113
);
114114
dependencies = (
115115
);
116-
name = WebView;
116+
name = ImmutableWebView;
117117
productName = WebView;
118-
productReference = 81E2C20814C5684A004CE5C2 /* WebView.bundle */;
118+
productReference = 81E2C20814C5684A004CE5C2 /* ImmutableWebView.bundle */;
119119
productType = "com.apple.product-type.bundle";
120120
};
121121
/* End PBXNativeTarget section */
@@ -127,7 +127,7 @@
127127
BuildIndependentTargetsInParallel = YES;
128128
LastUpgradeCheck = 1200;
129129
};
130-
buildConfigurationList = 81E2C20214C5684A004CE5C2 /* Build configuration list for PBXProject "WebView" */;
130+
buildConfigurationList = 81E2C20214C5684A004CE5C2 /* Build configuration list for PBXProject "ImmutableWebView" */;
131131
compatibilityVersion = "Xcode 8.0";
132132
developmentRegion = en;
133133
hasScannedForEncodings = 0;
@@ -140,7 +140,7 @@
140140
projectDirPath = "";
141141
projectRoot = "";
142142
targets = (
143-
81E2C20714C5684A004CE5C2 /* WebView */,
143+
81E2C20714C5684A004CE5C2 /* ImmutableWebView */,
144144
);
145145
};
146146
/* End PBXProject section */
@@ -161,7 +161,7 @@
161161
isa = PBXSourcesBuildPhase;
162162
buildActionMask = 2147483647;
163163
files = (
164-
81F4B4D914C6888B001B4465 /* WebView.mm in Sources */,
164+
81F4B4D914C6888B001B4465 /* ImmutableWebView.mm in Sources */,
165165
);
166166
runOnlyForDeploymentPostprocessing = 0;
167167
};
@@ -280,7 +280,8 @@
280280
LD_RUNPATH_SEARCH_PATHS = "";
281281
LIBRARY_SEARCH_PATHS = "$(inherited)";
282282
MACOSX_DEPLOYMENT_TARGET = 12.4;
283-
PRODUCT_BUNDLE_IDENTIFIER = "net.gree.unitywebview.${PRODUCT_NAME:rfc1034identifier}";
283+
PRODUCT_BUNDLE_IDENTIFIER = "Immutable.Browser.--PRODUCT-NAME-rfc1034identifier-";
284+
"PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = Immutable.Browser.WebView;
284285
PRODUCT_NAME = "$(TARGET_NAME)";
285286
USE_HEADERMAP = YES;
286287
WRAPPER_EXTENSION = bundle;
@@ -301,7 +302,8 @@
301302
LD_RUNPATH_SEARCH_PATHS = "";
302303
LIBRARY_SEARCH_PATHS = "$(inherited)";
303304
MACOSX_DEPLOYMENT_TARGET = 12.4;
304-
PRODUCT_BUNDLE_IDENTIFIER = "net.gree.unitywebview.${PRODUCT_NAME:rfc1034identifier}";
305+
PRODUCT_BUNDLE_IDENTIFIER = "Immutable.Browser.--PRODUCT-NAME-rfc1034identifier-";
306+
"PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = Immutable.Browser.WebView;
305307
PRODUCT_NAME = "$(TARGET_NAME)";
306308
USE_HEADERMAP = YES;
307309
WRAPPER_EXTENSION = bundle;
@@ -311,7 +313,7 @@
311313
/* End XCBuildConfiguration section */
312314

313315
/* Begin XCConfigurationList section */
314-
81E2C20214C5684A004CE5C2 /* Build configuration list for PBXProject "WebView" */ = {
316+
81E2C20214C5684A004CE5C2 /* Build configuration list for PBXProject "ImmutableWebView" */ = {
315317
isa = XCConfigurationList;
316318
buildConfigurations = (
317319
81E2C21814C5684A004CE5C2 /* Debug */,
@@ -320,7 +322,7 @@
320322
defaultConfigurationIsVisible = 0;
321323
defaultConfigurationName = Release;
322324
};
323-
81E2C21A14C5684A004CE5C2 /* Build configuration list for PBXNativeTarget "WebView" */ = {
325+
81E2C21A14C5684A004CE5C2 /* Build configuration list for PBXNativeTarget "ImmutableWebView" */ = {
324326
isa = XCConfigurationList;
325327
buildConfigurations = (
326328
81E2C21B14C5684A004CE5C2 /* Debug */,

Plugins/Mac/Sources/WebView.mm renamed to Plugins/Mac/Sources/ImmutableWebView.mm

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -374,26 +374,26 @@ - (nonnull ASPresentationAnchor)presentationAnchorForWebAuthenticationSession:(n
374374
@end
375375

376376
extern "C" {
377-
void *_CWebViewPlugin_Init(const char *ua);
378-
void _CWebViewPlugin_Destroy(void *instance);
379-
void _CWebViewPlugin_LoadURL(void *instance, const char *url);
380-
void _CWebViewPlugin_EvaluateJS(void *instance, const char *url);
381-
void _CWebViewPlugin_SetDelegate(DelegateCallbackFunction callback);
382-
void _CWebViewPlugin_LaunchAuthURL(void *instance, const char *url, const char *redirectUri);
377+
void *_CImmutableWebViewPlugin_Init(const char *ua);
378+
void _CImmutableWebViewPlugin_Destroy(void *instance);
379+
void _CImmutableWebViewPlugin_LoadURL(void *instance, const char *url);
380+
void _CImmutableWebViewPlugin_EvaluateJS(void *instance, const char *url);
381+
void _CImmutableWebViewPlugin_SetDelegate(DelegateCallbackFunction callback);
382+
void _CImmutableWebViewPlugin_LaunchAuthURL(void *instance, const char *url, const char *redirectUri);
383383
}
384384

385-
void _CWebViewPlugin_SetDelegate(DelegateCallbackFunction callback) {
385+
void _CImmutableWebViewPlugin_SetDelegate(DelegateCallbackFunction callback) {
386386
delegateCallback = callback;
387387
}
388388

389-
void *_CWebViewPlugin_Init(const char *ua)
389+
void *_CImmutableWebViewPlugin_Init(const char *ua)
390390
{
391391
CWebViewPlugin *webViewPlugin = [[CWebViewPlugin alloc] initWithUa:ua];
392392
[_instances addObject:webViewPlugin];
393393
return (__bridge_retained void *)webViewPlugin;
394394
}
395395

396-
void _CWebViewPlugin_Destroy(void *instance)
396+
void _CImmutableWebViewPlugin_Destroy(void *instance)
397397
{
398398
if (instance == NULL)
399399
return;
@@ -403,23 +403,23 @@ void _CWebViewPlugin_Destroy(void *instance)
403403
webViewPlugin = nil;
404404
}
405405

406-
void _CWebViewPlugin_LoadURL(void *instance, const char *url)
406+
void _CImmutableWebViewPlugin_LoadURL(void *instance, const char *url)
407407
{
408408
if (instance == NULL)
409409
return;
410410
CWebViewPlugin *webViewPlugin = (__bridge CWebViewPlugin *)instance;
411411
[webViewPlugin loadURL:url];
412412
}
413413

414-
void _CWebViewPlugin_EvaluateJS(void *instance, const char *js)
414+
void _CImmutableWebViewPlugin_EvaluateJS(void *instance, const char *js)
415415
{
416416
if (instance == NULL)
417417
return;
418418
CWebViewPlugin *webViewPlugin = (__bridge CWebViewPlugin *)instance;
419419
[webViewPlugin evaluateJS:js];
420420
}
421421

422-
void _CWebViewPlugin_LaunchAuthURL(void *instance, const char *url, const char *redirectUri)
422+
void _CImmutableWebViewPlugin_LaunchAuthURL(void *instance, const char *url, const char *redirectUri)
423423
{
424424
if (instance == NULL)
425425
return;

Plugins/Mac/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
22
DSTDIR="../../src/Packages/Passport/Runtime/ThirdParty/Gree/Assets/Plugins/"
33
rm -rf DerivedData
4-
xcodebuild -target WebView -configuration Release -arch x86_64 -arch arm64 build CONFIGURATION_BUILD_DIR='DerivedData' | xcbeautify
4+
xcodebuild -target ImmutableWebView -configuration Release -arch x86_64 -arch arm64 build CONFIGURATION_BUILD_DIR='DerivedData' | xcbeautify
55
mkdir -p $DSTDIR
66

7-
cp -r DerivedData/WebView.bundle $DSTDIR
7+
cp -r DerivedData/ImmutableWebView.bundle $DSTDIR
88
rm -rf DerivedData
99
cp *.bundle.meta $DSTDIR

sample/Assets/Scripts/SelectAuthMethodScript.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void Start()
2222
// If PKCE is not supported, initialise Passport to use Device Code Auth
2323
if (!SampleAppManager.SupportsPKCE)
2424
{
25-
InitialisePassport();
25+
InitialisePassport(logoutRedirectUri: "https://www.immutable.com");
2626
}
2727
}
2828

@@ -44,7 +44,7 @@ private bool IsPKCESupported()
4444
public void UseDeviceCodeAuth()
4545
{
4646
SampleAppManager.UsePKCE = false;
47-
InitialisePassport();
47+
InitialisePassport(logoutRedirectUri: "https://www.immutable.com");
4848
}
4949

5050
/// <summary>
@@ -61,7 +61,7 @@ public void UsePKCE()
6161
/// </summary>
6262
/// <param name="redirectUri">(Android, iOS and macOS only) The URL to which auth will redirect the browser after
6363
/// authorisation has been granted by the user</param>
64-
/// <param name="logoutRedirectUri">(Android, iOS and macOS only) The URL to which auth will redirect the browser
64+
/// <param name="logoutRedirectUri">The URL to which auth will redirect the browser
6565
/// after log out is complete</param>
6666
private async void InitialisePassport(string redirectUri = null, string logoutRedirectUri = null)
6767
{

sample/Packages/manifest.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"com.alttester.sdk": "2.1.1",
44
"com.cysharp.unitask": "2.3.3",
55
"com.immutable.passport": "file:../../src/Packages/Passport",
6+
"com.immutable.marketplace": "file:../../src/Packages/Marketplace",
7+
"com.immutable.orderbook": "file:../../src/Packages/Orderbook",
68
"com.unity.ai.navigation": "1.1.4",
79
"com.unity.ide.visualstudio": "2.0.21",
810
"com.unity.ide.vscode": "1.2.5",

sample/Packages/packages-lock.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@
1414
"dependencies": {},
1515
"url": "https://package.openupm.com"
1616
},
17+
"com.immutable.marketplace": {
18+
"version": "file:../../src/Packages/Marketplace",
19+
"depth": 0,
20+
"source": "local",
21+
"dependencies": {
22+
"com.cysharp.unitask": "2.3.3"
23+
}
24+
},
25+
"com.immutable.orderbook": {
26+
"version": "file:../../src/Packages/Orderbook",
27+
"depth": 0,
28+
"source": "local",
29+
"dependencies": {
30+
"com.cysharp.unitask": "2.3.3"
31+
}
32+
},
1733
"com.immutable.passport": {
1834
"version": "file:../../src/Packages/Passport",
1935
"depth": 0,

0 commit comments

Comments
 (0)