diff options
author | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2021-01-28 22:45:57 -0500 |
---|---|---|
committer | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2021-01-28 22:45:57 -0500 |
commit | 43a8d866a4703aac8c545562eb8e2d3a610c4f68 (patch) | |
tree | 2dcaf6be0cec33065860262f1cc209387de45ed0 | |
parent | 97b916f0c1baeb2d931bb9457b0f2e8b966c4964 (diff) | |
download | taler-ios-43a8d866a4703aac8c545562eb8e2d3a610c4f68.tar.gz taler-ios-43a8d866a4703aac8c545562eb8e2d3a610c4f68.tar.bz2 taler-ios-43a8d866a4703aac8c545562eb8e2d3a610c4f68.zip |
add node to swift/objc bridge
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Taler.xcodeproj/project.pbxproj | 365 | ||||
-rw-r--r-- | Taler.xcodeproj/xcshareddata/xcschemes/Taler.xcscheme | 98 | ||||
-rw-r--r-- | Taler.xcodeproj/xcuserdata/jonathanbuchanan.xcuserdatad/xcschemes/xcschememanagement.plist | 18 | ||||
-rw-r--r-- | Taler/AppDelegate.swift | 6 | ||||
-rw-r--r-- | Taler/NodeWrapper.swift | 49 | ||||
-rw-r--r-- | Taler/Taler-Bridging-Header.h | 4 | ||||
-rw-r--r-- | Taler/node_wrapper.cpp | 274 | ||||
-rw-r--r-- | Taler/node_wrapper.h | 44 | ||||
-rw-r--r-- | TalerTests/NodeWrapperTests.swift | 31 | ||||
m--------- | wallet-kotlin | 0 |
11 files changed, 831 insertions, 59 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4ad3cd8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +Taler.xcodeproj/xcuserdata diff --git a/Taler.xcodeproj/project.pbxproj b/Taler.xcodeproj/project.pbxproj index 0226586..71ac395 100644 --- a/Taler.xcodeproj/project.pbxproj +++ b/Taler.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + D110857525B134420047F1B6 /* NodeWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D110857425B134420047F1B6 /* NodeWrapper.swift */; }; + D110857A25B13DF90047F1B6 /* NodeWrapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D110857925B13DF90047F1B6 /* NodeWrapperTests.swift */; }; D14AFD2124D232B300C51073 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14AFD2024D232B300C51073 /* AppDelegate.swift */; }; D14AFD2324D232B300C51073 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14AFD2224D232B300C51073 /* SceneDelegate.swift */; }; D14AFD2524D232B300C51073 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14AFD2424D232B300C51073 /* ContentView.swift */; }; @@ -15,8 +17,27 @@ D14AFD2D24D232B500C51073 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D14AFD2B24D232B500C51073 /* LaunchScreen.storyboard */; }; D14AFD3824D232B500C51073 /* TalerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14AFD3724D232B500C51073 /* TalerTests.swift */; }; D14AFD4324D232B500C51073 /* TalerUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D14AFD4224D232B500C51073 /* TalerUITests.swift */; }; - D1CC111B24DA0AF300998692 /* TalerWallet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D13B019924D2B0F700ADBE8C /* TalerWallet.framework */; }; - D1CC111C24DA0AF300998692 /* TalerWallet.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D13B019924D2B0F700ADBE8C /* TalerWallet.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + D17D8B7225ADB29A001BD43D /* libbrotli.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B4F25ADB12D001BD43D /* libbrotli.a */; }; + D17D8B7325ADB29A001BD43D /* libzlib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B4725ADB12B001BD43D /* libzlib.a */; }; + D17D8B7425ADB29A001BD43D /* libv8_zlib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B5425ADB12D001BD43D /* libv8_zlib.a */; }; + D17D8B7525ADB29A001BD43D /* libv8_snapshot.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B5125ADB12D001BD43D /* libv8_snapshot.a */; }; + D17D8B7625ADB29A001BD43D /* libv8_libsampler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B4625ADB12B001BD43D /* libv8_libsampler.a */; }; + D17D8B7725ADB29A001BD43D /* libv8_libplatform.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B5025ADB12D001BD43D /* libv8_libplatform.a */; }; + D17D8B7825ADB29B001BD43D /* libv8_libbase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B4425ADB12B001BD43D /* libv8_libbase.a */; }; + D17D8B7925ADB29B001BD43D /* libv8_initializers.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B4C25ADB12C001BD43D /* libv8_initializers.a */; }; + D17D8B7A25ADB29B001BD43D /* libv8_init.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B5225ADB12D001BD43D /* libv8_init.a */; }; + D17D8B7B25ADB29B001BD43D /* libv8_compiler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B4A25ADB12C001BD43D /* libv8_compiler.a */; }; + D17D8B7C25ADB29B001BD43D /* libv8_base_without_compiler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B4925ADB12B001BD43D /* libv8_base_without_compiler.a */; }; + D17D8B7D25ADB29B001BD43D /* libuvwasi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B5525ADB12E001BD43D /* libuvwasi.a */; }; + D17D8B7E25ADB29B001BD43D /* libuv.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B4B25ADB12C001BD43D /* libuv.a */; }; + D17D8B7F25ADB29B001BD43D /* libtorque_base.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B5725ADB130001BD43D /* libtorque_base.a */; }; + D17D8B8025ADB29B001BD43D /* libopenssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B4E25ADB12D001BD43D /* libopenssl.a */; }; + D17D8B8125ADB29B001BD43D /* libnode.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B4525ADB12B001BD43D /* libnode.a */; }; + D17D8B8225ADB29B001BD43D /* libnghttp2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B5325ADB12D001BD43D /* libnghttp2.a */; }; + D17D8B8325ADB29B001BD43D /* libllhttp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B4D25ADB12C001BD43D /* libllhttp.a */; }; + D17D8B8425ADB29B001BD43D /* libhistogram.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B5625ADB130001BD43D /* libhistogram.a */; }; + D17D8B8525ADB29B001BD43D /* libcares.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D17D8B4825ADB12B001BD43D /* libcares.a */; }; + D1AB9647259EB24100DEAB23 /* node_wrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D1AB9646259EB24100DEAB23 /* node_wrapper.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -36,22 +57,51 @@ }; /* End PBXContainerItemProxy section */ -/* Begin PBXCopyFilesBuildPhase section */ - D1CC111D24DA0AF300998692 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - D1CC111C24DA0AF300998692 /* TalerWallet.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ - D13B019924D2B0F700ADBE8C /* TalerWallet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TalerWallet.framework; path = "wallet-kotlin/build/bin/iosX64/debugFramework/TalerWallet.framework"; sourceTree = "<group>"; }; + D110857425B134420047F1B6 /* NodeWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NodeWrapper.swift; sourceTree = "<group>"; }; + D110857925B13DF90047F1B6 /* NodeWrapperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NodeWrapperTests.swift; sourceTree = "<group>"; }; + D11DB44E25A5C487009CF0BC /* libnode.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libnode.a; path = "nodejs-mobile/out/Release/libnode.a"; sourceTree = "<group>"; }; + D11DB45625A5C5C7009CF0BC /* libv8_initializers.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_initializers.a; path = "nodejs-mobile/out/Release/libv8_initializers.a"; sourceTree = "<group>"; }; + D11DB45725A5C5C7009CF0BC /* libv8_compiler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_compiler.a; path = "nodejs-mobile/out/Release/libv8_compiler.a"; sourceTree = "<group>"; }; + D11DB45825A5C5C7009CF0BC /* libbrotli.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbrotli.a; path = "nodejs-mobile/out/Release/libbrotli.a"; sourceTree = "<group>"; }; + D11DB45925A5C5C7009CF0BC /* libcares.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcares.a; path = "nodejs-mobile/out/Release/libcares.a"; sourceTree = "<group>"; }; + D11DB45A25A5C5C7009CF0BC /* libv8_base_without_compiler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_base_without_compiler.a; path = "nodejs-mobile/out/Release/libv8_base_without_compiler.a"; sourceTree = "<group>"; }; + D11DB45B25A5C5C7009CF0BC /* libv8_libsampler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libsampler.a; path = "nodejs-mobile/out/Release/libv8_libsampler.a"; sourceTree = "<group>"; }; + D11DB45C25A5C5C7009CF0BC /* libopenssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopenssl.a; path = "nodejs-mobile/out/Release/libopenssl.a"; sourceTree = "<group>"; }; + D11DB45D25A5C5C7009CF0BC /* libllhttp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libllhttp.a; path = "nodejs-mobile/out/Release/libllhttp.a"; sourceTree = "<group>"; }; + D11DB45E25A5C5C7009CF0BC /* libuv.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuv.a; path = "nodejs-mobile/out/Release/libuv.a"; sourceTree = "<group>"; }; + D11DB45F25A5C5C8009CF0BC /* libv8_libbase.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libbase.a; path = "nodejs-mobile/out/Release/libv8_libbase.a"; sourceTree = "<group>"; }; + D11DB46025A5C5C8009CF0BC /* libtorque_base.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtorque_base.a; path = "nodejs-mobile/out/Release/libtorque_base.a"; sourceTree = "<group>"; }; + D11DB46125A5C5C8009CF0BC /* libuvwasi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuvwasi.a; path = "nodejs-mobile/out/Release/libuvwasi.a"; sourceTree = "<group>"; }; + D11DB46225A5C5C8009CF0BC /* libnghttp2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libnghttp2.a; path = "nodejs-mobile/out/Release/libnghttp2.a"; sourceTree = "<group>"; }; + D11DB46325A5C5C8009CF0BC /* libv8_init.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_init.a; path = "nodejs-mobile/out/Release/libv8_init.a"; sourceTree = "<group>"; }; + D11DB46425A5C5C8009CF0BC /* libv8_libplatform.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libplatform.a; path = "nodejs-mobile/out/Release/libv8_libplatform.a"; sourceTree = "<group>"; }; + D11DB46525A5C5C8009CF0BC /* libzlib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libzlib.a; path = "nodejs-mobile/out/Release/libzlib.a"; sourceTree = "<group>"; }; + D11DB46625A5C5C8009CF0BC /* libhttp_parser.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libhttp_parser.a; path = "nodejs-mobile/out/Release/libhttp_parser.a"; sourceTree = "<group>"; }; + D11DB46725A5C5C8009CF0BC /* libhistogram.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libhistogram.a; path = "nodejs-mobile/out/Release/libhistogram.a"; sourceTree = "<group>"; }; + D11DB46825A5C5C8009CF0BC /* libv8_snapshot.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_snapshot.a; path = "nodejs-mobile/out/Release/libv8_snapshot.a"; sourceTree = "<group>"; }; + D11DB46925A5C5C8009CF0BC /* Release */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Release; path = "nodejs-mobile/out/Release"; sourceTree = "<group>"; }; + D11DB48625A5C708009CF0BC /* libv8_nosnapshot.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_nosnapshot.a; path = "nodejs-mobile/out/Release/libv8_nosnapshot.a"; sourceTree = "<group>"; }; + D145D1DE25AC416400CDD61B /* libv8_libplatform.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libplatform.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libv8_libplatform.a"; sourceTree = "<group>"; }; + D145D1DF25AC416400CDD61B /* libv8_libsampler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libsampler.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libv8_libsampler.a"; sourceTree = "<group>"; }; + D145D1E025AC416500CDD61B /* libv8_zlib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_zlib.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libv8_zlib.a"; sourceTree = "<group>"; }; + D145D1E125AC416500CDD61B /* libnghttp2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libnghttp2.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libnghttp2.a"; sourceTree = "<group>"; }; + D145D1E225AC416500CDD61B /* libv8_init.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_init.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libv8_init.a"; sourceTree = "<group>"; }; + D145D1E325AC416500CDD61B /* libv8_compiler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_compiler.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libv8_compiler.a"; sourceTree = "<group>"; }; + D145D1E425AC416500CDD61B /* libuvwasi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuvwasi.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libuvwasi.a"; sourceTree = "<group>"; }; + D145D1E525AC416600CDD61B /* libnode.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libnode.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libnode.a"; sourceTree = "<group>"; }; + D145D1E625AC416600CDD61B /* libv8_initializers.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_initializers.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libv8_initializers.a"; sourceTree = "<group>"; }; + D145D1E725AC416600CDD61B /* libtorque_base.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtorque_base.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libtorque_base.a"; sourceTree = "<group>"; }; + D145D1E825AC416700CDD61B /* libzlib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libzlib.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libzlib.a"; sourceTree = "<group>"; }; + D145D1E925AC416700CDD61B /* libuv.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuv.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libuv.a"; sourceTree = "<group>"; }; + D145D1EA25AC416700CDD61B /* libv8_snapshot.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_snapshot.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libv8_snapshot.a"; sourceTree = "<group>"; }; + D145D1EB25AC416A00CDD61B /* libopenssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopenssl.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libopenssl.a"; sourceTree = "<group>"; }; + D145D1EC25AC416A00CDD61B /* libllhttp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libllhttp.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libllhttp.a"; sourceTree = "<group>"; }; + D145D1ED25AC416A00CDD61B /* libcares.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcares.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libcares.a"; sourceTree = "<group>"; }; + D145D1EE25AC416B00CDD61B /* libbrotli.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbrotli.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libbrotli.a"; sourceTree = "<group>"; }; + D145D1EF25AC416B00CDD61B /* libv8_base_without_compiler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_base_without_compiler.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libv8_base_without_compiler.a"; sourceTree = "<group>"; }; + D145D1F025AC416B00CDD61B /* libhistogram.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libhistogram.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libhistogram.a"; sourceTree = "<group>"; }; + D145D1F125AC416B00CDD61B /* libv8_libbase.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libbase.a; path = "ios-node-v8/taler-ios-build/compiled/node-x64/libv8_libbase.a"; sourceTree = "<group>"; }; D14AFD1D24D232B300C51073 /* Taler.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Taler.app; sourceTree = BUILT_PRODUCTS_DIR; }; D14AFD2024D232B300C51073 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; D14AFD2224D232B300C51073 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; }; @@ -66,7 +116,73 @@ D14AFD3E24D232B500C51073 /* TalerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TalerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; D14AFD4224D232B500C51073 /* TalerUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TalerUITests.swift; sourceTree = "<group>"; }; D14AFD4424D232B500C51073 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; - D1CC111724DA093200998692 /* TalerWallet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TalerWallet.framework; path = "wallet-kotlin/build/bin/iosX64/releaseFramework/TalerWallet.framework"; sourceTree = "<group>"; }; + D1595BBD25A550750049971F /* libnode.89.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libnode.89.dylib; path = "ios-node-v8/out/Debug/libnode.89.dylib"; sourceTree = "<group>"; }; + D1595BC625A5527C0049971F /* NodeMobile.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NodeMobile.framework; path = "nodejs-mobile-v0.3.2-ios/Release-universal/NodeMobile.framework"; sourceTree = "<group>"; }; + D17D8B4425ADB12B001BD43D /* libv8_libbase.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libbase.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libv8_libbase.a"; sourceTree = "<group>"; }; + D17D8B4525ADB12B001BD43D /* libnode.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libnode.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libnode.a"; sourceTree = "<group>"; }; + D17D8B4625ADB12B001BD43D /* libv8_libsampler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libsampler.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libv8_libsampler.a"; sourceTree = "<group>"; }; + D17D8B4725ADB12B001BD43D /* libzlib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libzlib.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libzlib.a"; sourceTree = "<group>"; }; + D17D8B4825ADB12B001BD43D /* libcares.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcares.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libcares.a"; sourceTree = "<group>"; }; + D17D8B4925ADB12B001BD43D /* libv8_base_without_compiler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_base_without_compiler.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libv8_base_without_compiler.a"; sourceTree = "<group>"; }; + D17D8B4A25ADB12C001BD43D /* libv8_compiler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_compiler.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libv8_compiler.a"; sourceTree = "<group>"; }; + D17D8B4B25ADB12C001BD43D /* libuv.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuv.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libuv.a"; sourceTree = "<group>"; }; + D17D8B4C25ADB12C001BD43D /* libv8_initializers.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_initializers.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libv8_initializers.a"; sourceTree = "<group>"; }; + D17D8B4D25ADB12C001BD43D /* libllhttp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libllhttp.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libllhttp.a"; sourceTree = "<group>"; }; + D17D8B4E25ADB12D001BD43D /* libopenssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopenssl.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libopenssl.a"; sourceTree = "<group>"; }; + D17D8B4F25ADB12D001BD43D /* libbrotli.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbrotli.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libbrotli.a"; sourceTree = "<group>"; }; + D17D8B5025ADB12D001BD43D /* libv8_libplatform.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libplatform.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libv8_libplatform.a"; sourceTree = "<group>"; }; + D17D8B5125ADB12D001BD43D /* libv8_snapshot.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_snapshot.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libv8_snapshot.a"; sourceTree = "<group>"; }; + D17D8B5225ADB12D001BD43D /* libv8_init.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_init.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libv8_init.a"; sourceTree = "<group>"; }; + D17D8B5325ADB12D001BD43D /* libnghttp2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libnghttp2.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libnghttp2.a"; sourceTree = "<group>"; }; + D17D8B5425ADB12D001BD43D /* libv8_zlib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_zlib.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libv8_zlib.a"; sourceTree = "<group>"; }; + D17D8B5525ADB12E001BD43D /* libuvwasi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuvwasi.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libuvwasi.a"; sourceTree = "<group>"; }; + D17D8B5625ADB130001BD43D /* libhistogram.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libhistogram.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libhistogram.a"; sourceTree = "<group>"; }; + D17D8B5725ADB130001BD43D /* libtorque_base.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtorque_base.a; path = "ios-node-v8/taler-ios-build/compiled/node-arm64/libtorque_base.a"; sourceTree = "<group>"; }; + D1AB963B259EB13D00DEAB23 /* libnode.89.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libnode.89.dylib; path = "ios-node-v8/taler-ios-build/compiled/x64-v8a/libnode.89.dylib"; sourceTree = "<group>"; }; + D1AB9644259EB22900DEAB23 /* node_wrapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = node_wrapper.h; sourceTree = "<group>"; }; + D1AB9645259EB24000DEAB23 /* Taler-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Taler-Bridging-Header.h"; sourceTree = "<group>"; }; + D1AB9646259EB24100DEAB23 /* node_wrapper.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = node_wrapper.cpp; sourceTree = "<group>"; }; + D1F0C22F25A958AE00C3179D /* libllhttp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libllhttp.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libllhttp.a"; sourceTree = "<group>"; }; + D1F0C23025A958AE00C3179D /* libv8_initializers.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_initializers.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libv8_initializers.a"; sourceTree = "<group>"; }; + D1F0C23125A958AE00C3179D /* libuv.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuv.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libuv.a"; sourceTree = "<group>"; }; + D1F0C23225A958AE00C3179D /* libnode.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libnode.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libnode.a"; sourceTree = "<group>"; }; + D1F0C23325A958AE00C3179D /* libhistogram.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libhistogram.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libhistogram.a"; sourceTree = "<group>"; }; + D1F0C23425A958AE00C3179D /* libzlib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libzlib.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libzlib.a"; sourceTree = "<group>"; }; + D1F0C23525A958AE00C3179D /* libnghttp2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libnghttp2.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libnghttp2.a"; sourceTree = "<group>"; }; + D1F0C23625A958AE00C3179D /* libv8_snapshot.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_snapshot.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libv8_snapshot.a"; sourceTree = "<group>"; }; + D1F0C23725A958AE00C3179D /* libuvwasi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuvwasi.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libuvwasi.a"; sourceTree = "<group>"; }; + D1F0C23825A958AE00C3179D /* libv8_compiler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_compiler.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libv8_compiler.a"; sourceTree = "<group>"; }; + D1F0C23925A958AE00C3179D /* libv8_base_without_compiler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_base_without_compiler.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libv8_base_without_compiler.a"; sourceTree = "<group>"; }; + D1F0C23A25A958AE00C3179D /* libopenssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopenssl.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libopenssl.a"; sourceTree = "<group>"; }; + D1F0C23B25A958AF00C3179D /* libv8_libbase.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libbase.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libv8_libbase.a"; sourceTree = "<group>"; }; + D1F0C23C25A958AF00C3179D /* libcares.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcares.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libcares.a"; sourceTree = "<group>"; }; + D1F0C23D25A958AF00C3179D /* libbrotli.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbrotli.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libbrotli.a"; sourceTree = "<group>"; }; + D1F0C23E25A958AF00C3179D /* libv8_libplatform.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libplatform.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libv8_libplatform.a"; sourceTree = "<group>"; }; + D1F0C23F25A958AF00C3179D /* libv8_libsampler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libsampler.a; path = "ios-node-v8/tools/ios-framework/bin/x64/libv8_libsampler.a"; sourceTree = "<group>"; }; + D1F0C25425A9597500C3179D /* libv8_libbase.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libbase.a; path = "ios-node-v8/out/Release/libv8_libbase.a"; sourceTree = "<group>"; }; + D1F0C25525A9597500C3179D /* libopenssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopenssl.a; path = "ios-node-v8/out/Release/libopenssl.a"; sourceTree = "<group>"; }; + D1F0C25625A9597500C3179D /* libcares.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcares.a; path = "ios-node-v8/out/Release/libcares.a"; sourceTree = "<group>"; }; + D1F0C25725A9597500C3179D /* libv8_libsampler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libsampler.a; path = "ios-node-v8/out/Release/libv8_libsampler.a"; sourceTree = "<group>"; }; + D1F0C25825A9597500C3179D /* libv8_base_without_compiler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_base_without_compiler.a; path = "ios-node-v8/out/Release/libv8_base_without_compiler.a"; sourceTree = "<group>"; }; + D1F0C25925A9597500C3179D /* libv8_initializers.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_initializers.a; path = "ios-node-v8/out/Release/libv8_initializers.a"; sourceTree = "<group>"; }; + D1F0C25A25A9597500C3179D /* libv8_snapshot.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_snapshot.a; path = "ios-node-v8/out/Release/libv8_snapshot.a"; sourceTree = "<group>"; }; + D1F0C25B25A9597500C3179D /* libv8_zlib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_zlib.a; path = "ios-node-v8/out/Release/libv8_zlib.a"; sourceTree = "<group>"; }; + D1F0C25C25A9597500C3179D /* out */ = {isa = PBXFileReference; lastKnownFileType = folder; name = out; path = "ios-node-v8/out"; sourceTree = "<group>"; }; + D1F0C25D25A9597500C3179D /* libhistogram.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libhistogram.a; path = "ios-node-v8/out/Release/libhistogram.a"; sourceTree = "<group>"; }; + D1F0C25E25A9597500C3179D /* libllhttp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libllhttp.a; path = "ios-node-v8/out/Release/libllhttp.a"; sourceTree = "<group>"; }; + D1F0C25F25A9597600C3179D /* libv8_libplatform.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libplatform.a; path = "ios-node-v8/out/Release/libv8_libplatform.a"; sourceTree = "<group>"; }; + D1F0C26025A9597600C3179D /* libv8_compiler.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_compiler.a; path = "ios-node-v8/out/Release/libv8_compiler.a"; sourceTree = "<group>"; }; + D1F0C26125A9597600C3179D /* libv8_init.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_init.a; path = "ios-node-v8/out/Release/libv8_init.a"; sourceTree = "<group>"; }; + D1F0C26225A9597600C3179D /* libzlib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libzlib.a; path = "ios-node-v8/out/Release/libzlib.a"; sourceTree = "<group>"; }; + D1F0C26325A9597600C3179D /* libuvwasi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuvwasi.a; path = "ios-node-v8/out/Release/libuvwasi.a"; sourceTree = "<group>"; }; + D1F0C26425A9597600C3179D /* libnode.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libnode.a; path = "ios-node-v8/out/Release/libnode.a"; sourceTree = "<group>"; }; + D1F0C26525A9597700C3179D /* libuv.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libuv.a; path = "ios-node-v8/out/Release/libuv.a"; sourceTree = "<group>"; }; + D1F0C26625A9597700C3179D /* libbrotli.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbrotli.a; path = "ios-node-v8/out/Release/libbrotli.a"; sourceTree = "<group>"; }; + D1F0C26725A9597700C3179D /* libnghttp2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libnghttp2.a; path = "ios-node-v8/out/Release/libnghttp2.a"; sourceTree = "<group>"; }; + D1F0C26825A9597800C3179D /* libtorque_base.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtorque_base.a; path = "ios-node-v8/out/Release/libtorque_base.a"; sourceTree = "<group>"; }; + D1FD32E725A5CEE500A2CF3C /* libv8_monolith.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_monolith.a; path = "ios-node-v8/taler-ios-build/compiled/x64-v8a/libv8_monolith.a"; sourceTree = "<group>"; }; + D1FD32E825A5CEE500A2CF3C /* libv8_libplatform.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libplatform.a; path = "ios-node-v8/taler-ios-build/compiled/x64-v8a/libv8_libplatform.a"; sourceTree = "<group>"; }; + D1FD32E925A5CEE500A2CF3C /* libv8_libbase.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_libbase.a; path = "ios-node-v8/taler-ios-build/compiled/x64-v8a/libv8_libbase.a"; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -74,7 +190,26 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D1CC111B24DA0AF300998692 /* TalerWallet.framework in Frameworks */, + D17D8B8025ADB29B001BD43D /* libopenssl.a in Frameworks */, + D17D8B7E25ADB29B001BD43D /* libuv.a in Frameworks */, + D17D8B7D25ADB29B001BD43D /* libuvwasi.a in Frameworks */, + D17D8B7325ADB29A001BD43D /* libzlib.a in Frameworks */, + D17D8B8225ADB29B001BD43D /* libnghttp2.a in Frameworks */, + D17D8B7425ADB29A001BD43D /* libv8_zlib.a in Frameworks */, + D17D8B8525ADB29B001BD43D /* libcares.a in Frameworks */, + D17D8B8125ADB29B001BD43D /* libnode.a in Frameworks */, + D17D8B8325ADB29B001BD43D /* libllhttp.a in Frameworks */, + D17D8B7B25ADB29B001BD43D /* libv8_compiler.a in Frameworks */, + D17D8B7225ADB29A001BD43D /* libbrotli.a in Frameworks */, + D17D8B7625ADB29A001BD43D /* libv8_libsampler.a in Frameworks */, + D17D8B7825ADB29B001BD43D /* libv8_libbase.a in Frameworks */, + D17D8B7C25ADB29B001BD43D /* libv8_base_without_compiler.a in Frameworks */, + D17D8B7725ADB29A001BD43D /* libv8_libplatform.a in Frameworks */, + D17D8B7925ADB29B001BD43D /* libv8_initializers.a in Frameworks */, + D17D8B7A25ADB29B001BD43D /* libv8_init.a in Frameworks */, + D17D8B7F25ADB29B001BD43D /* libtorque_base.a in Frameworks */, + D17D8B8425ADB29B001BD43D /* libhistogram.a in Frameworks */, + D17D8B7525ADB29A001BD43D /* libv8_snapshot.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -126,6 +261,10 @@ D14AFD2B24D232B500C51073 /* LaunchScreen.storyboard */, D14AFD2E24D232B500C51073 /* Info.plist */, D14AFD2824D232B500C51073 /* Preview Content */, + D1AB9644259EB22900DEAB23 /* node_wrapper.h */, + D1AB9646259EB24100DEAB23 /* node_wrapper.cpp */, + D1AB9645259EB24000DEAB23 /* Taler-Bridging-Header.h */, + D110857425B134420047F1B6 /* NodeWrapper.swift */, ); path = Taler; sourceTree = "<group>"; @@ -143,6 +282,7 @@ children = ( D14AFD3724D232B500C51073 /* TalerTests.swift */, D14AFD3924D232B500C51073 /* Info.plist */, + D110857925B13DF90047F1B6 /* NodeWrapperTests.swift */, ); path = TalerTests; sourceTree = "<group>"; @@ -159,8 +299,112 @@ D1EFA41824D2619B0008B97F /* Frameworks */ = { isa = PBXGroup; children = ( - D1CC111724DA093200998692 /* TalerWallet.framework */, - D13B019924D2B0F700ADBE8C /* TalerWallet.framework */, + D1F0C26625A9597700C3179D /* libbrotli.a */, + D145D1EE25AC416B00CDD61B /* libbrotli.a */, + D17D8B4F25ADB12D001BD43D /* libbrotli.a */, + D1F0C25625A9597500C3179D /* libcares.a */, + D1F0C25D25A9597500C3179D /* libhistogram.a */, + D145D1ED25AC416A00CDD61B /* libcares.a */, + D145D1F025AC416B00CDD61B /* libhistogram.a */, + D17D8B5625ADB130001BD43D /* libhistogram.a */, + D1F0C25E25A9597500C3179D /* libllhttp.a */, + D145D1EC25AC416A00CDD61B /* libllhttp.a */, + D1F0C26725A9597700C3179D /* libnghttp2.a */, + D17D8B4825ADB12B001BD43D /* libcares.a */, + D17D8B4D25ADB12C001BD43D /* libllhttp.a */, + D17D8B5325ADB12D001BD43D /* libnghttp2.a */, + D1F0C26425A9597600C3179D /* libnode.a */, + D1F0C25525A9597500C3179D /* libopenssl.a */, + D145D1EB25AC416A00CDD61B /* libopenssl.a */, + D1F0C26825A9597800C3179D /* libtorque_base.a */, + D17D8B4E25ADB12D001BD43D /* libopenssl.a */, + D17D8B5725ADB130001BD43D /* libtorque_base.a */, + D1F0C26525A9597700C3179D /* libuv.a */, + D145D1E525AC416600CDD61B /* libnode.a */, + D145D1E725AC416600CDD61B /* libtorque_base.a */, + D145D1E925AC416700CDD61B /* libuv.a */, + D1F0C26325A9597600C3179D /* libuvwasi.a */, + D17D8B4B25ADB12C001BD43D /* libuv.a */, + D17D8B5525ADB12E001BD43D /* libuvwasi.a */, + D1F0C25825A9597500C3179D /* libv8_base_without_compiler.a */, + D145D1E425AC416500CDD61B /* libuvwasi.a */, + D145D1EF25AC416B00CDD61B /* libv8_base_without_compiler.a */, + D1F0C26025A9597600C3179D /* libv8_compiler.a */, + D145D1E325AC416500CDD61B /* libv8_compiler.a */, + D1F0C26125A9597600C3179D /* libv8_init.a */, + D17D8B5225ADB12D001BD43D /* libv8_init.a */, + D1F0C25925A9597500C3179D /* libv8_initializers.a */, + D17D8B4525ADB12B001BD43D /* libnode.a */, + D17D8B4925ADB12B001BD43D /* libv8_base_without_compiler.a */, + D17D8B4A25ADB12C001BD43D /* libv8_compiler.a */, + D17D8B4C25ADB12C001BD43D /* libv8_initializers.a */, + D1FD32E925A5CEE500A2CF3C /* libv8_libbase.a */, + D145D1E125AC416500CDD61B /* libnghttp2.a */, + D145D1E225AC416500CDD61B /* libv8_init.a */, + D145D1E625AC416600CDD61B /* libv8_initializers.a */, + D145D1F125AC416B00CDD61B /* libv8_libbase.a */, + D1FD32E825A5CEE500A2CF3C /* libv8_libplatform.a */, + D1F0C23D25A958AF00C3179D /* libbrotli.a */, + D1F0C23C25A958AF00C3179D /* libcares.a */, + D1F0C23325A958AE00C3179D /* libhistogram.a */, + D1F0C22F25A958AE00C3179D /* libllhttp.a */, + D1F0C23525A958AE00C3179D /* libnghttp2.a */, + D1F0C23225A958AE00C3179D /* libnode.a */, + D1F0C23A25A958AE00C3179D /* libopenssl.a */, + D1F0C23125A958AE00C3179D /* libuv.a */, + D1F0C23725A958AE00C3179D /* libuvwasi.a */, + D1F0C23925A958AE00C3179D /* libv8_base_without_compiler.a */, + D1F0C23825A958AE00C3179D /* libv8_compiler.a */, + D1F0C23025A958AE00C3179D /* libv8_initializers.a */, + D1F0C23B25A958AF00C3179D /* libv8_libbase.a */, + D1F0C23E25A958AF00C3179D /* libv8_libplatform.a */, + D1F0C25F25A9597600C3179D /* libv8_libplatform.a */, + D17D8B5025ADB12D001BD43D /* libv8_libplatform.a */, + D1F0C23F25A958AF00C3179D /* libv8_libsampler.a */, + D1F0C23625A958AE00C3179D /* libv8_snapshot.a */, + D17D8B5125ADB12D001BD43D /* libv8_snapshot.a */, + D17D8B5425ADB12D001BD43D /* libv8_zlib.a */, + D1F0C23425A958AE00C3179D /* libzlib.a */, + D1F0C25425A9597500C3179D /* libv8_libbase.a */, + D1F0C25725A9597500C3179D /* libv8_libsampler.a */, + D1F0C25A25A9597500C3179D /* libv8_snapshot.a */, + D145D1EA25AC416700CDD61B /* libv8_snapshot.a */, + D1F0C25B25A9597500C3179D /* libv8_zlib.a */, + D1F0C26225A9597600C3179D /* libzlib.a */, + D145D1DE25AC416400CDD61B /* libv8_libplatform.a */, + D145D1DF25AC416400CDD61B /* libv8_libsampler.a */, + D145D1E025AC416500CDD61B /* libv8_zlib.a */, + D145D1E825AC416700CDD61B /* libzlib.a */, + D17D8B4425ADB12B001BD43D /* libv8_libbase.a */, + D17D8B4625ADB12B001BD43D /* libv8_libsampler.a */, + D17D8B4725ADB12B001BD43D /* libzlib.a */, + D1F0C25C25A9597500C3179D /* out */, + D1FD32E725A5CEE500A2CF3C /* libv8_monolith.a */, + D11DB48625A5C708009CF0BC /* libv8_nosnapshot.a */, + D11DB45825A5C5C7009CF0BC /* libbrotli.a */, + D11DB45925A5C5C7009CF0BC /* libcares.a */, + D11DB46725A5C5C8009CF0BC /* libhistogram.a */, + D11DB46625A5C5C8009CF0BC /* libhttp_parser.a */, + D11DB45D25A5C5C7009CF0BC /* libllhttp.a */, + D11DB46225A5C5C8009CF0BC /* libnghttp2.a */, + D11DB45C25A5C5C7009CF0BC /* libopenssl.a */, + D11DB46025A5C5C8009CF0BC /* libtorque_base.a */, + D11DB45E25A5C5C7009CF0BC /* libuv.a */, + D11DB46125A5C5C8009CF0BC /* libuvwasi.a */, + D11DB45A25A5C5C7009CF0BC /* libv8_base_without_compiler.a */, + D11DB45725A5C5C7009CF0BC /* libv8_compiler.a */, + D11DB46325A5C5C8009CF0BC /* libv8_init.a */, + D11DB45625A5C5C7009CF0BC /* libv8_initializers.a */, + D11DB45F25A5C5C8009CF0BC /* libv8_libbase.a */, + D11DB46425A5C5C8009CF0BC /* libv8_libplatform.a */, + D11DB45B25A5C5C7009CF0BC /* libv8_libsampler.a */, + D11DB46825A5C5C8009CF0BC /* libv8_snapshot.a */, + D11DB46525A5C5C8009CF0BC /* libzlib.a */, + D11DB46925A5C5C8009CF0BC /* Release */, + D11DB44E25A5C487009CF0BC /* libnode.a */, + D1595BC625A5527C0049971F /* NodeMobile.framework */, + D1595BBD25A550750049971F /* libnode.89.dylib */, + D1AB963B259EB13D00DEAB23 /* libnode.89.dylib */, ); name = Frameworks; sourceTree = "<group>"; @@ -172,11 +416,9 @@ isa = PBXNativeTarget; buildConfigurationList = D14AFD4724D232B500C51073 /* Build configuration list for PBXNativeTarget "Taler" */; buildPhases = ( - D10ADA7824DD231700D8863C /* ShellScript */, D14AFD1924D232B300C51073 /* Sources */, D14AFD1A24D232B300C51073 /* Frameworks */, D14AFD1B24D232B300C51073 /* Resources */, - D1CC111D24DA0AF300998692 /* Embed Frameworks */, ); buildRules = ( ); @@ -230,11 +472,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1160; - LastUpgradeCheck = 1160; + LastUpgradeCheck = 1230; ORGANIZATIONNAME = Taler; TargetAttributes = { D14AFD1C24D232B300C51073 = { CreatedOnToolsVersion = 11.6; + LastSwiftMigration = 1230; }; D14AFD3224D232B500C51073 = { CreatedOnToolsVersion = 11.6; @@ -293,26 +536,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - D10ADA7824DD231700D8863C /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "cd \"$SRCROOT/wallet-kotlin\"\n./gradlew publishIosX64PublicationToMavenLocal\n"; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ D14AFD1924D232B300C51073 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -321,6 +544,8 @@ D14AFD2124D232B300C51073 /* AppDelegate.swift in Sources */, D14AFD2324D232B300C51073 /* SceneDelegate.swift in Sources */, D14AFD2524D232B300C51073 /* ContentView.swift in Sources */, + D1AB9647259EB24100DEAB23 /* node_wrapper.cpp in Sources */, + D110857525B134420047F1B6 /* NodeWrapper.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -329,6 +554,7 @@ buildActionMask = 2147483647; files = ( D14AFD3824D232B500C51073 /* TalerTests.swift in Sources */, + D110857A25B13DF90047F1B6 /* NodeWrapperTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -393,6 +619,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -453,6 +680,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -485,25 +713,38 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = "\"Taler/Preview Content\""; + DEVELOPMENT_TEAM = AY2R7MK22Y; ENABLE_PREVIEWS = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/wallet-kotlin/build/bin/iosX64/debugFramework", - "$(PROJECT_DIR)/wallet-kotlin/build/bin/iosArm64/debugFramework", - "$(PROJECT_DIR)/wallet-kotlin/build/bin/iosX64/releaseFramework", + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(PROJECT_DIR)/ios-node-v8/src", + "$(PROJECT_DIR)/ios-node-v8/deps/v8/include", + "$(PROJECT_DIR)/ios-node-v8/deps/uv/include", ); INFOPLIST_FILE = Taler/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - LIBRARY_SEARCH_PATHS = "$(inherited)"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + "LIBRARY_SEARCH_PATHS[sdk=iphoneos*]" = "$(PROJECT_DIR)/ios-node-v8/taler-ios-build/compiled/node-arm64"; + "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*]" = "$(PROJECT_DIR)/ios-node-v8/taler-ios-build/compiled/node-x64"; + OTHER_CFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = com.taler.Taler; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "Taler/Taler-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_WORKSPACE = YES; }; name = Debug; }; @@ -511,25 +752,37 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = "\"Taler/Preview Content\""; + DEVELOPMENT_TEAM = AY2R7MK22Y; ENABLE_PREVIEWS = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/wallet-kotlin/build/bin/iosX64/debugFramework", - "$(PROJECT_DIR)/wallet-kotlin/build/bin/iosArm64/debugFramework", - "$(PROJECT_DIR)/wallet-kotlin/build/bin/iosX64/releaseFramework", + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(PROJECT_DIR)/ios-node-v8/src", + "$(PROJECT_DIR)/ios-node-v8/deps/v8/include", + "$(PROJECT_DIR)/ios-node-v8/deps/uv/include", ); INFOPLIST_FILE = Taler/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - LIBRARY_SEARCH_PATHS = "$(inherited)"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + "LIBRARY_SEARCH_PATHS[sdk=iphoneos*]" = "$(PROJECT_DIR)/ios-node-v8/taler-ios-build/compiled/node-arm64"; + "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*]" = "$(PROJECT_DIR)/ios-node-v8/taler-ios-build/compiled/node-x64"; + OTHER_CFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = com.taler.Taler; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "Taler/Taler-Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_WORKSPACE = YES; }; name = Release; }; diff --git a/Taler.xcodeproj/xcshareddata/xcschemes/Taler.xcscheme b/Taler.xcodeproj/xcshareddata/xcschemes/Taler.xcscheme new file mode 100644 index 0000000..2a82732 --- /dev/null +++ b/Taler.xcodeproj/xcshareddata/xcschemes/Taler.xcscheme @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "1230" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "D14AFD1C24D232B300C51073" + BuildableName = "Taler.app" + BlueprintName = "Taler" + ReferencedContainer = "container:Taler.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES"> + <Testables> + <TestableReference + skipped = "NO"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "D14AFD3224D232B500C51073" + BuildableName = "TalerTests.xctest" + BlueprintName = "TalerTests" + ReferencedContainer = "container:Taler.xcodeproj"> + </BuildableReference> + </TestableReference> + <TestableReference + skipped = "NO"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "D14AFD3D24D232B500C51073" + BuildableName = "TalerUITests.xctest" + BlueprintName = "TalerUITests" + ReferencedContainer = "container:Taler.xcodeproj"> + </BuildableReference> + </TestableReference> + </Testables> + </TestAction> + <LaunchAction + buildConfiguration = "Debug" + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + debugServiceExtension = "internal" + allowLocationSimulation = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "D14AFD1C24D232B300C51073" + BuildableName = "Taler.app" + BlueprintName = "Taler" + ReferencedContainer = "container:Taler.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + </LaunchAction> + <ProfileAction + buildConfiguration = "Release" + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + debugDocumentVersioning = "YES"> + <BuildableProductRunnable + runnableDebuggingMode = "0"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "D14AFD1C24D232B300C51073" + BuildableName = "Taler.app" + BlueprintName = "Taler" + ReferencedContainer = "container:Taler.xcodeproj"> + </BuildableReference> + </BuildableProductRunnable> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/Taler.xcodeproj/xcuserdata/jonathanbuchanan.xcuserdatad/xcschemes/xcschememanagement.plist b/Taler.xcodeproj/xcuserdata/jonathanbuchanan.xcuserdatad/xcschemes/xcschememanagement.plist index 589f619..d363989 100644 --- a/Taler.xcodeproj/xcuserdata/jonathanbuchanan.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Taler.xcodeproj/xcuserdata/jonathanbuchanan.xcuserdatad/xcschemes/xcschememanagement.plist @@ -10,5 +10,23 @@ <integer>0</integer> </dict> </dict> + <key>SuppressBuildableAutocreation</key> + <dict> + <key>D14AFD1C24D232B300C51073</key> + <dict> + <key>primary</key> + <true/> + </dict> + <key>D14AFD3224D232B500C51073</key> + <dict> + <key>primary</key> + <true/> + </dict> + <key>D14AFD3D24D232B500C51073</key> + <dict> + <key>primary</key> + <true/> + </dict> + </dict> </dict> </plist> diff --git a/Taler/AppDelegate.swift b/Taler/AppDelegate.swift index ab96d31..e5e6bcd 100644 --- a/Taler/AppDelegate.swift +++ b/Taler/AppDelegate.swift @@ -7,7 +7,6 @@ // import UIKit -import TalerWallet @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { @@ -16,8 +15,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. - let num = Amount.init(currency: "EUR", value: 1, fraction: 99) - print(num) + var iono = Iono(); + print(iono.evalJS(source: "1 + 1")) + iono.evalJS(source: "console.log(\"test!\");"); return true } diff --git a/Taler/NodeWrapper.swift b/Taler/NodeWrapper.swift new file mode 100644 index 0000000..60ca92b --- /dev/null +++ b/Taler/NodeWrapper.swift @@ -0,0 +1,49 @@ +// +// NodeWrapper.swift +// Taler +// +// Created by Jonathan Buchanan on 1/14/21. +// Copyright © 2021 Taler. All rights reserved. +// + +import Foundation + +class Iono { + var __instance: OpaquePointer + var messageHandler: ((String) -> ())? + + init() { + __instance = __new_instance() + } + + deinit { + __free_instance(__instance) + } + + func notifyNative() { + + } + + func evalJS(source: String) -> String { + var result_cstr: UnsafeMutablePointer<Int8> = __eval_js(source.cString(using: .utf8), __instance) + var result = String(cString: result_cstr) + free(result_cstr) + return result + } + + func evalNodeCode(source: String) { + __make_callback(source.cString(using: .utf8), __instance) + } + + func sendMessage(message: String) { + + } + + func waitUntilStopped() { + + } + + func putModuleCode(moduleName: String, code: String) { + __put_module_code(moduleName.cString(using: .utf8), code.cString(using: .utf8), __instance) + } +} diff --git a/Taler/Taler-Bridging-Header.h b/Taler/Taler-Bridging-Header.h new file mode 100644 index 0000000..f4a0414 --- /dev/null +++ b/Taler/Taler-Bridging-Header.h @@ -0,0 +1,4 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// +#import "node_wrapper.h" diff --git a/Taler/node_wrapper.cpp b/Taler/node_wrapper.cpp new file mode 100644 index 0000000..7899281 --- /dev/null +++ b/Taler/node_wrapper.cpp @@ -0,0 +1,274 @@ +// +// node_wrapper.cpp +// Taler +// +// Created by Jonathan Buchanan on 12/31/20. +// Copyright © 2020 Taler. All rights reserved. +// + +#include <map> +#include <string> + +#include "node.h" +#include "uv.h" + +struct __IonoInstance +{ + static std::unique_ptr<node::MultiIsolatePlatform> platform; + std::unique_ptr<node::CommonEnvironmentSetup> setup; + v8::Isolate *isolate; + node::Environment *env; + uv_async_t async_notify; + bool break_requested; + std::map<std::string, std::string> modmap; + + __IonoInstance(); + + char * + eval_js(const char *js); + + void + run_node(); + + void + make_callback(const char *callback); +}; + +#ifdef __cplusplus +extern "C" { +#endif + +struct __IonoInstance * +__new_instance() +{ + __IonoInstance *instance = new __IonoInstance(); + return instance; +} + +void +__free_instance(struct __IonoInstance *instance) +{ + delete instance; +} + +char * +__eval_js(const char *js, struct __IonoInstance *instance) +{ + return instance->eval_js(js); +} + +void +__notify_instance(struct __IonoInstance *instance) +{ + uv_async_send(&instance->async_notify); +} + +void +__run_node(struct __IonoInstance *instance) +{ + instance->run_node(); +} + +void +__make_callback(const char *callback, struct __IonoInstance *instance) +{ + instance->make_callback(callback); +} + +void +__put_module_code(const char *module_name, const char *module_code, struct __IonoInstance *instance) +{ + instance->modmap[std::string(module_name)] = std::string(module_code); +} + +#ifdef __cplusplus +} +#endif + +std::unique_ptr<node::MultiIsolatePlatform> __IonoInstance::platform = nullptr; + +static void +notify_callback(uv_async_t *async); + +static void +send_message_callback(const v8::FunctionCallbackInfo<v8::Value> &args); + +__IonoInstance::__IonoInstance() : + break_requested(false), + modmap() +{ + { + uv_loop_t *loop = uv_default_loop(); + uv_async_init(loop, &async_notify, ¬ify_callback); + async_notify.data = this; + } + + std::vector<std::string> args = { "node" }; + std::vector<std::string> exec_args; + std::vector<std::string> errors; + + if (nullptr == platform) + { + int exit_code = node::InitializeNodeWithArgs(&args, &exec_args, &errors); + for (const std::string &error : errors) + { + fprintf(stderr, "%s: %s\n", args[0].c_str(), error.c_str()); + /*if (exit_code != 0) { + return exit_code;*/ + } + + platform = node::MultiIsolatePlatform::Create(4); + v8::V8::InitializePlatform(platform.get()); + v8::V8::Initialize(); + } + + setup = node::CommonEnvironmentSetup::Create(platform.get(), &errors, args, exec_args); + if (!setup) { + for (const std::string &err : errors) + fprintf(stderr, "%s: %s\n", args[0].c_str(), err.c_str()); + //return 1; + } + + isolate = setup->isolate(); + env = setup->env(); + + { + v8::Locker locker(isolate); + v8::Isolate::Scope isolate_scope(isolate); + v8::HandleScope handle_scope(isolate); + v8::Context::Scope context_scope(setup->context()); + + v8::MaybeLocal<v8::Value> loadenv_ret = node::LoadEnvironment( + env, + "const publicRequire =" + " require('module').createRequire(process.cwd() + '/');" + "globalThis.require = publicRequire;" + "global.__node_run = (x) => {" + " 0 && console.log('running code', x);" + " global.eval(x);" + "};"); + + v8::Local<v8::ObjectTemplate> data_template = v8::ObjectTemplate::New(isolate); + data_template->SetInternalFieldCount(1); + v8::Local<v8::Object> data_object = data_template->NewInstance(setup->context()).ToLocalChecked(); + data_object->SetAlignedPointerInInternalField(0, this); + + v8::Local<v8::Function> sendMessageFunction = v8::Function::New(setup->context(), + send_message_callback, + data_object).ToLocalChecked(); + + v8::Local<v8::Object> global = setup->context()->Global(); + + global->Set(setup->context(), v8::String::NewFromUtf8(isolate, "__iono_sendMessage", + v8::NewStringType::kNormal).ToLocalChecked(), + sendMessageFunction).Check(); + } +} + +char * +__IonoInstance::eval_js(const char *js) +{ + v8::Locker locker(isolate); + v8::Isolate::Scope isolate_scope(isolate); + v8::HandleScope handle_scope(isolate); + v8::Context::Scope context_scope(setup->context()); + + { + // Create a string containing the JavaScript source code. + v8::Local<v8::String> source = + v8::String::NewFromUtf8(isolate, js, v8::NewStringType::kNormal).ToLocalChecked(); + + // Compile the source code. + v8::Local<v8::Script> script; + + if (!v8::Script::Compile(setup->context(), source).ToLocal(&script)) { + return nullptr; + } + + // Run the script to get the result. + v8::Local<v8::Value> result; + if (!script->Run(setup->context()).ToLocal(&result)) { + return nullptr; + } + + // Convert the result to an UTF8 string and print it. + v8::String::Utf8Value utf8(isolate, result); + + return strdup(*utf8); + } +} + +void +__IonoInstance::run_node() { + v8::Locker locker(isolate); + v8::Isolate::Scope isolate_scope(isolate); + v8::HandleScope handle_scope(isolate); + v8::Context::Scope context_scope(setup->context()); + break_requested = false; + while (true) { + uv_run(uv_default_loop(), UV_RUN_ONCE); + platform->DrainTasks(isolate); + if (break_requested) + break; + } +} + +void +__IonoInstance::make_callback(const char *callback) +{ + v8::Locker locker(isolate); + v8::Isolate::Scope isolate_scope(isolate); + v8::HandleScope handle_scope(isolate); + v8::Context::Scope context_scope(setup->context()); + v8::Local<v8::Object> global = setup->context()->Global(); + v8::Local<v8::Value> argv[] = { + v8::String::NewFromUtf8(isolate, callback, + v8::NewStringType::kNormal).ToLocalChecked() + }; + node::MakeCallback(isolate, global, "__node_run", 1, argv, {0, 0}); +} + +static void +notify_callback(uv_async_t *async) { + __IonoInstance *instance = (__IonoInstance *)async->data; + instance->break_requested = true; +} + +static void +send_message_callback(const v8::FunctionCallbackInfo<v8::Value> &args) { + v8::Isolate *isolate = args.GetIsolate(); + v8::Locker locker(isolate); + if (args.Length() < 1) return; + v8::HandleScope scope(isolate); + v8::Local<v8::Value> arg = args[0]; + v8::String::Utf8Value value(isolate, arg); + + v8::Local<v8::Object> data = v8::Local<v8::Object>::Cast(args.Data()); + + __IonoInstance *instance = (__IonoInstance *)data->GetAlignedPointerFromInternalField(0); + + /*JNIEnv *env = myInstance->currentJniEnv; + + if (env == nullptr) { + mylog("FATAL: JNI env is nullptr"); + return; + } + + jclass clazz = env->FindClass("akono/AkonoJni"); + + if (clazz == nullptr) { + mylog("FATAL: class not found"); + return; + } + + jstring payloadStr = env->NewStringUTF(*value); + + jmethodID meth = env->GetMethodID(clazz, "internalOnNotify", "(Ljava/lang/String;)V"); + + if (meth == nullptr) { + mylog("FATAL: method not found"); + return; + } + + env->CallVoidMethod(myInstance->currentJniThiz, meth, payloadStr);*/ +} diff --git a/Taler/node_wrapper.h b/Taler/node_wrapper.h new file mode 100644 index 0000000..164b95e --- /dev/null +++ b/Taler/node_wrapper.h @@ -0,0 +1,44 @@ +// +// node_wrapper.h +// Taler +// +// Created by Jonathan Buchanan on 12/31/20. +// Copyright © 2020 Taler. All rights reserved. +// + +#ifndef node_wrapper_h +#define node_wrapper_h + +#ifdef __cplusplus +extern "C" { +#endif + +struct __IonoInstance; + +struct __IonoInstance * +__new_instance(); + +void +__free_instance(struct __IonoInstance *instance); + +// result must be freed! +char * +__eval_js(const char *js, struct __IonoInstance *instance); + +void +__notify_instance(struct __IonoInstance *instance); + +void +__run_node(struct __IonoInstance *instance); + +void +__make_callback(const char *callback, struct __IonoInstance *instance); + +void +__put_module_code(const char *module_name, const char *module_code, struct IonoInstance *instance); + +#ifdef __cplusplus +} +#endif + +#endif /* node_wrapper_h */ diff --git a/TalerTests/NodeWrapperTests.swift b/TalerTests/NodeWrapperTests.swift new file mode 100644 index 0000000..e01f1e9 --- /dev/null +++ b/TalerTests/NodeWrapperTests.swift @@ -0,0 +1,31 @@ +// +// NodeWrapperTests.swift +// TalerTests +// +// Created by Jonathan Buchanan on 1/14/21. +// Copyright © 2021 Taler. All rights reserved. +// + +import XCTest +@testable import Taler + +class NodeWrapperTests: XCTestCase { + var iono: Iono! + + override func setUpWithError() throws { + iono = Iono() + } + + override func tearDownWithError() throws { + + } + + func testEvalJS() throws { + XCTAssert("2" == iono.evalJS(source: "1 + 1")) + XCTAssert("36" == iono.evalJS(source: "6 * 6")) + XCTAssert("42" == iono.evalJS(source: "(()=>{let x = 42; return x;})()")) + XCTAssert("undefined" == iono.evalJS(source: "const myVal = 42")) + XCTAssert("43" == iono.evalJS(source: "myVal + 1")) + } + +} diff --git a/wallet-kotlin b/wallet-kotlin deleted file mode 160000 -Subproject 91dad4b89cd73f68cbbe36aa6211f39af6cb334 |