Skip to content

Commit

Permalink
feat: rename webview plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-yangy committed Sep 19, 2024
1 parent 4173eb5 commit c4f5018
Show file tree
Hide file tree
Showing 19 changed files with 109 additions and 107 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
projectPath: './sample'
githubToken: ${{ secrets.GITHUB_TOKEN }}
testMode: 'EditMode'
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: always()
with:
name: Test results
path: ${{ steps.passportTest.outputs.artifactsPath }}

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: always()
with:
name: Coverage results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
81B8C535151078DB000C56DC /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81B8C534151078DB000C56DC /* WebKit.framework */; };
81B8C53815108B89000C56DC /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81B8C53715108B89000C56DC /* Carbon.framework */; };
81E2C20C14C5684A004CE5C2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81E2C20B14C5684A004CE5C2 /* Cocoa.framework */; };
81F4B4D914C6888B001B4465 /* WebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 81F4B4D814C6888B001B4465 /* WebView.mm */; };
81F4B4D914C6888B001B4465 /* ImmutableWebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 81F4B4D814C6888B001B4465 /* ImmutableWebView.mm */; };
/* End PBXBuildFile section */

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

Expand All @@ -49,7 +49,7 @@
8102525914C573EB0022296D /* Sources */ = {
isa = PBXGroup;
children = (
81F4B4D814C6888B001B4465 /* WebView.mm */,
81F4B4D814C6888B001B4465 /* ImmutableWebView.mm */,
);
name = Sources;
sourceTree = "<group>";
Expand All @@ -67,7 +67,7 @@
81E2C20914C5684A004CE5C2 /* Products */ = {
isa = PBXGroup;
children = (
81E2C20814C5684A004CE5C2 /* WebView.bundle */,
81E2C20814C5684A004CE5C2 /* ImmutableWebView.bundle */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -101,9 +101,9 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
81E2C20714C5684A004CE5C2 /* WebView */ = {
81E2C20714C5684A004CE5C2 /* ImmutableWebView */ = {
isa = PBXNativeTarget;
buildConfigurationList = 81E2C21A14C5684A004CE5C2 /* Build configuration list for PBXNativeTarget "WebView" */;
buildConfigurationList = 81E2C21A14C5684A004CE5C2 /* Build configuration list for PBXNativeTarget "ImmutableWebView" */;
buildPhases = (
81E2C20414C5684A004CE5C2 /* Sources */,
81E2C20514C5684A004CE5C2 /* Frameworks */,
Expand All @@ -113,9 +113,9 @@
);
dependencies = (
);
name = WebView;
name = ImmutableWebView;
productName = WebView;
productReference = 81E2C20814C5684A004CE5C2 /* WebView.bundle */;
productReference = 81E2C20814C5684A004CE5C2 /* ImmutableWebView.bundle */;
productType = "com.apple.product-type.bundle";
};
/* End PBXNativeTarget section */
Expand All @@ -127,7 +127,7 @@
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1200;
};
buildConfigurationList = 81E2C20214C5684A004CE5C2 /* Build configuration list for PBXProject "WebView" */;
buildConfigurationList = 81E2C20214C5684A004CE5C2 /* Build configuration list for PBXProject "ImmutableWebView" */;
compatibilityVersion = "Xcode 8.0";
developmentRegion = en;
hasScannedForEncodings = 0;
Expand All @@ -140,7 +140,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
81E2C20714C5684A004CE5C2 /* WebView */,
81E2C20714C5684A004CE5C2 /* ImmutableWebView */,
);
};
/* End PBXProject section */
Expand All @@ -161,7 +161,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
81F4B4D914C6888B001B4465 /* WebView.mm in Sources */,
81F4B4D914C6888B001B4465 /* ImmutableWebView.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -280,7 +280,8 @@
LD_RUNPATH_SEARCH_PATHS = "";
LIBRARY_SEARCH_PATHS = "$(inherited)";
MACOSX_DEPLOYMENT_TARGET = 12.4;
PRODUCT_BUNDLE_IDENTIFIER = "net.gree.unitywebview.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_BUNDLE_IDENTIFIER = "Immutable.Browser.--PRODUCT-NAME-rfc1034identifier-";
"PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = Immutable.Browser.WebView;
PRODUCT_NAME = "$(TARGET_NAME)";
USE_HEADERMAP = YES;
WRAPPER_EXTENSION = bundle;
Expand All @@ -301,7 +302,8 @@
LD_RUNPATH_SEARCH_PATHS = "";
LIBRARY_SEARCH_PATHS = "$(inherited)";
MACOSX_DEPLOYMENT_TARGET = 12.4;
PRODUCT_BUNDLE_IDENTIFIER = "net.gree.unitywebview.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_BUNDLE_IDENTIFIER = "Immutable.Browser.--PRODUCT-NAME-rfc1034identifier-";
"PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = Immutable.Browser.WebView;
PRODUCT_NAME = "$(TARGET_NAME)";
USE_HEADERMAP = YES;
WRAPPER_EXTENSION = bundle;
Expand All @@ -311,7 +313,7 @@
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
81E2C20214C5684A004CE5C2 /* Build configuration list for PBXProject "WebView" */ = {
81E2C20214C5684A004CE5C2 /* Build configuration list for PBXProject "ImmutableWebView" */ = {
isa = XCConfigurationList;
buildConfigurations = (
81E2C21814C5684A004CE5C2 /* Debug */,
Expand All @@ -320,7 +322,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
81E2C21A14C5684A004CE5C2 /* Build configuration list for PBXNativeTarget "WebView" */ = {
81E2C21A14C5684A004CE5C2 /* Build configuration list for PBXNativeTarget "ImmutableWebView" */ = {
isa = XCConfigurationList;
buildConfigurations = (
81E2C21B14C5684A004CE5C2 /* Debug */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,26 +374,26 @@ - (nonnull ASPresentationAnchor)presentationAnchorForWebAuthenticationSession:(n
@end

extern "C" {
void *_CWebViewPlugin_Init(const char *ua);
void _CWebViewPlugin_Destroy(void *instance);
void _CWebViewPlugin_LoadURL(void *instance, const char *url);
void _CWebViewPlugin_EvaluateJS(void *instance, const char *url);
void _CWebViewPlugin_SetDelegate(DelegateCallbackFunction callback);
void _CWebViewPlugin_LaunchAuthURL(void *instance, const char *url, const char *redirectUri);
void *_CImmutableWebViewPlugin_Init(const char *ua);
void _CImmutableWebViewPlugin_Destroy(void *instance);
void _CImmutableWebViewPlugin_LoadURL(void *instance, const char *url);
void _CImmutableWebViewPlugin_EvaluateJS(void *instance, const char *url);
void _CImmutableWebViewPlugin_SetDelegate(DelegateCallbackFunction callback);
void _CImmutableWebViewPlugin_LaunchAuthURL(void *instance, const char *url, const char *redirectUri);
}

void _CWebViewPlugin_SetDelegate(DelegateCallbackFunction callback) {
void _CImmutableWebViewPlugin_SetDelegate(DelegateCallbackFunction callback) {
delegateCallback = callback;
}

void *_CWebViewPlugin_Init(const char *ua)
void *_CImmutableWebViewPlugin_Init(const char *ua)
{
CWebViewPlugin *webViewPlugin = [[CWebViewPlugin alloc] initWithUa:ua];
[_instances addObject:webViewPlugin];
return (__bridge_retained void *)webViewPlugin;
}

void _CWebViewPlugin_Destroy(void *instance)
void _CImmutableWebViewPlugin_Destroy(void *instance)
{
if (instance == NULL)
return;
Expand All @@ -403,23 +403,23 @@ void _CWebViewPlugin_Destroy(void *instance)
webViewPlugin = nil;
}

void _CWebViewPlugin_LoadURL(void *instance, const char *url)
void _CImmutableWebViewPlugin_LoadURL(void *instance, const char *url)
{
if (instance == NULL)
return;
CWebViewPlugin *webViewPlugin = (__bridge CWebViewPlugin *)instance;
[webViewPlugin loadURL:url];
}

void _CWebViewPlugin_EvaluateJS(void *instance, const char *js)
void _CImmutableWebViewPlugin_EvaluateJS(void *instance, const char *js)
{
if (instance == NULL)
return;
CWebViewPlugin *webViewPlugin = (__bridge CWebViewPlugin *)instance;
[webViewPlugin evaluateJS:js];
}

void _CWebViewPlugin_LaunchAuthURL(void *instance, const char *url, const char *redirectUri)
void _CImmutableWebViewPlugin_LaunchAuthURL(void *instance, const char *url, const char *redirectUri)
{
if (instance == NULL)
return;
Expand Down
4 changes: 2 additions & 2 deletions Plugins/Mac/install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
DSTDIR="../../src/Packages/Passport/Runtime/ThirdParty/Gree/Assets/Plugins/"
rm -rf DerivedData
xcodebuild -target WebView -configuration Release -arch x86_64 -arch arm64 build CONFIGURATION_BUILD_DIR='DerivedData' | xcbeautify
xcodebuild -target ImmutableWebView -configuration Release -arch x86_64 -arch arm64 build CONFIGURATION_BUILD_DIR='DerivedData' | xcbeautify
mkdir -p $DSTDIR

cp -r DerivedData/WebView.bundle $DSTDIR
cp -r DerivedData/ImmutableWebView.bundle $DSTDIR
rm -rf DerivedData
cp *.bundle.meta $DSTDIR
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"VoltstroStudios.UnityWebBrowser",
"UniTask",
"Immutable.Browser.Core",
"unity-webview",
"Immutable.Browser.Gree",
"Immutable.Passport.Core.Logging"
],
"includePlatforms": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"VoltstroStudios.UnityWebBrowser",
"UniTask",
"Immutable.Browser.Core",
"unity-webview",
"Immutable.Browser.Gree",
"Immutable.Passport.Runtime.Private",
"Immutable.Passport.Core.Logging"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>23B81</string>
<string>23G93</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>WebView</string>
<string>ImmutableWebView</string>
<key>CFBundleIdentifier</key>
<string>net.gree.unitywebview.WebView</string>
<string>Immutable.Browser.WebView</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>WebView</string>
<string>ImmutableWebView</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
Expand All @@ -29,19 +29,19 @@
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string></string>
<string>24A336</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>14.0</string>
<string>15.0</string>
<key>DTSDKBuild</key>
<string>23A334</string>
<string>24A336</string>
<key>DTSDKName</key>
<string>macosx14.0</string>
<string>macosx15.0</string>
<key>DTXcode</key>
<string>1501</string>
<string>1600</string>
<key>DTXcodeBuild</key>
<string>15A507</string>
<string>16A242d</string>
<key>LSMinimumSystemVersion</key>
<string>12.4</string>
</dict>
Expand Down
Binary file not shown.
Loading

0 comments on commit c4f5018

Please sign in to comment.