├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── .gitignore
├── .gitmodules
├── LICENSE
├── LuaScriptCore.podspec
├── README.md
├── Sample
├── Android
│ ├── .gitignore
│ ├── Android.iml
│ ├── app
│ │ ├── .externalNativeBuild
│ │ │ └── ndkBuild
│ │ │ │ ├── debug
│ │ │ │ ├── arm64-v8a
│ │ │ │ │ ├── android_gradle_build.json
│ │ │ │ │ ├── ndkBuild_build_command.txt
│ │ │ │ │ └── ndkBuild_build_output.txt
│ │ │ │ ├── armeabi-v7a
│ │ │ │ │ ├── android_gradle_build.json
│ │ │ │ │ ├── ndkBuild_build_command.txt
│ │ │ │ │ └── ndkBuild_build_output.txt
│ │ │ │ ├── armeabi
│ │ │ │ │ ├── android_gradle_build.json
│ │ │ │ │ ├── ndkBuild_build_command.txt
│ │ │ │ │ └── ndkBuild_build_output.txt
│ │ │ │ ├── mips
│ │ │ │ │ ├── android_gradle_build.json
│ │ │ │ │ ├── ndkBuild_build_command.txt
│ │ │ │ │ └── ndkBuild_build_output.txt
│ │ │ │ ├── mips64
│ │ │ │ │ ├── android_gradle_build.json
│ │ │ │ │ ├── ndkBuild_build_command.txt
│ │ │ │ │ └── ndkBuild_build_output.txt
│ │ │ │ ├── x86
│ │ │ │ │ ├── android_gradle_build.json
│ │ │ │ │ ├── ndkBuild_build_command.txt
│ │ │ │ │ └── ndkBuild_build_output.txt
│ │ │ │ └── x86_64
│ │ │ │ │ ├── android_gradle_build.json
│ │ │ │ │ ├── ndkBuild_build_command.txt
│ │ │ │ │ └── ndkBuild_build_output.txt
│ │ │ │ └── release
│ │ │ │ ├── arm64-v8a
│ │ │ │ ├── android_gradle_build.json
│ │ │ │ ├── ndkBuild_build_command.txt
│ │ │ │ └── ndkBuild_build_output.txt
│ │ │ │ ├── armeabi-v7a
│ │ │ │ ├── android_gradle_build.json
│ │ │ │ ├── ndkBuild_build_command.txt
│ │ │ │ └── ndkBuild_build_output.txt
│ │ │ │ ├── armeabi
│ │ │ │ ├── android_gradle_build.json
│ │ │ │ ├── ndkBuild_build_command.txt
│ │ │ │ └── ndkBuild_build_output.txt
│ │ │ │ ├── mips
│ │ │ │ ├── android_gradle_build.json
│ │ │ │ ├── ndkBuild_build_command.txt
│ │ │ │ └── ndkBuild_build_output.txt
│ │ │ │ ├── mips64
│ │ │ │ ├── android_gradle_build.json
│ │ │ │ ├── ndkBuild_build_command.txt
│ │ │ │ └── ndkBuild_build_output.txt
│ │ │ │ ├── x86
│ │ │ │ ├── android_gradle_build.json
│ │ │ │ ├── ndkBuild_build_command.txt
│ │ │ │ └── ndkBuild_build_output.txt
│ │ │ │ └── x86_64
│ │ │ │ ├── android_gradle_build.json
│ │ │ │ ├── ndkBuild_build_command.txt
│ │ │ │ └── ndkBuild_build_output.txt
│ │ ├── .gitignore
│ │ ├── app.iml
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ ├── .DS_Store
│ │ │ ├── androidTest
│ │ │ └── java
│ │ │ │ └── cn
│ │ │ │ └── vimfung
│ │ │ │ └── luascriptcore
│ │ │ │ └── sample
│ │ │ │ └── ApplicationTest.java
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── assets
│ │ │ │ ├── coroutine.lua
│ │ │ │ ├── defineProperty.lua
│ │ │ │ ├── dkjson.lua
│ │ │ │ ├── main.lua
│ │ │ │ ├── test.lua
│ │ │ │ └── todo.lua
│ │ │ ├── java
│ │ │ │ └── cn
│ │ │ │ │ └── vimfung
│ │ │ │ │ └── luascriptcore
│ │ │ │ │ └── sample
│ │ │ │ │ ├── Chinese.java
│ │ │ │ │ ├── Console.java
│ │ │ │ │ ├── English.java
│ │ │ │ │ ├── Env.java
│ │ │ │ │ ├── ErrLogModule.java
│ │ │ │ │ ├── LogModule.java
│ │ │ │ │ ├── MainActivity.java
│ │ │ │ │ ├── ModulesActivity.java
│ │ │ │ │ ├── ModulesAdapter.java
│ │ │ │ │ ├── NativeData.java
│ │ │ │ │ ├── Person.java
│ │ │ │ │ ├── TestObj.java
│ │ │ │ │ └── TestObjectProxy.java
│ │ │ └── res
│ │ │ │ ├── layout
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── activity_modules.xml
│ │ │ │ ├── content_modules.xml
│ │ │ │ ├── fragment_modules.xml
│ │ │ │ └── module_list_item_view.xml
│ │ │ │ ├── menu
│ │ │ │ └── menu_modules.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── values-w820dp
│ │ │ │ └── dimens.xml
│ │ │ │ └── values
│ │ │ │ ├── colors.xml
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ └── test
│ │ │ └── java
│ │ │ └── cn
│ │ │ └── vimfung
│ │ │ └── luascriptcore
│ │ │ └── sample
│ │ │ └── ExampleUnitTest.java
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── local.properties
│ ├── projectFilesBackup
│ │ └── .DS_Store
│ └── settings.gradle
└── iOS_OSX
│ ├── Common
│ ├── Env.h
│ ├── Env.m
│ ├── LSCTNativeData.h
│ ├── LSCTNativeData.m
│ ├── LSCTPerson.h
│ ├── LSCTPerson.m
│ ├── LogModule.h
│ └── LogModule.m
│ ├── LuaScript
│ ├── dkjson.lua
│ ├── hello.lua
│ ├── main.lua
│ ├── test.lua
│ └── todo.lua
│ ├── Sample-OSX-Swift
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Base.lproj
│ │ └── Main.storyboard
│ ├── Info.plist
│ ├── LSCTNativeData.swift
│ ├── LSCTPerson.swift
│ ├── LogModule.swift
│ ├── ModulesViewController.swift
│ └── ViewController1.swift
│ ├── Sample-OSX
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Base.lproj
│ │ └── Main.storyboard
│ ├── Info.plist
│ ├── ModulesViewController.h
│ ├── ModulesViewController.m
│ ├── ViewController.h
│ ├── ViewController.m
│ └── main.m
│ ├── Sample-iOS-Swift
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Info.plist
│ ├── LSCTNativeData.swift
│ ├── LSCTPerson.swift
│ ├── LogModule.swift
│ ├── ModuleListViewController.swift
│ ├── ModuleViewControllers
│ │ ├── CryptoModuleViewController.swift
│ │ ├── EncodingModuleViewController.swift
│ │ ├── HttpModuleViewController.swift
│ │ ├── PathModuleViewController.swift
│ │ └── ThreadModuleViewController.swift
│ └── ViewController.swift
│ ├── Sample-iOS
│ ├── .DS_Store
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Info.plist
│ ├── ModuleListViewController.h
│ ├── ModuleListViewController.m
│ ├── ModuleViewControllers
│ │ ├── CryptoModuleViewController.h
│ │ ├── CryptoModuleViewController.m
│ │ ├── EncodingModuleViewController.h
│ │ ├── EncodingModuleViewController.m
│ │ ├── HttpModuleViewController.h
│ │ ├── HttpModuleViewController.m
│ │ ├── PathModuleViewController.h
│ │ ├── PathModuleViewController.m
│ │ ├── ThreadModuleViewController.h
│ │ └── ThreadModuleViewController.m
│ ├── ViewController.h
│ ├── ViewController.m
│ └── main.m
│ └── Sample.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ └── xcuserdata
│ └── vimfung.xcuserdatad
│ ├── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
│ └── xcschemes
│ └── Sample-OSX.xcscheme
├── Source
├── Android
│ ├── .gitignore
│ ├── .idea
│ │ └── modules.xml
│ ├── Android.iml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── luascriptcore
│ │ ├── .gitignore
│ │ ├── bintrayv1.gradle
│ │ ├── build.gradle
│ │ ├── compile-5.1.5.gradle
│ │ ├── compile.gradle
│ │ ├── installv1.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ ├── androidTest
│ │ │ └── java
│ │ │ │ └── cn
│ │ │ │ └── vimfung
│ │ │ │ └── luascriptcore
│ │ │ │ └── ApplicationTest.java
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ │ └── cn
│ │ │ │ │ └── vimfung
│ │ │ │ │ └── luascriptcore
│ │ │ │ │ ├── LuaBaseObject.java
│ │ │ │ │ ├── LuaContext.java
│ │ │ │ │ ├── LuaEnv.java
│ │ │ │ │ ├── LuaExceptionHandler.java
│ │ │ │ │ ├── LuaExclude.java
│ │ │ │ │ ├── LuaExportType.java
│ │ │ │ │ ├── LuaExportTypeConfig.java
│ │ │ │ │ ├── LuaExportTypeManager.java
│ │ │ │ │ ├── LuaFunction.java
│ │ │ │ │ ├── LuaManagedValue.java
│ │ │ │ │ ├── LuaMethodHandler.java
│ │ │ │ │ ├── LuaNativeUtil.java
│ │ │ │ │ ├── LuaPointer.java
│ │ │ │ │ ├── LuaScriptController.java
│ │ │ │ │ ├── LuaTuple.java
│ │ │ │ │ ├── LuaValue.java
│ │ │ │ │ └── LuaValueType.java
│ │ │ ├── jni
│ │ │ │ ├── .DS_Store
│ │ │ │ ├── Android-5.1.5.mk
│ │ │ │ ├── Android.mk
│ │ │ │ ├── CMakeLists.txt
│ │ │ │ ├── LuaDefine.h
│ │ │ │ ├── LuaJavaConverter.cpp
│ │ │ │ ├── LuaJavaConverter.h
│ │ │ │ ├── LuaJavaEnv.cpp
│ │ │ │ ├── LuaJavaEnv.h
│ │ │ │ ├── LuaJavaExceptionHandler.cpp
│ │ │ │ ├── LuaJavaExceptionHandler.h
│ │ │ │ ├── LuaJavaExportMethodDescriptor.cpp
│ │ │ │ ├── LuaJavaExportMethodDescriptor.h
│ │ │ │ ├── LuaJavaExportPropertyDescriptor.cpp
│ │ │ │ ├── LuaJavaExportPropertyDescriptor.h
│ │ │ │ ├── LuaJavaExportTypeDescriptor.cpp
│ │ │ │ ├── LuaJavaExportTypeDescriptor.h
│ │ │ │ ├── LuaJavaObjectDescriptor.cpp
│ │ │ │ ├── LuaJavaObjectDescriptor.h
│ │ │ │ ├── LuaJavaType.cpp
│ │ │ │ ├── LuaJavaType.h
│ │ │ │ ├── cn_vimfung_luascriptcore_LuaNativeUtil.cpp
│ │ │ │ └── cn_vimfung_luascriptcore_LuaNativeUtil.h
│ │ │ └── res
│ │ │ │ └── values
│ │ │ │ └── strings.xml
│ │ │ └── test
│ │ │ └── java
│ │ │ └── cn
│ │ │ └── vimfung
│ │ │ └── luascriptcore
│ │ │ ├── ExampleUnitTest.java
│ │ │ └── test
│ │ │ ├── Env.java
│ │ │ └── Person.java
│ └── settings.gradle
├── Unity3D
│ ├── Android
│ │ ├── .gitignore
│ │ ├── Android.iml
│ │ ├── LuaScriptCore.iml
│ │ ├── build.gradle
│ │ ├── gradle.properties
│ │ ├── gradle
│ │ │ └── wrapper
│ │ │ │ ├── gradle-wrapper.jar
│ │ │ │ └── gradle-wrapper.properties
│ │ ├── gradlew
│ │ ├── gradlew.bat
│ │ ├── local.properties
│ │ ├── luascriptcore-unity-android
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── luascriptcore-unity-android.iml
│ │ │ ├── proguard-rules.pro
│ │ │ └── src
│ │ │ │ ├── androidTest
│ │ │ │ └── java
│ │ │ │ │ └── cn
│ │ │ │ │ └── vimfung
│ │ │ │ │ └── luascriptcore
│ │ │ │ │ └── unity
│ │ │ │ │ └── ExampleInstrumentedTest.java
│ │ │ │ ├── main
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ ├── jni
│ │ │ │ │ └── Android.mk
│ │ │ │ └── res
│ │ │ │ │ └── values
│ │ │ │ │ └── strings.xml
│ │ │ │ └── test
│ │ │ │ └── java
│ │ │ │ └── cn
│ │ │ │ └── vimfung
│ │ │ │ └── luascriptcore
│ │ │ │ └── unity
│ │ │ │ └── ExampleUnitTest.java
│ │ └── settings.gradle
│ ├── UnityCommon
│ │ ├── LuaScriptCoreForUnity.cpp
│ │ ├── LuaScriptCoreForUnity.h
│ │ ├── LuaUnityDefined.h
│ │ ├── LuaUnityEnv.cpp
│ │ ├── LuaUnityEnv.hpp
│ │ ├── LuaUnityExportMethodDescriptor.cpp
│ │ ├── LuaUnityExportMethodDescriptor.hpp
│ │ ├── LuaUnityExportPropertyDescriptor.cpp
│ │ ├── LuaUnityExportPropertyDescriptor.hpp
│ │ ├── LuaUnityExportTypeDescriptor.cpp
│ │ └── LuaUnityExportTypeDescriptor.hpp
│ ├── UnityProject
│ │ ├── Assets
│ │ │ ├── Plugins.meta
│ │ │ ├── Plugins
│ │ │ │ └── LuaScriptCore
│ │ │ │ │ ├── ILuaObject.cs
│ │ │ │ │ ├── ILuaObject.cs.meta
│ │ │ │ │ ├── LuaBaseObject.cs
│ │ │ │ │ ├── LuaBaseObject.cs.meta
│ │ │ │ │ ├── LuaContext.cs
│ │ │ │ │ ├── LuaContext.cs.meta
│ │ │ │ │ ├── LuaExclude.cs
│ │ │ │ │ ├── LuaExclude.cs.meta
│ │ │ │ │ ├── LuaExportType.cs
│ │ │ │ │ ├── LuaExportType.cs.meta
│ │ │ │ │ ├── LuaExportTypeAnnotation.cs
│ │ │ │ │ ├── LuaExportTypeAnnotation.cs.meta
│ │ │ │ │ ├── LuaExportsTypeManager.cs
│ │ │ │ │ ├── LuaExportsTypeManager.cs.meta
│ │ │ │ │ ├── LuaFunction.cs
│ │ │ │ │ ├── LuaFunction.cs.meta
│ │ │ │ │ ├── LuaManagedValue.cs
│ │ │ │ │ ├── LuaManagedValue.cs.meta
│ │ │ │ │ ├── LuaObjectDecoder.cs
│ │ │ │ │ ├── LuaObjectDecoder.cs.meta
│ │ │ │ │ ├── LuaObjectDescriptor.cs
│ │ │ │ │ ├── LuaObjectDescriptor.cs.meta
│ │ │ │ │ ├── LuaObjectEncoder.cs
│ │ │ │ │ ├── LuaObjectEncoder.cs.meta
│ │ │ │ │ ├── LuaObjectReference.cs
│ │ │ │ │ ├── LuaObjectReference.cs.meta
│ │ │ │ │ ├── LuaPointer.cs
│ │ │ │ │ ├── LuaPointer.cs.meta
│ │ │ │ │ ├── LuaScriptController.cs
│ │ │ │ │ ├── LuaTuple.cs
│ │ │ │ │ ├── LuaTuple.cs.meta
│ │ │ │ │ ├── LuaValue.cs
│ │ │ │ │ ├── LuaValue.cs.meta
│ │ │ │ │ ├── NativeUtils.cs
│ │ │ │ │ ├── NativeUtils.cs.meta
│ │ │ │ │ ├── UNIEnv.cs
│ │ │ │ │ └── UNIEnv.cs.meta
│ │ │ ├── Scenes.meta
│ │ │ ├── Scenes
│ │ │ │ ├── ModulesScene.unity
│ │ │ │ ├── ModulesScene.unity.meta
│ │ │ │ ├── Scene1.unity
│ │ │ │ ├── Scene1.unity.meta
│ │ │ │ ├── Scene2.unity
│ │ │ │ └── Scene2.unity.meta
│ │ │ ├── Scripts.meta
│ │ │ ├── Scripts
│ │ │ │ ├── Chinese.cs
│ │ │ │ ├── Chinese.cs.meta
│ │ │ │ ├── LogModule.cs
│ │ │ │ ├── LogModule.cs.meta
│ │ │ │ ├── ModuleItemCell.cs
│ │ │ │ ├── ModuleItemCell.cs.meta
│ │ │ │ ├── ModulesSceneController.cs
│ │ │ │ ├── ModulesSceneController.cs.meta
│ │ │ │ ├── NativeData.cs
│ │ │ │ ├── NativeData.cs.meta
│ │ │ │ ├── Person.cs
│ │ │ │ ├── Person.cs.meta
│ │ │ │ ├── Sample.cs
│ │ │ │ └── Sample.cs.meta
│ │ │ ├── StreamingAssets.meta
│ │ │ ├── StreamingAssets
│ │ │ │ ├── .DS_Store
│ │ │ │ ├── coroutine.lua
│ │ │ │ ├── coroutine.lua.meta
│ │ │ │ ├── defineProperty.lua
│ │ │ │ ├── defineProperty.lua.meta
│ │ │ │ ├── dkjson.lua
│ │ │ │ ├── dkjson.lua.meta
│ │ │ │ ├── main.lua
│ │ │ │ ├── main.lua.meta
│ │ │ │ ├── todo.lua
│ │ │ │ └── todo.lua.meta
│ │ │ └── VFCommon
│ │ │ │ ├── External.meta
│ │ │ │ ├── External
│ │ │ │ ├── EnhancedScroller v2.meta
│ │ │ │ └── EnhancedScroller v2
│ │ │ │ │ ├── Plugins.meta
│ │ │ │ │ └── Plugins
│ │ │ │ │ ├── EnhancedScroller.cs
│ │ │ │ │ ├── EnhancedScroller.cs.meta
│ │ │ │ │ ├── EnhancedScrollerCellView.cs
│ │ │ │ │ ├── EnhancedScrollerCellView.cs.meta
│ │ │ │ │ ├── IEnhancedScrollerDelegate.cs
│ │ │ │ │ ├── IEnhancedScrollerDelegate.cs.meta
│ │ │ │ │ ├── SmallList.cs
│ │ │ │ │ └── SmallList.cs.meta
│ │ │ │ ├── Prefabs.meta
│ │ │ │ ├── Prefabs
│ │ │ │ ├── UI.meta
│ │ │ │ └── UI
│ │ │ │ │ ├── ListView.meta
│ │ │ │ │ └── ListView
│ │ │ │ │ ├── ListItemView.prefab
│ │ │ │ │ ├── ListItemView.prefab.meta
│ │ │ │ │ ├── ListView.prefab
│ │ │ │ │ └── ListView.prefab.meta
│ │ │ │ ├── UI.meta
│ │ │ │ └── UI
│ │ │ │ ├── ListViewController.cs
│ │ │ │ └── ListViewController.cs.meta
│ │ └── ProjectSettings
│ │ │ ├── AudioManager.asset
│ │ │ ├── ClusterInputManager.asset
│ │ │ ├── DynamicsManager.asset
│ │ │ ├── EditorBuildSettings.asset
│ │ │ ├── EditorSettings.asset
│ │ │ ├── GraphicsSettings.asset
│ │ │ ├── InputManager.asset
│ │ │ ├── NavMeshAreas.asset
│ │ │ ├── NetworkManager.asset
│ │ │ ├── Physics2DSettings.asset
│ │ │ ├── ProjectSettings.asset
│ │ │ ├── ProjectVersion.txt
│ │ │ ├── QualitySettings.asset
│ │ │ ├── TagManager.asset
│ │ │ ├── TimeManager.asset
│ │ │ └── UnityConnectSettings.asset
│ ├── Windows
│ │ ├── LuaScriptCore
│ │ │ ├── LuaScriptCore.vcxproj
│ │ │ ├── LuaScriptCore.vcxproj.filters
│ │ │ ├── LuaScriptCore.vcxproj.user
│ │ │ └── dllmain.cpp
│ │ └── Windows.sln
│ └── iOS_OSX
│ │ ├── LuaScriptCore-Unity-OSX
│ │ ├── .DS_Store
│ │ └── Info.plist
│ │ ├── LuaScriptCore.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ └── xcuserdata
│ │ │ └── vimfung.xcuserdatad
│ │ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ │ ├── LuaScriptCoreTests
│ │ ├── Info.plist
│ │ ├── LuaScriptCoreTests.mm
│ │ └── main.lua
│ │ └── LuaScriptCore_5_1.xcodeproj
│ │ ├── project.pbxproj
│ │ └── project.xcworkspace
│ │ └── contents.xcworkspacedata
├── iOS_OSX
│ ├── Code-Swift
│ │ ├── LuaConfig.swift
│ │ ├── LuaContext.swift
│ │ ├── LuaExportMethodDescriptor.swift
│ │ ├── LuaExportPropertyDescriptor.swift
│ │ ├── LuaExportType.swift
│ │ ├── LuaExportTypeAnnotation.swift
│ │ ├── LuaExportTypeDescriptor.swift
│ │ ├── LuaFunction.swift
│ │ ├── LuaManagedValue.swift
│ │ ├── LuaPointer.swift
│ │ ├── LuaRunScriptConfig.swift
│ │ ├── LuaTuple.swift
│ │ └── LuaValue.swift
│ ├── Code
│ │ ├── LSCContext.h
│ │ ├── LSCContext.m
│ │ ├── LSCContext_Private.h
│ │ ├── LSCCoroutine+Private.h
│ │ ├── LSCCoroutine.h
│ │ ├── LSCCoroutine.m
│ │ ├── LSCDataExchanger.h
│ │ ├── LSCDataExchanger.m
│ │ ├── LSCDataExchanger_Private.h
│ │ ├── LSCEngineAdapter.h
│ │ ├── LSCEngineAdapter.m
│ │ ├── LSCError.h
│ │ ├── LSCError.m
│ │ ├── LSCExportMethodDescriptor.h
│ │ ├── LSCExportMethodDescriptor.m
│ │ ├── LSCExportPropertyDescriptor.h
│ │ ├── LSCExportPropertyDescriptor.m
│ │ ├── LSCExportType.h
│ │ ├── LSCExportTypeAnnotation.h
│ │ ├── LSCExportTypeDescriptor+Private.h
│ │ ├── LSCExportTypeDescriptor.h
│ │ ├── LSCExportTypeDescriptor.m
│ │ ├── LSCExportsTypeManager.h
│ │ ├── LSCExportsTypeManager.m
│ │ ├── LSCFunction.h
│ │ ├── LSCFunction.m
│ │ ├── LSCFunction_Private.h
│ │ ├── LSCManagedObjectProtocol.h
│ │ ├── LSCManagedValue.h
│ │ ├── LSCManagedValue.m
│ │ ├── LSCOperationQueue.h
│ │ ├── LSCOperationQueue.m
│ │ ├── LSCPointer.h
│ │ ├── LSCPointer.m
│ │ ├── LSCScriptController+Private.h
│ │ ├── LSCScriptController.h
│ │ ├── LSCScriptController.m
│ │ ├── LSCSession.h
│ │ ├── LSCSession.m
│ │ ├── LSCSession_Private.h
│ │ ├── LSCTable+Private.h
│ │ ├── LSCTable.h
│ │ ├── LSCTable.m
│ │ ├── LSCTmpValue.h
│ │ ├── LSCTmpValue.m
│ │ ├── LSCTuple.h
│ │ ├── LSCTuple.m
│ │ ├── LSCTuple_Private.h
│ │ ├── LSCTypeDefinied.h
│ │ ├── LSCValue.h
│ │ ├── LSCValue.m
│ │ ├── LSCValue_Private.h
│ │ ├── LSCVirtualInstance.h
│ │ ├── LSCVirtualInstance.m
│ │ └── LuaScriptCore.h
│ ├── LSCConfig.h
│ ├── LSCConfig.m
│ ├── LuaScriptCore-OSX-Swift
│ │ ├── Info.plist
│ │ └── LuaScriptCore_OSX_Swift.h
│ ├── LuaScriptCore-iOS-Swift
│ │ ├── Info.plist
│ │ └── LuaScriptCore_iOS_Swift.h
│ ├── LuaScriptCore-iOS-SwiftTests
│ │ ├── Env.swift
│ │ ├── Info.plist
│ │ ├── LuaScriptCore_iOS_SwiftTests.swift
│ │ └── Person.swift
│ ├── LuaScriptCore.xcodeproj
│ │ ├── project.pbxproj
│ │ └── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ ├── LuaScriptCoreTests-OSX
│ │ ├── Info.plist
│ │ └── LuaScriptCoreTests_OSX.m
│ ├── LuaScriptCoreTests-iOS
│ │ ├── America.h
│ │ ├── America.m
│ │ ├── Chinese.h
│ │ ├── Chinese.m
│ │ ├── English.h
│ │ ├── English.m
│ │ ├── Env.h
│ │ ├── Env.m
│ │ ├── Info.plist
│ │ ├── LuaLog.h
│ │ ├── LuaLog.m
│ │ ├── LuaScriptCoreTests_iOS.m
│ │ ├── NativePerson.h
│ │ ├── NativePerson.m
│ │ ├── Person.h
│ │ ├── Person.m
│ │ ├── SubLuaLog.h
│ │ ├── SubLuaLog.m
│ │ ├── Test.lua
│ │ ├── Test1.lua
│ │ ├── Test2.lua
│ │ ├── TestModule.h
│ │ ├── TestModule.m
│ │ ├── class.lua
│ │ ├── config.lua
│ │ ├── coroutine.lua
│ │ ├── definedProperty.lua
│ │ └── test.out
│ └── LuaScriptCore_5_1.xcodeproj
│ │ ├── project.pbxproj
│ │ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── lua-common
│ ├── .DS_Store
│ ├── LuaContext.cpp
│ ├── LuaContext.h
│ ├── LuaCoroutine.cpp
│ ├── LuaCoroutine.h
│ ├── LuaDataExchanger.cpp
│ ├── LuaDataExchanger.h
│ ├── LuaDefined.h
│ ├── LuaEngineAdapter.cpp
│ ├── LuaEngineAdapter.hpp
│ ├── LuaError.cpp
│ ├── LuaError.h
│ ├── LuaExportMethodDescriptor.cpp
│ ├── LuaExportMethodDescriptor.hpp
│ ├── LuaExportPropertyDescriptor.cpp
│ ├── LuaExportPropertyDescriptor.hpp
│ ├── LuaExportTypeDescriptor.cpp
│ ├── LuaExportTypeDescriptor.hpp
│ ├── LuaExportsTypeManager.cpp
│ ├── LuaExportsTypeManager.hpp
│ ├── LuaFunction.cpp
│ ├── LuaFunction.h
│ ├── LuaManagedObject.cpp
│ ├── LuaManagedObject.h
│ ├── LuaNativeClass.cpp
│ ├── LuaNativeClass.hpp
│ ├── LuaNativeClassFactory.cpp
│ ├── LuaNativeClassFactory.hpp
│ ├── LuaObject.cpp
│ ├── LuaObject.h
│ ├── LuaObjectDecoder.cpp
│ ├── LuaObjectDecoder.hpp
│ ├── LuaObjectDescriptor.cpp
│ ├── LuaObjectDescriptor.h
│ ├── LuaObjectEncoder.cpp
│ ├── LuaObjectEncoder.hpp
│ ├── LuaObjectManager.cpp
│ ├── LuaObjectManager.h
│ ├── LuaObjectSerializationTypes.h
│ ├── LuaOperationQueue.cpp
│ ├── LuaOperationQueue.h
│ ├── LuaPointer.cpp
│ ├── LuaPointer.h
│ ├── LuaScriptController.cpp
│ ├── LuaScriptController.h
│ ├── LuaSession.cpp
│ ├── LuaSession.h
│ ├── LuaTmpValue.cpp
│ ├── LuaTmpValue.hpp
│ ├── LuaTuple.cpp
│ ├── LuaTuple.h
│ ├── LuaValue.cpp
│ ├── LuaValue.h
│ ├── StringUtils.cpp
│ └── StringUtils.h
├── lua-core-5.1.5
│ ├── COPYRIGHT
│ ├── HISTORY
│ ├── INSTALL
│ ├── Makefile
│ ├── README
│ ├── doc
│ │ ├── contents.html
│ │ ├── cover.png
│ │ ├── logo.gif
│ │ ├── lua.1
│ │ ├── lua.css
│ │ ├── lua.html
│ │ ├── luac.1
│ │ ├── luac.html
│ │ ├── manual.css
│ │ ├── manual.html
│ │ └── readme.html
│ └── src
│ │ ├── Makefile
│ │ ├── lapi.c
│ │ ├── lapi.h
│ │ ├── lauxlib.c
│ │ ├── lauxlib.h
│ │ ├── lbaselib.c
│ │ ├── lcode.c
│ │ ├── lcode.h
│ │ ├── ldblib.c
│ │ ├── ldebug.c
│ │ ├── ldebug.h
│ │ ├── ldo.c
│ │ ├── ldo.h
│ │ ├── ldump.c
│ │ ├── lext.c
│ │ ├── lext.h
│ │ ├── lfunc.c
│ │ ├── lfunc.h
│ │ ├── lgc.c
│ │ ├── lgc.h
│ │ ├── linit.c
│ │ ├── liolib.c
│ │ ├── llex.c
│ │ ├── llex.h
│ │ ├── llimits.h
│ │ ├── lmathlib.c
│ │ ├── lmem.c
│ │ ├── lmem.h
│ │ ├── loadlib.c
│ │ ├── lobject.c
│ │ ├── lobject.h
│ │ ├── lopcodes.c
│ │ ├── lopcodes.h
│ │ ├── loslib.c
│ │ ├── lparser.c
│ │ ├── lparser.h
│ │ ├── lstate.c
│ │ ├── lstate.h
│ │ ├── lstring.c
│ │ ├── lstring.h
│ │ ├── lstrlib.c
│ │ ├── ltable.c
│ │ ├── ltable.h
│ │ ├── ltablib.c
│ │ ├── ltm.c
│ │ ├── ltm.h
│ │ ├── lua.h
│ │ ├── lua.hpp
│ │ ├── luaconf.h
│ │ ├── lualib.h
│ │ ├── lundump.c
│ │ ├── lundump.h
│ │ ├── lunity.c
│ │ ├── lunity.h
│ │ ├── lvm.c
│ │ ├── lvm.h
│ │ ├── lzio.c
│ │ ├── lzio.h
│ │ └── print.c
└── lua-core
│ ├── doc
│ ├── index.css
│ ├── luac.1
│ ├── manual.css
│ └── osi-certified-72x60.png
│ └── src
│ ├── lapi.c
│ ├── lapi.h
│ ├── lauxlib.c
│ ├── lauxlib.h
│ ├── lbaselib.c
│ ├── lbitlib.c
│ ├── lcode.c
│ ├── lcode.h
│ ├── lcorolib.c
│ ├── lctype.c
│ ├── lctype.h
│ ├── ldblib.c
│ ├── ldebug.c
│ ├── ldebug.h
│ ├── ldo.c
│ ├── ldo.h
│ ├── ldump.c
│ ├── lfunc.c
│ ├── lfunc.h
│ ├── lgc.c
│ ├── lgc.h
│ ├── linit.c
│ ├── liolib.c
│ ├── llex.c
│ ├── llex.h
│ ├── llimits.h
│ ├── lmathlib.c
│ ├── lmem.c
│ ├── lmem.h
│ ├── loadlib.c
│ ├── lobject.c
│ ├── lobject.h
│ ├── lopcodes.c
│ ├── lopcodes.h
│ ├── loslib.c
│ ├── lparser.c
│ ├── lparser.h
│ ├── lprefix.h
│ ├── lstate.c
│ ├── lstate.h
│ ├── lstring.c
│ ├── lstring.h
│ ├── lstrlib.c
│ ├── ltable.c
│ ├── ltable.h
│ ├── ltablib.c
│ ├── ltm.c
│ ├── ltm.h
│ ├── lua.h
│ ├── lua.hpp
│ ├── luaconf.h
│ ├── lualib.h
│ ├── lundump.c
│ ├── lundump.h
│ ├── lunity.c
│ ├── lunity.h
│ ├── lutf8lib.c
│ ├── lvm.c
│ ├── lvm.h
│ ├── lzio.c
│ └── lzio.h
└── _config.yml
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 |
5 | ---
6 |
7 | **Describe the bug**
8 | A clear and concise description of what the bug is.
9 |
10 | **To Reproduce**
11 | Steps to reproduce the behavior:
12 | 1. Go to '...'
13 | 2. Click on '....'
14 | 3. Scroll down to '....'
15 | 4. See error
16 |
17 | **Expected behavior**
18 | A clear and concise description of what you expected to happen.
19 |
20 | **Screenshots**
21 | If applicable, add screenshots to help explain your problem.
22 |
23 | **Desktop (please complete the following information):**
24 | - OS: [e.g. iOS]
25 | - Browser [e.g. chrome, safari]
26 | - Version [e.g. 22]
27 |
28 | **Smartphone (please complete the following information):**
29 | - Device: [e.g. iPhone6]
30 | - OS: [e.g. iOS8.1]
31 | - Browser [e.g. stock browser, safari]
32 | - Version [e.g. 22]
33 |
34 | **Additional context**
35 | Add any other context about the problem here.
36 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 |
5 | ---
6 |
7 | **Is your feature request related to a problem? Please describe.**
8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9 |
10 | **Describe the solution you'd like**
11 | A clear and concise description of what you want to happen.
12 |
13 | **Describe alternatives you've considered**
14 | A clear and concise description of any alternative solutions or features you've considered.
15 |
16 | **Additional context**
17 | Add any other context or screenshots about the feature request here.
18 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "Modules"]
2 | path = Modules
3 | url = ../LuaScriptCore-Modules.git
4 |
--------------------------------------------------------------------------------
/Sample/Android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/Sample/Android/Android.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Sample/Android/app/.externalNativeBuild/ndkBuild/debug/arm64-v8a/ndkBuild_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /Users/vimfung/Library/Android/sdk/ndk-bundle/ndk-build
2 | arguments :
3 | NDK_PROJECT_PATH=null
4 | APP_BUILD_SCRIPT=/Users/vimfung/Documents/project/LuaScriptCore/Source/Android/luascriptcore/src/main/jni/Android.mk
5 | APP_ABI=arm64-v8a
6 | NDK_ALL_ABIS=arm64-v8a
7 | NDK_DEBUG=1
8 | APP_PLATFORM=android-21
9 | NDK_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/debug/obj
10 | NDK_LIBS_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/debug/lib
11 | APP_SHORT_COMMANDS=false
12 | LOCAL_SHORT_COMMANDS=false
13 | -B
14 | -n
15 | jvmArgs :
16 |
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/.externalNativeBuild/ndkBuild/debug/armeabi-v7a/ndkBuild_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /Users/vimfung/Library/Android/sdk/ndk-bundle/ndk-build
2 | arguments :
3 | NDK_PROJECT_PATH=null
4 | APP_BUILD_SCRIPT=/Users/vimfung/Documents/project/LuaScriptCore/Source/Android/luascriptcore/src/main/jni/Android.mk
5 | APP_ABI=armeabi-v7a
6 | NDK_ALL_ABIS=armeabi-v7a
7 | NDK_DEBUG=1
8 | APP_PLATFORM=android-13
9 | NDK_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/debug/obj
10 | NDK_LIBS_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/debug/lib
11 | APP_SHORT_COMMANDS=false
12 | LOCAL_SHORT_COMMANDS=false
13 | -B
14 | -n
15 | jvmArgs :
16 |
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/.externalNativeBuild/ndkBuild/debug/armeabi/ndkBuild_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /Users/vimfung/Library/Android/sdk/ndk-bundle/ndk-build
2 | arguments :
3 | NDK_PROJECT_PATH=null
4 | APP_BUILD_SCRIPT=/Users/vimfung/Documents/project/LuaScriptCore/Source/Android/luascriptcore/src/main/jni/Android.mk
5 | APP_ABI=armeabi
6 | NDK_ALL_ABIS=armeabi
7 | NDK_DEBUG=1
8 | APP_PLATFORM=android-13
9 | NDK_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/debug/obj
10 | NDK_LIBS_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/debug/lib
11 | APP_SHORT_COMMANDS=false
12 | LOCAL_SHORT_COMMANDS=false
13 | -B
14 | -n
15 | jvmArgs :
16 |
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/.externalNativeBuild/ndkBuild/debug/mips/ndkBuild_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /Users/vimfung/Library/Android/sdk/ndk-bundle/ndk-build
2 | arguments :
3 | NDK_PROJECT_PATH=null
4 | APP_BUILD_SCRIPT=/Users/vimfung/Documents/project/LuaScriptCore/Source/Android/luascriptcore/src/main/jni/Android.mk
5 | APP_ABI=mips
6 | NDK_ALL_ABIS=mips
7 | NDK_DEBUG=1
8 | APP_PLATFORM=android-13
9 | NDK_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/debug/obj
10 | NDK_LIBS_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/debug/lib
11 | APP_SHORT_COMMANDS=false
12 | LOCAL_SHORT_COMMANDS=false
13 | -B
14 | -n
15 | jvmArgs :
16 |
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/.externalNativeBuild/ndkBuild/debug/mips64/ndkBuild_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /Users/vimfung/Library/Android/sdk/ndk-bundle/ndk-build
2 | arguments :
3 | NDK_PROJECT_PATH=null
4 | APP_BUILD_SCRIPT=/Users/vimfung/Documents/project/LuaScriptCore/Source/Android/luascriptcore/src/main/jni/Android.mk
5 | APP_ABI=mips64
6 | NDK_ALL_ABIS=mips64
7 | NDK_DEBUG=1
8 | APP_PLATFORM=android-21
9 | NDK_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/debug/obj
10 | NDK_LIBS_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/debug/lib
11 | APP_SHORT_COMMANDS=false
12 | LOCAL_SHORT_COMMANDS=false
13 | -B
14 | -n
15 | jvmArgs :
16 |
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/.externalNativeBuild/ndkBuild/debug/x86/ndkBuild_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /Users/vimfung/Library/Android/sdk/ndk-bundle/ndk-build
2 | arguments :
3 | NDK_PROJECT_PATH=null
4 | APP_BUILD_SCRIPT=/Users/vimfung/Documents/project/LuaScriptCore/Source/Android/luascriptcore/src/main/jni/Android.mk
5 | APP_ABI=x86
6 | NDK_ALL_ABIS=x86
7 | NDK_DEBUG=1
8 | APP_PLATFORM=android-13
9 | NDK_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/debug/obj
10 | NDK_LIBS_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/debug/lib
11 | APP_SHORT_COMMANDS=false
12 | LOCAL_SHORT_COMMANDS=false
13 | -B
14 | -n
15 | jvmArgs :
16 |
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/.externalNativeBuild/ndkBuild/debug/x86_64/ndkBuild_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /Users/vimfung/Library/Android/sdk/ndk-bundle/ndk-build
2 | arguments :
3 | NDK_PROJECT_PATH=null
4 | APP_BUILD_SCRIPT=/Users/vimfung/Documents/project/LuaScriptCore/Source/Android/luascriptcore/src/main/jni/Android.mk
5 | APP_ABI=x86_64
6 | NDK_ALL_ABIS=x86_64
7 | NDK_DEBUG=1
8 | APP_PLATFORM=android-21
9 | NDK_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/debug/obj
10 | NDK_LIBS_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/debug/lib
11 | APP_SHORT_COMMANDS=false
12 | LOCAL_SHORT_COMMANDS=false
13 | -B
14 | -n
15 | jvmArgs :
16 |
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/.externalNativeBuild/ndkBuild/release/arm64-v8a/ndkBuild_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /Users/vimfung/Library/Android/sdk/ndk-bundle/ndk-build
2 | arguments :
3 | NDK_PROJECT_PATH=null
4 | APP_BUILD_SCRIPT=/Users/vimfung/Documents/project/LuaScriptCore/Source/Android/luascriptcore/src/main/jni/Android.mk
5 | APP_ABI=arm64-v8a
6 | NDK_ALL_ABIS=arm64-v8a
7 | NDK_DEBUG=0
8 | APP_PLATFORM=android-21
9 | NDK_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/release/obj
10 | NDK_LIBS_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/release/lib
11 | APP_SHORT_COMMANDS=false
12 | LOCAL_SHORT_COMMANDS=false
13 | -B
14 | -n
15 | jvmArgs :
16 |
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/.externalNativeBuild/ndkBuild/release/armeabi-v7a/ndkBuild_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /Users/vimfung/Library/Android/sdk/ndk-bundle/ndk-build
2 | arguments :
3 | NDK_PROJECT_PATH=null
4 | APP_BUILD_SCRIPT=/Users/vimfung/Documents/project/LuaScriptCore/Source/Android/luascriptcore/src/main/jni/Android.mk
5 | APP_ABI=armeabi-v7a
6 | NDK_ALL_ABIS=armeabi-v7a
7 | NDK_DEBUG=0
8 | APP_PLATFORM=android-13
9 | NDK_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/release/obj
10 | NDK_LIBS_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/release/lib
11 | APP_SHORT_COMMANDS=false
12 | LOCAL_SHORT_COMMANDS=false
13 | -B
14 | -n
15 | jvmArgs :
16 |
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/.externalNativeBuild/ndkBuild/release/armeabi/ndkBuild_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /Users/vimfung/Library/Android/sdk/ndk-bundle/ndk-build
2 | arguments :
3 | NDK_PROJECT_PATH=null
4 | APP_BUILD_SCRIPT=/Users/vimfung/Documents/project/LuaScriptCore/Source/Android/luascriptcore/src/main/jni/Android.mk
5 | APP_ABI=armeabi
6 | NDK_ALL_ABIS=armeabi
7 | NDK_DEBUG=0
8 | APP_PLATFORM=android-13
9 | NDK_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/release/obj
10 | NDK_LIBS_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/release/lib
11 | APP_SHORT_COMMANDS=false
12 | LOCAL_SHORT_COMMANDS=false
13 | -B
14 | -n
15 | jvmArgs :
16 |
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/.externalNativeBuild/ndkBuild/release/mips/ndkBuild_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /Users/vimfung/Library/Android/sdk/ndk-bundle/ndk-build
2 | arguments :
3 | NDK_PROJECT_PATH=null
4 | APP_BUILD_SCRIPT=/Users/vimfung/Documents/project/LuaScriptCore/Source/Android/luascriptcore/src/main/jni/Android.mk
5 | APP_ABI=mips
6 | NDK_ALL_ABIS=mips
7 | NDK_DEBUG=0
8 | APP_PLATFORM=android-13
9 | NDK_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/release/obj
10 | NDK_LIBS_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/release/lib
11 | APP_SHORT_COMMANDS=false
12 | LOCAL_SHORT_COMMANDS=false
13 | -B
14 | -n
15 | jvmArgs :
16 |
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/.externalNativeBuild/ndkBuild/release/mips64/ndkBuild_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /Users/vimfung/Library/Android/sdk/ndk-bundle/ndk-build
2 | arguments :
3 | NDK_PROJECT_PATH=null
4 | APP_BUILD_SCRIPT=/Users/vimfung/Documents/project/LuaScriptCore/Source/Android/luascriptcore/src/main/jni/Android.mk
5 | APP_ABI=mips64
6 | NDK_ALL_ABIS=mips64
7 | NDK_DEBUG=0
8 | APP_PLATFORM=android-21
9 | NDK_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/release/obj
10 | NDK_LIBS_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/release/lib
11 | APP_SHORT_COMMANDS=false
12 | LOCAL_SHORT_COMMANDS=false
13 | -B
14 | -n
15 | jvmArgs :
16 |
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/.externalNativeBuild/ndkBuild/release/x86/ndkBuild_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /Users/vimfung/Library/Android/sdk/ndk-bundle/ndk-build
2 | arguments :
3 | NDK_PROJECT_PATH=null
4 | APP_BUILD_SCRIPT=/Users/vimfung/Documents/project/LuaScriptCore/Source/Android/luascriptcore/src/main/jni/Android.mk
5 | APP_ABI=x86
6 | NDK_ALL_ABIS=x86
7 | NDK_DEBUG=0
8 | APP_PLATFORM=android-13
9 | NDK_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/release/obj
10 | NDK_LIBS_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/release/lib
11 | APP_SHORT_COMMANDS=false
12 | LOCAL_SHORT_COMMANDS=false
13 | -B
14 | -n
15 | jvmArgs :
16 |
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/.externalNativeBuild/ndkBuild/release/x86_64/ndkBuild_build_command.txt:
--------------------------------------------------------------------------------
1 | Executable : /Users/vimfung/Library/Android/sdk/ndk-bundle/ndk-build
2 | arguments :
3 | NDK_PROJECT_PATH=null
4 | APP_BUILD_SCRIPT=/Users/vimfung/Documents/project/LuaScriptCore/Source/Android/luascriptcore/src/main/jni/Android.mk
5 | APP_ABI=x86_64
6 | NDK_ALL_ABIS=x86_64
7 | NDK_DEBUG=0
8 | APP_PLATFORM=android-21
9 | NDK_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/release/obj
10 | NDK_LIBS_OUT=/Users/vimfung/Documents/project/LuaScriptCore/Sample/Android/app/build/intermediates/ndkBuild/release/lib
11 | APP_SHORT_COMMANDS=false
12 | LOCAL_SHORT_COMMANDS=false
13 | -B
14 | -n
15 | jvmArgs :
16 |
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Sample/Android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/vimfung/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Sample/Android/app/src/.DS_Store
--------------------------------------------------------------------------------
/Sample/Android/app/src/androidTest/java/cn/vimfung/luascriptcore/sample/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.sample;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/assets/defineProperty.lua:
--------------------------------------------------------------------------------
1 | Person.prototype.age = {
2 |
3 | get = function (self)
4 | print ("get age = ", self._age);
5 | return self._age;
6 | end,
7 | set = function (self, value)
8 | print ("set age = ", value);
9 | self._age = value;
10 | end
11 |
12 | };
13 |
14 | local p = Person(); p.age = 12; print (p.age);
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/assets/main.lua:
--------------------------------------------------------------------------------
1 | local json = require("dkjson");
2 |
3 | local tbl = getDeviceInfo();
4 |
5 | local str = json.encode (tbl, { indent = true });
6 |
7 | print (str)
8 |
9 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/assets/test.lua:
--------------------------------------------------------------------------------
1 | --
2 | -- Created by IntelliJ IDEA.
3 | -- User: vimfung
4 | -- Date: 2018/1/31
5 | -- Time: 上午9:27
6 | -- To change this template use File | Settings | File Templates.
7 | --
8 |
9 | for i = 1, 10 do
10 | print('-------- run', i);
11 | Person.action(TestObjectProxy.testObj("aaa"));
12 | end
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/assets/todo.lua:
--------------------------------------------------------------------------------
1 | function add (a, b)
2 |
3 | return a+b;
4 |
5 | end
6 |
7 | function makeList()
8 | -- body
9 | local list = {}
10 | for i=1,600 do
11 | local obj = {}
12 | obj.name = "test"
13 | table.insert(list, obj)
14 | end
15 |
16 | return list;
17 | end
18 |
19 | function getFunc()
20 |
21 | return function (a, b)
22 |
23 | print("------", a, b);
24 | return a * b;
25 |
26 | end
27 |
28 | end
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/java/cn/vimfung/luascriptcore/sample/Chinese.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.sample;
2 |
3 | import android.util.Log;
4 |
5 | /**
6 | * Created by vimfung on 17/1/19.
7 | */
8 | public class Chinese extends Person
9 | {
10 | public void speakChinese()
11 | {
12 | Log.v("lsc", "你好");
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/java/cn/vimfung/luascriptcore/sample/Console.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.sample;
2 |
3 | import android.util.Log;
4 | import cn.vimfung.luascriptcore.LuaExportType;
5 |
6 | /**
7 | * Created by vimfung on 17/1/23.
8 | */
9 |
10 | public class Console implements LuaExportType
11 | {
12 | public static void log (String msg)
13 | {
14 | Log.v("lsc", msg);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/java/cn/vimfung/luascriptcore/sample/English.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.sample;
2 |
3 | import android.util.Log;
4 |
5 | /**
6 | * Created by vimfung on 2017/5/17.
7 | */
8 |
9 | public class English extends Person
10 | {
11 | public void speakEnglish()
12 | {
13 | Log.v("lsc", "Hello");
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/java/cn/vimfung/luascriptcore/sample/Env.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.sample;
2 |
3 | import android.content.Context;
4 | import android.util.Log;
5 |
6 | import cn.vimfung.luascriptcore.LuaContext;
7 |
8 | /**
9 | * Created by vimfung on 2017/5/16.
10 | */
11 | public class Env
12 | {
13 | private static LuaContext _ctx = null;
14 |
15 | public static void setup(Context context)
16 | {
17 | _ctx = LuaContext.create(context);
18 | }
19 |
20 | public static LuaContext defaultContext ()
21 | {
22 | return _ctx;
23 | }
24 |
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/java/cn/vimfung/luascriptcore/sample/ErrLogModule.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.sample;
2 |
3 | import android.util.Log;
4 |
5 | public class ErrLogModule extends LogModule
6 | {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/java/cn/vimfung/luascriptcore/sample/LogModule.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.sample;
2 |
3 | import android.util.Log;
4 |
5 | import cn.vimfung.luascriptcore.LuaExclude;
6 | import cn.vimfung.luascriptcore.LuaExportType;
7 | import cn.vimfung.luascriptcore.LuaTuple;
8 |
9 | /**
10 | * 日志模块
11 | * Created by vimfung on 16/9/23.
12 | */
13 | public class LogModule implements LuaExportType
14 | {
15 | public static void writeLog(String message)
16 | {
17 | Log.v("luascriptcore", message);
18 | }
19 |
20 | public static LuaTuple test(String a, String b)
21 | {
22 | LuaTuple tuple = new LuaTuple();
23 | tuple.addReturnValue(a);
24 | tuple.addReturnValue(b);
25 |
26 | return tuple;
27 | }
28 |
29 | public static void testObj(Object obj)
30 | {
31 | Log.v("lsc", obj.toString());
32 | }
33 |
34 | public static Object createObj ()
35 | {
36 | return new Object();
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/java/cn/vimfung/luascriptcore/sample/NativeData.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.sample;
2 |
3 | import java.util.HashMap;
4 |
5 | import cn.vimfung.luascriptcore.LuaExportType;
6 | import cn.vimfung.luascriptcore.LuaExportTypeConfig;
7 |
8 | /**
9 | * Created by vimfung on 2017/4/17.
10 | */
11 | @LuaExportTypeConfig()
12 | public class NativeData implements LuaExportType
13 | {
14 | public String dataId;
15 |
16 | private HashMap _data = new HashMap();
17 |
18 | public static Person createPerson()
19 | {
20 | return new Person();
21 | }
22 |
23 | public void setData(String key, String value)
24 | {
25 | _data.put(key, value);
26 | }
27 |
28 | public String getData(String key)
29 | {
30 | return _data.get(key);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/java/cn/vimfung/luascriptcore/sample/TestObj.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.sample;
2 |
3 | /**
4 | * TestObj
5 | * Created by vimfung on 2018/1/31.
6 | */
7 | public class TestObj
8 | {
9 | private String name;
10 |
11 | public static TestObj create(String name)
12 | {
13 | return new TestObj().res(name);
14 | }
15 |
16 | private TestObj res(String name)
17 | {
18 | this.name = name;
19 | return this;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/java/cn/vimfung/luascriptcore/sample/TestObjectProxy.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.sample;
2 |
3 | import cn.vimfung.luascriptcore.LuaExportType;
4 |
5 | /**
6 | * TestObjectProxy
7 | * Created by vimfung on 2018/1/31.
8 | */
9 | public class TestObjectProxy implements LuaExportType
10 | {
11 | public static TestObj testObj(String name)
12 | {
13 | return TestObj.create(name);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/layout/activity_modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/layout/content_modules.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/layout/fragment_modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/layout/module_list_item_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/menu/menu_modules.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Sample/Android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Sample/Android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Sample/Android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Sample/Android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Sample/Android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 |
7 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Sample
3 | ModulesActivity
4 | Settings
5 |
6 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Sample/Android/app/src/test/java/cn/vimfung/luascriptcore/sample/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.sample;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/Sample/Android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | google()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.1.4'
10 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
11 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 |
19 | repositories {
20 | jcenter()
21 | google()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/Sample/Android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 | #android.useDeprecatedNdk=true
--------------------------------------------------------------------------------
/Sample/Android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Sample/Android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Sample/Android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu May 24 10:31:43 CST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/Sample/Android/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | #Tue Sep 13 21:03:26 CST 2016
11 | ndk.dir=/Users/vimfung/Library/Android/sdk/ndk-bundle
12 | sdk.dir=/Users/vimfung/Library/Android/sdk
--------------------------------------------------------------------------------
/Sample/Android/projectFilesBackup/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Sample/Android/projectFilesBackup/.DS_Store
--------------------------------------------------------------------------------
/Sample/Android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | include 'luascriptcore'
4 | project(':luascriptcore').projectDir = new File(settingsDir, '../../Source/Android/luascriptcore')
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Common/Env.h:
--------------------------------------------------------------------------------
1 | //
2 | // Env.h
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 2019/3/11.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LuaScriptCore.h"
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface Env : NSObject
15 |
16 | + (LSCContext *)defaultContext;
17 |
18 | + (LSCScriptController *)runScriptConfig;
19 |
20 | @end
21 |
22 | NS_ASSUME_NONNULL_END
23 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Common/Env.m:
--------------------------------------------------------------------------------
1 | //
2 | // Env.m
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 2019/3/11.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "Env.h"
10 |
11 | @implementation Env
12 |
13 | + (LSCContext *)defaultContext
14 | {
15 | static LSCContext *context = nil;
16 | static dispatch_once_t predicate;
17 |
18 | dispatch_once(&predicate, ^{
19 |
20 | context = [[LSCContext alloc] init];
21 | [context onException:^(NSString *message) {
22 |
23 | NSLog(@"exception = %@", message);
24 |
25 | }];
26 |
27 | });
28 |
29 | return context;
30 | }
31 |
32 | + (LSCScriptController *)runScriptConfig
33 | {
34 | static LSCScriptController *config = nil;
35 | static dispatch_once_t onceToken;
36 | dispatch_once(&onceToken, ^{
37 | config = [[LSCScriptController alloc] init];
38 | config.timeout = 5;
39 | });
40 |
41 | return config;
42 | }
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Common/LSCTNativeData.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTNativeData.h
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 2017/4/17.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LuaScriptCore.h"
11 |
12 | @interface LSCTNativeData : NSObject
13 |
14 | @property (nonatomic, copy) NSString *dataId;
15 |
16 | + (LSCTNativeData *)createData;
17 |
18 | - (void)setData:(NSString *)data key:(NSString *)key;
19 |
20 | - (NSString *)getData:(NSString *)key;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Common/LSCTNativeData.m:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTNativeData.m
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 2017/4/17.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCTNativeData.h"
10 |
11 | @interface LSCTNativeData ()
12 |
13 | @property (nonatomic, strong) NSMutableDictionary *dict;
14 |
15 | @end
16 |
17 | @implementation LSCTNativeData
18 |
19 | - (instancetype)init
20 | {
21 | if (self = [super init])
22 | {
23 | self.dict = [NSMutableDictionary dictionary];
24 | }
25 | return self;
26 | }
27 |
28 | + (LSCTNativeData *)createData
29 | {
30 | return [[LSCTNativeData alloc] init];
31 | }
32 |
33 | - (void)setData:(NSString *)data key:(NSString *)key
34 | {
35 | [self.dict setObject:data forKey:key];
36 | }
37 |
38 | - (NSString *)getData:(NSString *)key
39 | {
40 | return [self.dict objectForKey:key];
41 | }
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Common/LSCTPerson.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTPerson.h
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 16/9/22.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LuaScriptCore.h"
10 |
11 | @interface LSCTPerson : NSObject
12 |
13 | @property (nonatomic, copy) NSString *name;
14 |
15 | - (void)speak;
16 |
17 | - (void)walk;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Common/LSCTPerson.m:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTPerson.m
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 16/9/22.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCTPerson.h"
10 | #import "LSCValue.h"
11 | #import "LSCFunction.h"
12 | #import "Env.h"
13 |
14 | @interface LSCTPerson ()
15 |
16 | @property (nonatomic, strong) LSCFunction *_func;
17 |
18 | @end
19 |
20 | @implementation LSCTPerson
21 |
22 | - (void)speak
23 | {
24 | NSLog(@"%@ speak", self.name);
25 | }
26 |
27 | - (void)walk
28 | {
29 | NSLog(@"%@ walk", self.name);
30 | }
31 |
32 | + (LSCTPerson *)printPerson:(LSCTPerson *)p
33 | {
34 | NSLog(@"Person name = %@", p.name);
35 | return p;
36 | }
37 |
38 | + (LSCTPerson *)createPersonError
39 | {
40 | [Env.defaultContext raiseExceptionWithMessage:@"can't create person"];
41 | return [[LSCTPerson alloc] init];
42 | }
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Common/LogModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // LogModule.h
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 16/9/22.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LuaScriptCore.h"
10 |
11 | /**
12 | * 日志模块
13 | */
14 | @interface LogModule : NSObject
15 |
16 | /**
17 | * 写入日志
18 | *
19 | * @param message 日志信息
20 | */
21 | + (void)writeLog:(NSString *)message;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Common/LogModule.m:
--------------------------------------------------------------------------------
1 | //
2 | // LogModule.m
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 16/9/22.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LogModule.h"
10 |
11 | @implementation LogModule
12 |
13 | + (void)writeLog:(NSString *)message
14 | {
15 | NSLog(@"** message = %@", message);
16 | }
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/LuaScript/hello.lua:
--------------------------------------------------------------------------------
1 | url = "https://vimfung.github.io/LuaScriptCore/";
2 |
3 | local json = require("dkjson");
4 |
5 | local tbl = getDeviceInfo();
6 |
7 | local str = json.encode (tbl, { indent = true })
8 |
9 | print(url);
10 |
11 | print(str);
12 |
13 | function add (a, b)
14 |
15 | return a+b;
16 |
17 | end
18 |
19 | function printUrl(url)
20 |
21 | print (url);
22 |
23 | end
24 |
25 | function test()
26 |
27 | local value = 256;
28 | return value * 4, 1111, 'Hello';
29 |
30 | end
31 |
32 | return test();
33 |
34 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/LuaScript/main.lua:
--------------------------------------------------------------------------------
1 | local json = require("dkjson");
2 |
3 | local tbl = getDeviceInfo();
4 |
5 | local str = json.encode (tbl, { indent = true })
6 |
7 | print (str)
8 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/LuaScript/test.lua:
--------------------------------------------------------------------------------
1 | function LSCTPerson.prototype:destroy ()
2 |
3 | print("LSCTPerson destroy");
4 |
5 | end
6 |
7 | local person = LSCTPerson();
8 | person.name = "vimfung";
9 | person:walk();
10 | person:speak();
11 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/LuaScript/todo.lua:
--------------------------------------------------------------------------------
1 | function add (a, b)
2 |
3 | return a+b;
4 |
5 | end
6 |
7 | function makeList()
8 | -- body
9 | local list = {}
10 | for i=1,600 do
11 | local obj = {}
12 | obj.name = "test"
13 | table.insert(list, obj)
14 | end
15 | print("---------- ok")
16 |
17 | return list;
18 |
19 | end
20 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-OSX-Swift/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // Sample-OSX-Swift
4 | //
5 | // Created by 冯鸿杰 on 16/12/1.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | @NSApplicationMain
12 | class AppDelegate: NSObject, NSApplicationDelegate {
13 |
14 |
15 |
16 | func applicationDidFinishLaunching(_ aNotification: Notification) {
17 | // Insert code here to initialize your application
18 | }
19 |
20 | func applicationWillTerminate(_ aNotification: Notification) {
21 | // Insert code here to tear down your application
22 | }
23 |
24 |
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-OSX-Swift/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | Copyright © 2016年 vimfung. All rights reserved.
27 | NSMainStoryboardFile
28 | Main
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-OSX-Swift/LSCTNativeData.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTNativeData.swift
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 2017/4/17.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 | import LuaScriptCore_OSX_Swift
11 |
12 | @objc(LSCTNativeData)
13 | class LSCTNativeData: NSObject, LuaExportType
14 | {
15 | @objc var dataId : String? = nil;
16 |
17 | private var _data : Dictionary = Dictionary();
18 |
19 | @objc public class func createData () -> LSCTNativeData
20 | {
21 | return LSCTNativeData();
22 | }
23 |
24 | @objc public func setData(value : String, key : String) -> Void
25 | {
26 | _data[key] = value;
27 | }
28 |
29 | @objc public func getData(key : String) -> String
30 | {
31 | return _data[key]!;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-OSX-Swift/LSCTPerson.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTPerson.swift
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 16/12/1.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | import LuaScriptCore_OSX_Swift
10 |
11 | @objc(LSCTPerson)
12 | class LSCTPerson: NSObject, LuaExportType
13 | {
14 | @objc var name : String? = nil;
15 |
16 | @objc func speak() -> Void
17 | {
18 | NSLog("%@ speak", name ?? "noname");
19 | }
20 |
21 | @objc func walk() -> Void
22 | {
23 | NSLog("%@ walk", name ?? "noname");
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-OSX-Swift/LogModule.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LogModule.swift
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 16/12/1.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | import LuaScriptCore_OSX_Swift
10 |
11 | @objc(LogModule)
12 | class LogModule: NSObject, LuaExportType
13 | {
14 | @objc static func writeLog(message : String) -> Void
15 | {
16 | NSLog("** message = %@", message);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-OSX/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // Sample-OSX
4 | //
5 | // Created by vimfung on 16/8/22.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : NSObject
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-OSX/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // Sample-OSX
4 | //
5 | // Created by vimfung on 16/8/22.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
18 | // Insert code here to initialize your application
19 | }
20 |
21 | - (void)applicationWillTerminate:(NSNotification *)aNotification {
22 | // Insert code here to tear down your application
23 | }
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-OSX/ModulesViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ModulesViewController.h
3 | // Sample-OSX
4 | //
5 | // Created by 冯鸿杰 on 2018/8/21.
6 | // Copyright © 2018年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ModulesViewController : NSViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-OSX/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // Sample-OSX
4 | //
5 | // Created by vimfung on 16/8/22.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : NSViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-OSX/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // Sample-OSX
4 | //
5 | // Created by vimfung on 16/8/22.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | int main(int argc, const char * argv[]) {
12 | return NSApplicationMain(argc, argv);
13 | }
14 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS-Swift/LSCTNativeData.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTNativeData.swift
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 2017/4/17.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import LuaScriptCore_iOS_Swift
11 |
12 | @objc(LSCTNativeData)
13 | class LSCTNativeData: NSObject, LuaExportType
14 | {
15 | @objc var dataId : String? = nil;
16 |
17 | private var _data : Dictionary = Dictionary();
18 |
19 | @objc public class func createData () -> LSCTNativeData
20 | {
21 | return LSCTNativeData();
22 | }
23 |
24 | @objc public func setData(value : String, key : String) -> Void
25 | {
26 | _data[key] = value;
27 | }
28 |
29 | @objc public func getData(key : String) -> String
30 | {
31 | return _data[key]!;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS-Swift/LSCTPerson.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTPerson.swift
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 16/12/1.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | import LuaScriptCore_iOS_Swift
10 |
11 | @objc
12 | class LSCTPerson : NSObject, LuaExportType
13 | {
14 | var name : String? = nil;
15 |
16 | @objc func speak() -> Void
17 | {
18 | NSLog("%@ speak", name ?? "noname");
19 | }
20 |
21 | @objc func walk() -> Void
22 | {
23 | NSLog("%@ walk", name ?? "noname");
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS-Swift/LogModule.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LogModule.swift
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 16/12/1.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | import LuaScriptCore_iOS_Swift
10 |
11 | @objc(LogModule)
12 | class LogModule : NSObject, LuaExportType
13 | {
14 | @objc static func writeLog(message : String) -> Void
15 | {
16 | NSLog("** message = %@", message);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS-Swift/ModuleListViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ModuleListViewController.swift
3 | // Sample-iOS-Swift
4 | //
5 | // Created by 冯鸿杰 on 2018/8/21.
6 | // Copyright © 2018年 vimfung. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ModuleListViewController: UITableViewController
12 | {
13 | @IBAction func close(_ sender: Any)
14 | {
15 | dismiss(animated: true, completion: nil);
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS-Swift/ModuleViewControllers/ThreadModuleViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ThreadModuleViewController.swift
3 | // Sample-iOS-Swift
4 | //
5 | // Created by 冯鸿杰 on 2019/1/2.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import LuaScriptCore_iOS_Swift
11 |
12 | class ThreadModuleViewController: UITableViewController {
13 |
14 | let context : LuaContext = LuaContext();
15 |
16 | override func viewDidLoad() {
17 | super.viewDidLoad()
18 |
19 | context.onException { (msg) in
20 | print("lua exception = \(msg!)");
21 | }
22 |
23 | _ = context.evalScript(filePath: "Thread-Sample.lua");
24 | }
25 |
26 | override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
27 |
28 | switch indexPath.row
29 | {
30 | case 0:
31 | _ = context.evalScript(script: "Thread_Sample_run()");
32 | case 1:
33 | _ = context.evalScript(script: "Thread_Sample_stop()");
34 | default:
35 | break;
36 | }
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Sample/iOS_OSX/Sample-iOS/.DS_Store
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // Sample
4 | //
5 | // Created by vimfung on 16/7/15.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS/ModuleListViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ModuleListViewController.h
3 | // Sample-iOS
4 | //
5 | // Created by 冯鸿杰 on 2018/8/21.
6 | // Copyright © 2018年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ModuleListViewController : UITableViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS/ModuleListViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ModuleListViewController.m
3 | // Sample-iOS
4 | //
5 | // Created by 冯鸿杰 on 2018/8/21.
6 | // Copyright © 2018年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "ModuleListViewController.h"
10 |
11 | @implementation ModuleListViewController
12 |
13 | - (IBAction)closeHandler:(id)sender
14 | {
15 | [self dismissViewControllerAnimated:YES completion:nil];
16 | }
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS/ModuleViewControllers/CryptoModuleViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CryptoModuleViewController.h
3 | // Sample-iOS
4 | //
5 | // Created by 冯鸿杰 on 2019/6/16.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface CryptoModuleViewController : UITableViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS/ModuleViewControllers/EncodingModuleViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // EncodingModuleViewController.h
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 2018/8/21.
6 | // Copyright © 2018年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface EncodingModuleViewController : UITableViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS/ModuleViewControllers/HttpModuleViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // HttpModuleViewController.h
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 2018/8/20.
6 | // Copyright © 2018年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface HttpModuleViewController : UITableViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS/ModuleViewControllers/PathModuleViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // PathModuleViewController.h
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 2018/8/21.
6 | // Copyright © 2018年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface PathModuleViewController : UITableViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS/ModuleViewControllers/ThreadModuleViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ThreadModuleViewController.h
3 | // Sample
4 | //
5 | // Created by 冯鸿杰 on 2019/1/1.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface ThreadModuleViewController : UITableViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // Sample
4 | //
5 | // Created by vimfung on 16/7/15.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample-iOS/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // Sample
4 | //
5 | // Created by vimfung on 16/7/15.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Sample/iOS_OSX/Sample.xcodeproj/xcuserdata/vimfung.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Source/Android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/Source/Android/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Source/Android/Android.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Source/Android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | google()
6 | jcenter()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.2.1'
10 | classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
11 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 |
20 | repositories {
21 | google()
22 | jcenter()
23 | }
24 | }
25 |
26 | task clean(type: Delete) {
27 | delete rootProject.buildDir
28 | }
29 |
--------------------------------------------------------------------------------
/Source/Android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 | # android.useDeprecatedNdk=true
--------------------------------------------------------------------------------
/Source/Android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Source/Android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Aug 08 09:57:22 CST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
7 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/build.gradle:
--------------------------------------------------------------------------------
1 | apply from: './compile.gradle'
2 | //apply from: './compile-5.1.5.gradle' //lua 5.1.5 版本
3 |
4 | android {
5 | buildToolsVersion '28.0.3'
6 | }
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/vimfung/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/androidTest/java/cn/vimfung/luascriptcore/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/java/cn/vimfung/luascriptcore/LuaBaseObject.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | /**
4 | * 基础类型
5 | * Created by vimfung on 16/8/29.
6 | */
7 | public class LuaBaseObject
8 | {
9 | /**
10 | * 本地标识
11 | */
12 | protected int _nativeId;
13 |
14 | /**
15 | * 创建基础对象
16 | */
17 | public LuaBaseObject ()
18 | {
19 | _nativeId = 0;
20 | }
21 |
22 | /**
23 | * 创建基础对象
24 | * @param nativeId 本地标识
25 | */
26 | protected LuaBaseObject(int nativeId)
27 | {
28 | _nativeId = nativeId;
29 | }
30 |
31 | @Override
32 | protected void finalize() throws Throwable
33 | {
34 | if (_nativeId > 0)
35 | {
36 | //释放本地对象
37 | LuaNativeUtil.releaseNativeObject(_nativeId);
38 | }
39 | super.finalize();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/java/cn/vimfung/luascriptcore/LuaEnv.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 |
6 | /**
7 | * 环境信息
8 | */
9 | public final class LuaEnv
10 | {
11 | /**
12 | * 共享环境对象
13 | */
14 | @SuppressLint("StaticFieldLeak")
15 | private static final LuaEnv _env = new LuaEnv();
16 | public static LuaEnv defaultEnv ()
17 | {
18 | return _env;
19 | }
20 |
21 | /**
22 | * Android应用上下文
23 | */
24 | private Context _androidApplicationContext = null;
25 |
26 | /**
27 | * 设置Android应用上下文
28 | * @param context 上下文
29 | */
30 | public void setAndroidApplicationContext(Context context)
31 | {
32 | _androidApplicationContext = context.getApplicationContext();
33 | }
34 |
35 | /**
36 | * 获取Android应用上下文
37 | * @return 上下文
38 | */
39 | public Context getAndroidApplicationContext()
40 | {
41 | return _androidApplicationContext;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/java/cn/vimfung/luascriptcore/LuaExceptionHandler.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | /**
4 | * Lua异常处理器
5 | */
6 | public interface LuaExceptionHandler
7 | {
8 | /**
9 | * 发生异常是触发
10 | * @param message 错误信息
11 | */
12 | public void onException(String message);
13 | }
14 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/java/cn/vimfung/luascriptcore/LuaExclude.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | import java.lang.annotation.Inherited;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 |
7 | @Inherited
8 | @Retention(RetentionPolicy.RUNTIME)
9 | public @interface LuaExclude
10 | {
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/java/cn/vimfung/luascriptcore/LuaExportType.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | /**
4 | * 导出类型
5 | * Created by vimfung on 2017/9/16.
6 | */
7 | public interface LuaExportType
8 | {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/java/cn/vimfung/luascriptcore/LuaExportTypeConfig.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Inherited;
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 | import java.lang.annotation.Target;
8 |
9 | /**
10 | * 导出类型配置
11 | * Created by vimfung on 2017/11/15.
12 | */
13 | @Retention(RetentionPolicy.RUNTIME)
14 | @Target(ElementType.TYPE)
15 | @Deprecated
16 | public @interface LuaExportTypeConfig
17 | {
18 | /**
19 | * 排除的导出类方法名称列表
20 | *
21 | * @return 排除的导出类方法名称列表
22 | */
23 | public String[] excludeExportClassMethodNames() default {};
24 |
25 | /**
26 | * 排除的导出实例方法名称列表
27 | *
28 | * @return 排除的导出实例方法名称列表
29 | */
30 | public String[] excludeExportInstanceMethodsNames() default {};
31 |
32 | /**
33 | * 排除的导出属性名称列表
34 | *
35 | * @return 排除的导出属性名称列表
36 | */
37 | public String[] excludeExportFieldNames() default {};
38 | }
39 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/java/cn/vimfung/luascriptcore/LuaFunction.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | /**
4 | * Lua方法对象
5 | * Created by vimfung on 16/11/1.
6 | */
7 | public class LuaFunction extends LuaBaseObject
8 | {
9 | private LuaContext _context;
10 |
11 | /**
12 | * 创建方法对象
13 | * @param nativeId 本地对象标识
14 | * @param context 上下文对象
15 | */
16 | protected LuaFunction(int nativeId, LuaContext context)
17 | {
18 | super(nativeId);
19 | _context = context;
20 | }
21 |
22 | /**
23 | * 调用方法
24 | * @param arguments 参数列表
25 | * @return 返回值
26 | */
27 | public LuaValue invoke(LuaValue[] arguments)
28 | {
29 | return invoke(arguments, null);
30 | }
31 |
32 | public LuaValue invoke(LuaValue[] arguments, LuaScriptController scriptController)
33 | {
34 | return LuaNativeUtil.invokeFunction(_context, this, arguments, scriptController);
35 | }
36 |
37 | /**
38 | * 获取上下文对象
39 | * @return 上下文对象
40 | */
41 | public LuaContext getContext()
42 | {
43 | return _context;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/java/cn/vimfung/luascriptcore/LuaManagedValue.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | import android.util.Log;
4 |
5 | /**
6 | * 管理值对象,用于将LuaValue的值所指向的Lua对象生命周期维持在LuaManagedValue释放后进行。
7 | * Created by vimfung on 2017/5/24.
8 | */
9 | public class LuaManagedValue extends LuaBaseObject
10 | {
11 | private LuaValue _source;
12 | private LuaContext _context;
13 |
14 | /**
15 | * 初始化对象
16 | * @param value 原始值对象
17 | * @param context 上下文对象
18 | */
19 | public LuaManagedValue(LuaValue value, LuaContext context)
20 | {
21 | _source = value;
22 | _context = context;
23 |
24 | context.retainValue(_source);
25 | }
26 |
27 | /**
28 | * 获取源值
29 | * @return 值对象
30 | */
31 | public LuaValue getSource()
32 | {
33 | return _source;
34 | }
35 |
36 | @Override
37 | protected void finalize() throws Throwable
38 | {
39 | _context.releaseValue(_source);
40 | super.finalize();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/java/cn/vimfung/luascriptcore/LuaMethodHandler.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | import java.util.ArrayList;
4 |
5 | /**
6 | * 方法处理器
7 | * Created by vimfung on 16/9/11.
8 | */
9 | public interface LuaMethodHandler
10 | {
11 | /**
12 | * 执行方法时调用
13 | * @param arguments 传入参数
14 | * @return 返回值
15 | */
16 | public LuaValue onExecute(LuaValue[] arguments);
17 | }
18 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/java/cn/vimfung/luascriptcore/LuaPointer.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | /**
4 | * Created by vimfung on 16/10/31.
5 | *
6 | * Lua的指针类型
7 | */
8 | public class LuaPointer extends LuaBaseObject
9 | {
10 | /**
11 | * 创建指针对象
12 | * @param nativeId 本地对象标识
13 | */
14 | protected LuaPointer(int nativeId)
15 | {
16 | super(nativeId);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/java/cn/vimfung/luascriptcore/LuaScriptController.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | /**
4 | * 脚本控制器
5 | */
6 | public class LuaScriptController extends LuaBaseObject
7 | {
8 | /**
9 | * 创建上下文对象
10 | * @param nativeId 本地对象标识
11 | */
12 | protected LuaScriptController(int nativeId)
13 | {
14 | super(nativeId);
15 | }
16 |
17 | /**
18 | * 创建脚本控制器
19 | * @return 脚本控制器对象
20 | */
21 | public static LuaScriptController create()
22 | {
23 | return LuaNativeUtil.createScriptController();
24 | }
25 |
26 | /**
27 | * 设置脚本执行超时时间,如果脚本执行时间大于设置时间则会强制中断脚本,默认为0,
28 | */
29 | public void setTimeout(int timeout)
30 | {
31 | LuaNativeUtil.scriptControllerSetTimeout(this, timeout);
32 | }
33 |
34 | /**
35 | * 强制退出执行脚本
36 | */
37 | public void forceExit()
38 | {
39 | LuaNativeUtil.scriptControllerForceExit(this);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/java/cn/vimfung/luascriptcore/LuaTuple.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | import java.util.ArrayList;
4 |
5 | /**
6 | * Created by vimfung on 17/1/19.
7 | * 元组,用于多个返回值的返回时使用
8 | */
9 | public class LuaTuple extends LuaBaseObject
10 | {
11 | private ArrayList _returnValues;
12 |
13 | public LuaTuple ()
14 | {
15 | _returnValues = new ArrayList();
16 | }
17 |
18 | /**
19 | * 元素数量
20 | * @return 数量
21 | */
22 | public int count()
23 | {
24 | return _returnValues.size();
25 | }
26 |
27 | /**
28 | * 添加返回值
29 | * @param value 返回值
30 | */
31 | public void addReturnValue(Object value)
32 | {
33 | _returnValues.add(new LuaValue(value));
34 | }
35 |
36 | /**
37 | * 获取返回值
38 | * @param index 返回值索引
39 | * @return 返回值
40 | */
41 | public Object getReturnValueByIndex(int index)
42 | {
43 | return _returnValues.get(index).toObject();
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/java/cn/vimfung/luascriptcore/LuaValueType.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | /**
4 | * LuaValue的类型
5 | */
6 | public enum LuaValueType
7 | {
8 | Nil (0), //空值
9 | Number (1), //数值
10 | Boolean (2), //布尔
11 | String (3), //字符串
12 | Array (4), //数组
13 | Map (5), //字典
14 | Pointer (6), //指针
15 | Object (7), //对象
16 | Integer (8), //整型
17 | Data (9), //二进制数组
18 | Function (10), //方法
19 | Tuple(11); //元组,用于返回值
20 |
21 | private int _value;
22 |
23 | LuaValueType(int i)
24 | {
25 | _value = i;
26 | }
27 |
28 | public int value()
29 | {
30 | return _value;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/jni/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Android/luascriptcore/src/main/jni/.DS_Store
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/jni/LuaDefine.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by vimfung on 16/8/25.
3 | //
4 |
5 | #ifndef SAMPLE_LUADEFINE_H
6 | #define SAMPLE_LUADEFINE_H
7 |
8 | #include
9 |
10 | #define LOG_TAG "native-dev"
11 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
12 | #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
13 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
14 | #define LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
15 |
16 | #endif //SAMPLE_LUADEFINE_H
17 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/jni/LuaJavaExceptionHandler.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by 冯鸿杰 on 17/1/13.
3 | //
4 |
5 | #include "LuaJavaExceptionHandler.h"
6 | #include "LuaJavaEnv.h"
7 |
8 | LuaJavaExceptionHandler::LuaJavaExceptionHandler(JNIEnv *env, jobject jcontext)
9 | : _jcontext(env -> NewWeakGlobalRef(jcontext))
10 | {
11 |
12 | }
13 |
14 | LuaJavaExceptionHandler::~LuaJavaExceptionHandler()
15 | {
16 | JNIEnv *env = LuaJavaEnv::getEnv();
17 |
18 | env -> DeleteWeakGlobalRef(_jcontext);
19 |
20 | LuaJavaEnv::resetEnv(env);
21 | }
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/jni/LuaJavaExceptionHandler.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by 冯鸿杰 on 17/1/13.
3 | //
4 |
5 | #ifndef ANDROID_LUAJAVAEXCEPTIONHANDLER_H
6 | #define ANDROID_LUAJAVAEXCEPTIONHANDLER_H
7 |
8 | #include
9 |
10 | /**
11 | * Java异常处理器
12 | */
13 | class LuaJavaExceptionHandler
14 | {
15 | private:
16 | jobject _jcontext;
17 |
18 | public:
19 | LuaJavaExceptionHandler(JNIEnv *env, jobject jcontext);
20 | virtual ~LuaJavaExceptionHandler();
21 | };
22 |
23 |
24 | #endif //ANDROID_LUAJAVAEXCEPTIONHANDLER_H
25 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/jni/LuaJavaObjectDescriptor.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by 冯鸿杰 on 16/10/31.
3 | //
4 |
5 | #include "LuaJavaObjectDescriptor.h"
6 | #include "LuaExportTypeDescriptor.hpp"
7 | #include "LuaJavaEnv.h"
8 | #include "LuaDefine.h"
9 | #include "LuaJavaType.h"
10 | #include "LuaPointer.h"
11 | #include "lua.hpp"
12 |
13 | LuaJavaObjectDescriptor::LuaJavaObjectDescriptor(LuaContext *context, JNIEnv *env, jobject object)
14 | : LuaObjectDescriptor(context, (void *)(env -> NewGlobalRef(object)))
15 | {
16 |
17 | }
18 |
19 | LuaJavaObjectDescriptor::LuaJavaObjectDescriptor(LuaContext *context, JNIEnv *env, jobject object, LuaExportTypeDescriptor *typeDescriptor)
20 | : LuaObjectDescriptor(context, (void *)(env -> NewGlobalRef(object)), typeDescriptor)
21 | {
22 |
23 | }
24 |
25 | LuaJavaObjectDescriptor::~LuaJavaObjectDescriptor()
26 | {
27 | JNIEnv *env = LuaJavaEnv::getEnv();
28 | //移除引用
29 | env -> DeleteGlobalRef((jobject)getObject());
30 | LuaJavaEnv::resetEnv(env);
31 | }
32 |
33 | jobject LuaJavaObjectDescriptor::getJavaObject()
34 | {
35 | return (jobject)getObject();
36 | }
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | LuaScriptCore
3 |
4 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/test/java/cn/vimfung/luascriptcore/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore;
2 |
3 | import android.app.Application;
4 | import android.test.mock.MockContext;
5 |
6 | import org.junit.Test;
7 |
8 | import cn.vimfung.luascriptcore.test.Env;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
14 | */
15 | public class ExampleUnitTest {
16 |
17 | @Test
18 | public void addition_isCorrect() throws Exception {
19 | assertEquals(4, 2 + 2);
20 | }
21 | }
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/test/java/cn/vimfung/luascriptcore/test/Env.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.test;
2 |
3 | import android.test.mock.MockContext;
4 |
5 | import cn.vimfung.luascriptcore.LuaContext;
6 |
7 | /**
8 | * Created by vimfung on 2018/4/27.
9 | */
10 |
11 | public class Env
12 | {
13 | private static Env _instance = new Env();
14 | public static Env sharedInstance ()
15 | {
16 | return _instance;
17 | }
18 |
19 | private LuaContext _context;
20 | private MockContext _mockContext;
21 |
22 | private Env()
23 | {
24 | _mockContext = new MockContext();
25 | _context = LuaContext.create(_mockContext);
26 | }
27 |
28 | public LuaContext getContext()
29 | {
30 | return _context;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Source/Android/luascriptcore/src/test/java/cn/vimfung/luascriptcore/test/Person.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.test;
2 |
3 | import cn.vimfung.luascriptcore.LuaExportType;
4 |
5 | /**
6 | * Created by vimfung on 2018/4/27.
7 | */
8 |
9 | public class Person implements LuaExportType
10 | {
11 | public Person ()
12 | {
13 | Env.sharedInstance().getContext().raiseException("can't create context");
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Source/Android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':luascriptcore'
2 |
--------------------------------------------------------------------------------
/Source/Unity3D/Android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/Android/Android.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Source/Unity3D/Android/LuaScriptCore.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Source/Unity3D/Android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | google()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.0.1'
10 |
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 |
18 | repositories {
19 | jcenter()
20 | google()
21 | }
22 | }
23 |
24 | task clean(type: Delete) {
25 | delete rootProject.buildDir
26 | }
27 |
--------------------------------------------------------------------------------
/Source/Unity3D/Android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 | #android.useDeprecatedNdk=true
19 |
--------------------------------------------------------------------------------
/Source/Unity3D/Android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/Android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Source/Unity3D/Android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/Source/Unity3D/Android/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | #Tue Nov 15 11:20:39 CST 2016
11 | ndk.dir=/Users/vimfung/Library/Android/sdk/ndk-bundle
12 | sdk.dir=/Users/vimfung/Library/Android/sdk
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/Android/luascriptcore-unity-android/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Source/Unity3D/Android/luascriptcore-unity-android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/vimfung/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/Source/Unity3D/Android/luascriptcore-unity-android/src/androidTest/java/cn/vimfung/luascriptcore/unity/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.unity;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("cn.vimfung.luascriptcore.unity.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Source/Unity3D/Android/luascriptcore-unity-android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/Android/luascriptcore-unity-android/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | LuaScriptCore-Unity-Android
3 |
4 |
--------------------------------------------------------------------------------
/Source/Unity3D/Android/luascriptcore-unity-android/src/test/java/cn/vimfung/luascriptcore/unity/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package cn.vimfung.luascriptcore.unity;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/Source/Unity3D/Android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':luascriptcore-unity-android'
2 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 260af4faaeaaa4450b8ad43834905494
3 | folderAsset: yes
4 | timeCreated: 1478844238
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/ILuaObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace cn.vimfung.luascriptcore
4 | {
5 | ///
6 | /// Lua对象接口,需要返回给Lua层的对象可以使用该协议转换为Lua层能识别的对象
7 | ///
8 | public interface ILuaObject
9 | {
10 | LuaObjectDescriptor getDescriptor();
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/ILuaObject.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 02f7d893991d344c999b847838188dac
3 | timeCreated: 1487840503
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaBaseObject.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 099ce16d97cd140e79708bf4fc3ecb3c
3 | timeCreated: 1478846381
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaContext.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2238ee37dbc1e4b9b81f70c4f4cd9ae8
3 | timeCreated: 1478846295
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaExclude.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace cn.vimfung.luascriptcore
4 | {
5 | ///
6 | /// 用于排除C#类型导出到Lua的属性、方法
7 | ///
8 | [AttributeUsage(AttributeTargets.All)]
9 | public class LuaExclude : Attribute
10 | {
11 |
12 | }
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaExclude.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e9ae0cd2fb98b4ab8b792c07906b25fc
3 | timeCreated: 1533352880
4 | licenseType: Free
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaExportType.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace cn.vimfung.luascriptcore
4 | {
5 | ///
6 | /// 导出类型
7 | ///
8 | public interface LuaExportType
9 | {
10 |
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaExportType.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4c0d547f526ab4d92a5abe345c5ac99e
3 | timeCreated: 1509967135
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaExportTypeAnnotation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace cn.vimfung.luascriptcore
4 | {
5 | [Obsolete("Use LuaExclude attribute instead.")]
6 | [AttributeUsage(AttributeTargets.Class)]
7 | public class LuaExportTypeAnnotation : Attribute
8 | {
9 |
10 | ///
11 | /// 获取/设置排除导出导出类方法名称列表
12 | ///
13 | /// 排除导出导出类方法名称列表.
14 | public string[] excludeExportClassMethodNames
15 | {
16 | get;
17 | set;
18 | }
19 |
20 | ///
21 | /// 获取/设置排除导出实例方法名称列表
22 | ///
23 | /// 排除导出实例方法名称列表.
24 | public string[] excludeExportInstanceMethodNames
25 | {
26 | get;
27 | set;
28 | }
29 |
30 | ///
31 | /// 获取/设置排除导出属性名称列表
32 | ///
33 | /// 排除导出属性名称列表.
34 | public string[] excludeExportPropertyNames
35 | {
36 | get;
37 | set;
38 | }
39 | }
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaExportTypeAnnotation.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6f87f7f6224d5452a99a2410e2415a88
3 | timeCreated: 1512110556
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaExportsTypeManager.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8a0eca05c79c04a709f88f93e254557d
3 | timeCreated: 1509967135
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaFunction.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e66c82f4dcb81499d9423b5e977ab8a3
3 | timeCreated: 1488423582
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaManagedValue.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace cn.vimfung.luascriptcore
4 | {
5 | public class LuaManagedValue : LuaBaseObject
6 | {
7 | private LuaValue _source;
8 | private LuaContext _context;
9 |
10 | public LuaManagedValue (LuaValue value, LuaContext context)
11 | {
12 | _source = value;
13 | _context = context;
14 |
15 | _context.retainValue (_source);
16 | }
17 |
18 | ~LuaManagedValue ()
19 | {
20 | if (_context != null && _source != null)
21 | {
22 | _context.releaseValue (_source);
23 | }
24 | }
25 |
26 | ///
27 | /// 获取源数据
28 | ///
29 | /// 数据对象.
30 | public LuaValue source
31 | {
32 | get
33 | {
34 | return _source;
35 | }
36 | }
37 | }
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaManagedValue.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: be9d5269696fb4a62be0c470b5bf261c
3 | timeCreated: 1495616278
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaObjectDecoder.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 940684a87259a48d59292e2d889f72c8
3 | timeCreated: 1479199000
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaObjectDescriptor.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0a5939c7e1d5f4998b1fc76080389455
3 | timeCreated: 1487835945
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaObjectEncoder.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 278db5871c1314d4ca45944784b6bb5f
3 | timeCreated: 1479368143
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaObjectReference.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b895bfc19cc14414bbf286705f73962c
3 | timeCreated: 1488791187
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaPointer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace cn.vimfung.luascriptcore
5 | {
6 | ///
7 | /// Lua的指针类型
8 | ///
9 | public class LuaPointer : LuaBaseObject
10 | {
11 | public LuaPointer (object obj)
12 | {
13 | if (obj != null)
14 | {
15 | _objReference = new LuaObjectReference (obj);
16 | }
17 | }
18 |
19 | private LuaObjectReference _objReference = null;
20 |
21 | ///
22 | /// 初始化
23 | ///
24 | /// 对象解码器
25 | public LuaPointer (LuaObjectDecoder decoder)
26 | : base(decoder)
27 | {
28 | Int64 objRefId = decoder.readInt64 ();
29 | _objReference = LuaObjectReference.findObject (objRefId);
30 | luaObjectId = decoder.readString ();
31 | }
32 |
33 | ///
34 | /// 序列化对象
35 | ///
36 | /// 对象编码器.
37 | public override void serialization(LuaObjectEncoder encoder)
38 | {
39 | base.serialization (encoder);
40 | encoder.writeInt64 (_objReference.referenceId);
41 | encoder.writeString (luaObjectId);
42 | }
43 | }
44 |
45 |
46 | }
47 |
48 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaPointer.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e65016ff951d84eeda7e67789d97fab2
3 | timeCreated: 1488506296
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaScriptController.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 |
5 | namespace cn.vimfung.luascriptcore
6 | {
7 | ///
8 | /// 脚本控制器
9 | ///
10 | public class LuaScriptController : LuaBaseObject
11 | {
12 | ///
13 | /// 初始化
14 | ///
15 | public LuaScriptController()
16 | {
17 | _nativeObjectId = NativeUtils.createLuaScriptController ();
18 | }
19 |
20 | ///
21 | /// 设置脚本执行超时时间
22 | ///
23 | /// 单位:秒,设置0表示没有时间限制
24 | public void setTimeout(int timeout)
25 | {
26 | NativeUtils.scriptControllerSetTimeout (_nativeObjectId, timeout);
27 | }
28 |
29 | ///
30 | /// 强制退出执行脚本
31 | ///
32 | public void forceExit()
33 | {
34 | NativeUtils.scriptControllerForceExit (_nativeObjectId);
35 | }
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaTuple.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: baa24c50e30214a13a7e6b1daf6a6dc5
3 | timeCreated: 1488522024
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/LuaValue.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b311f1b7d549045d5b03dea8cf9e7d95
3 | timeCreated: 1479203936
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/NativeUtils.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3fc89f474df0a4810b928415b8c17127
3 | timeCreated: 1478846044
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Plugins/LuaScriptCore/UNIEnv.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 01dfde3e590194c1d9c06cf6ccbf8704
3 | timeCreated: 1487666170
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scenes.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 49b4f34a96f0e4459a58f4307e927bd7
3 | folderAsset: yes
4 | timeCreated: 1479972867
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scenes/ModulesScene.unity:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/Assets/Scenes/ModulesScene.unity
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scenes/ModulesScene.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5064f7470d20f442c92d568cc900dc81
3 | timeCreated: 1540525845
4 | licenseType: Free
5 | DefaultImporter:
6 | externalObjects: {}
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scenes/Scene1.unity:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/Assets/Scenes/Scene1.unity
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scenes/Scene1.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: cc408be3bf0d24a379c637862b4324b9
3 | timeCreated: 1479972867
4 | licenseType: Pro
5 | DefaultImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scenes/Scene2.unity:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/Assets/Scenes/Scene2.unity
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scenes/Scene2.unity.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 19c38f61422614480a7d601795b4bfc1
3 | timeCreated: 1479973112
4 | licenseType: Pro
5 | DefaultImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scripts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e182f3358a03a469597dba7666d05f66
3 | folderAsset: yes
4 | timeCreated: 1478846626
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scripts/Chinese.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace AssemblyCSharp
4 | {
5 | public class Chinese : Person
6 | {
7 | public Chinese ()
8 | {
9 |
10 | }
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scripts/Chinese.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 83325e65861854f19b02f8e800bc2cf6
3 | timeCreated: 1510657222
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scripts/LogModule.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using System.Collections;
3 | using cn.vimfung.luascriptcore;
4 | using System;
5 | using System.Collections.Generic;
6 |
7 | public class LogModule : LuaExportType
8 | {
9 | [LuaExclude]
10 | public static void writeLog(String message)
11 | {
12 | Debug.LogFormat ("string log = {0}", message);
13 | }
14 |
15 | public static void writeLog(int value)
16 | {
17 | Debug.LogFormat ("int log = {0}", value);
18 | }
19 |
20 | public static double test(UInt64[] a)
21 | {
22 | Debug.Log (a.ToString ());
23 |
24 | return 1024.05;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scripts/LogModule.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5c43ffaecd3cc4b19b27a28aa010905d
3 | timeCreated: 1482474921
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scripts/ModuleItemCell.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 | using UnityEngine.UI;
5 | using System;
6 |
7 | public class ModuleItemCell : MonoBehaviour
8 | {
9 | public Text titleLabel;
10 | public Action itemClickHandler;
11 |
12 | public void clickHandler ()
13 | {
14 | if (itemClickHandler != null)
15 | {
16 | itemClickHandler ();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scripts/ModuleItemCell.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 27f7357fec5514ef69dcad1d690a2ab6
3 | timeCreated: 1540778587
4 | licenseType: Free
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scripts/ModulesSceneController.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d1b8c9e7e60f34595a4cc3b2921eed1b
3 | timeCreated: 1540526127
4 | licenseType: Free
5 | MonoImporter:
6 | externalObjects: {}
7 | serializedVersion: 2
8 | defaultReferences: []
9 | executionOrder: 0
10 | icon: {instanceID: 0}
11 | userData:
12 | assetBundleName:
13 | assetBundleVariant:
14 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scripts/NativeData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using cn.vimfung.luascriptcore;
3 |
4 | [LuaExportTypeAnnotation()]
5 | public class NativeData : LuaExportType
6 | {
7 | public NativeData ()
8 | {
9 | }
10 |
11 | private string _dataId;
12 |
13 | public string dataId
14 | {
15 | get
16 | {
17 | return _dataId;
18 | }
19 | set
20 | {
21 | _dataId = value;
22 | }
23 | }
24 |
25 | public static Person createPerson()
26 | {
27 | return new Person ();
28 | }
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scripts/NativeData.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d6a76d81a7ffc4afab870332898c86a8
3 | timeCreated: 1492484223
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scripts/Person.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0c9ddc293a0ca4e03b621740ad15f855
3 | timeCreated: 1485168423
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/Scripts/Sample.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 799917a75268246aea271b94a9575c63
3 | timeCreated: 1479971672
4 | licenseType: Pro
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/StreamingAssets.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 173ec989125a843c38a0e18c6a30c678
3 | folderAsset: yes
4 | timeCreated: 1479349407
5 | licenseType: Pro
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/StreamingAssets/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/Assets/StreamingAssets/.DS_Store
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/StreamingAssets/coroutine.lua.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c91c1ab560aa84fe496d77c6bad5f7d6
3 | timeCreated: 1499252478
4 | licenseType: Free
5 | DefaultImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/StreamingAssets/defineProperty.lua:
--------------------------------------------------------------------------------
1 | Person.prototype.age = {
2 |
3 | get = function (self)
4 | print("get age = ", self._age);
5 | return self._age;
6 | end,
7 | set = function (self, value)
8 | print("set age = ", value);
9 | self._age = value;
10 | end
11 |
12 | };
13 |
14 | local p = Person(); p.age = 12; print (p.age);
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/StreamingAssets/defineProperty.lua.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ce2535022aede41e6a38f1d39e78544e
3 | timeCreated: 1479977050
4 | licenseType: Pro
5 | DefaultImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/StreamingAssets/dkjson.lua.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 5ce95d1dfa52343ea8cf657ca2a1bbd4
3 | timeCreated: 1479975834
4 | licenseType: Pro
5 | DefaultImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/StreamingAssets/main.lua:
--------------------------------------------------------------------------------
1 | local json = require("dkjson");
2 |
3 | local tbl = getDeviceInfo({1,2,3,4});
4 |
5 | local str = json.encode (tbl, { indent = true })
6 |
7 | print (str)
8 |
9 | print (testReturnTuple());
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/StreamingAssets/main.lua.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 70c9741038b584dab84081bd3518e833
3 | timeCreated: 1479349534
4 | licenseType: Pro
5 | DefaultImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/StreamingAssets/todo.lua:
--------------------------------------------------------------------------------
1 | function add (a, b)
2 |
3 | return a+b;
4 |
5 | end
6 |
7 | function getFunc()
8 |
9 | return function (a, b)
10 |
11 | return a * b;
12 |
13 | end
14 |
15 | end
16 |
17 | function printPointer(p)
18 | print(p);
19 | end
20 |
21 | function testTuple()
22 | -- body
23 | return "Hello", 2017, "World"
24 | end
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/StreamingAssets/todo.lua.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 34d4c6b7eca364518b4ec5a991106f7a
3 | timeCreated: 1479977050
4 | licenseType: Pro
5 | DefaultImporter:
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/External.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 863a99adc43624746b94e911bfef0e32
3 | folderAsset: yes
4 | timeCreated: 1500451857
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/External/EnhancedScroller v2.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aa0d9dc64726c44eebdd70c97d2db550
3 | folderAsset: yes
4 | timeCreated: 1504937179
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/External/EnhancedScroller v2/Plugins.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 405b4374d983b69428c5a414029e2a46
3 | folderAsset: yes
4 | timeCreated: 1435585463
5 | licenseType: Store
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/External/EnhancedScroller v2/Plugins/EnhancedScroller.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9c1b74f910281224a8cae6d8e4fc1f43
3 | timeCreated: 1435585470
4 | licenseType: Store
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/External/EnhancedScroller v2/Plugins/EnhancedScrollerCellView.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1f75717e94199704f82f26fcf6953e84
3 | timeCreated: 1435585579
4 | licenseType: Store
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/External/EnhancedScroller v2/Plugins/IEnhancedScrollerDelegate.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7701b31137fe72d47b256054738fd57d
3 | timeCreated: 1435585741
4 | licenseType: Store
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/External/EnhancedScroller v2/Plugins/SmallList.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aab29d68fb4a95d49bca25f359d8f076
3 | timeCreated: 1435585634
4 | licenseType: Store
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/Prefabs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e0f67d92ddf0c484292bff9d9905c008
3 | folderAsset: yes
4 | timeCreated: 1504944252
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/Prefabs/UI.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3f1bb452d8bf048cbb9d40dc3182e81c
3 | folderAsset: yes
4 | timeCreated: 1505093699
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/Prefabs/UI/ListView.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bf7d6d50cbb004921a81e1aa76108f23
3 | folderAsset: yes
4 | timeCreated: 1504944506
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/Prefabs/UI/ListView/ListItemView.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/Assets/VFCommon/Prefabs/UI/ListView/ListItemView.prefab
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/Prefabs/UI/ListView/ListItemView.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fc48e2226305b466c879a2b18f07514d
3 | timeCreated: 1504944412
4 | licenseType: Free
5 | NativeFormatImporter:
6 | mainObjectFileID: 100100000
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/Prefabs/UI/ListView/ListView.prefab:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/Assets/VFCommon/Prefabs/UI/ListView/ListView.prefab
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/Prefabs/UI/ListView/ListView.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bb98ffffd15b54517a51302ce0eb5e10
3 | timeCreated: 1504944256
4 | licenseType: Free
5 | NativeFormatImporter:
6 | mainObjectFileID: 100100000
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/UI.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0069c8d1282984fdfa7f9affd2fca58c
3 | folderAsset: yes
4 | timeCreated: 1504937179
5 | licenseType: Free
6 | DefaultImporter:
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/Assets/VFCommon/UI/ListViewController.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 017e2ea8b03854dbb84853b477c3db4d
3 | timeCreated: 1504941535
4 | licenseType: Free
5 | MonoImporter:
6 | serializedVersion: 2
7 | defaultReferences: []
8 | executionOrder: 0
9 | icon: {instanceID: 0}
10 | userData:
11 | assetBundleName:
12 | assetBundleVariant:
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/AudioManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/AudioManager.asset
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/ClusterInputManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/ClusterInputManager.asset
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/DynamicsManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/DynamicsManager.asset
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/EditorBuildSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/EditorBuildSettings.asset
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/EditorSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/EditorSettings.asset
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/GraphicsSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/GraphicsSettings.asset
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/InputManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/InputManager.asset
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/NavMeshAreas.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/NavMeshAreas.asset
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/NetworkManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/NetworkManager.asset
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/Physics2DSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/Physics2DSettings.asset
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/ProjectSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/ProjectSettings.asset
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/ProjectVersion.txt:
--------------------------------------------------------------------------------
1 | m_EditorVersion: 2017.4.1f1
2 |
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/QualitySettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/QualitySettings.asset
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/TagManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/TagManager.asset
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/TimeManager.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/TimeManager.asset
--------------------------------------------------------------------------------
/Source/Unity3D/UnityProject/ProjectSettings/UnityConnectSettings.asset:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/UnityProject/ProjectSettings/UnityConnectSettings.asset
--------------------------------------------------------------------------------
/Source/Unity3D/Windows/LuaScriptCore/LuaScriptCore.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Source/Unity3D/Windows/LuaScriptCore/dllmain.cpp:
--------------------------------------------------------------------------------
1 | // dllmain.cpp : Defines the entry point for the DLL application.
2 |
3 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
4 | // Windows Header Files:s
5 | #include
6 |
7 |
8 | BOOL APIENTRY DllMain( HMODULE hModule,
9 | DWORD ul_reason_for_call,
10 | LPVOID lpReserved
11 | )
12 | {
13 | switch (ul_reason_for_call)
14 | {
15 | case DLL_PROCESS_ATTACH:
16 | case DLL_THREAD_ATTACH:
17 | case DLL_THREAD_DETACH:
18 | case DLL_PROCESS_DETACH:
19 | break;
20 | }
21 | return TRUE;
22 | }
23 |
--------------------------------------------------------------------------------
/Source/Unity3D/iOS_OSX/LuaScriptCore-Unity-OSX/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/Unity3D/iOS_OSX/LuaScriptCore-Unity-OSX/.DS_Store
--------------------------------------------------------------------------------
/Source/Unity3D/iOS_OSX/LuaScriptCore-Unity-OSX/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | NSHumanReadableCopyright
22 | Copyright © 2016年 冯鸿杰. All rights reserved.
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Source/Unity3D/iOS_OSX/LuaScriptCore.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Source/Unity3D/iOS_OSX/LuaScriptCoreTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Source/Unity3D/iOS_OSX/LuaScriptCoreTests/main.lua:
--------------------------------------------------------------------------------
1 | function add (a, b)
2 |
3 | print("result = "..tostring(a * b));
4 | return a * b;
5 |
6 | end
7 |
8 | function testTuple()
9 | -- body
10 | print('-------- call testTuple');
11 | return "Hello", 2017, "World"
12 | end
13 |
--------------------------------------------------------------------------------
/Source/Unity3D/iOS_OSX/LuaScriptCore_5_1.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code-Swift/LuaConfig.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LuaConfig.swift
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2019/4/4.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | public typealias LuaConfig = LSCConfig;
10 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code-Swift/LuaExportMethodDescriptor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LuaExportMethodDescriptor.swift
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/12/6.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 |
10 | /// 方法描述
11 | public typealias LuaExportMethodDescriptor = LSCExportMethodDescriptor;
12 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code-Swift/LuaExportPropertyDescriptor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LuaExportPropertyDescriptor.swift
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/12/6.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | /// 导出属性描述
10 | public typealias LuaExportPropertyDescriptor = LSCExportPropertyDescriptor;
11 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code-Swift/LuaExportType.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LuaExportType.swift
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/9/8.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | /// 导出类型协议,实现此协议的对象表示为导出类型,可以在Lua中使用。
10 | public typealias LuaExportType = LSCExportType;
11 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code-Swift/LuaExportTypeAnnotation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // File.swift
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/11/24.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | /// 导出类型协议,实现此协议的对象表示为导出类型,可以在Lua中使用。
10 | public typealias LuaExportTypeAnnotation = LSCExportTypeAnnotation;
11 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code-Swift/LuaExportTypeDescriptor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LuaExportTypeDescriptor.swift
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/12/6.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | /// 类型描述
10 | public typealias LuaExportTypeDescriptor = LSCExportTypeDescriptor;
11 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code-Swift/LuaManagedValue.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LuaManagedValue.swift
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/5/24.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | public class LuaManagedValue: NSObject
10 | {
11 | var _source : LuaValue?;
12 | weak var _context : LuaContext?;
13 |
14 | public init(source : LuaValue, context : LuaContext)
15 | {
16 | _source = source;
17 | _context = context;
18 |
19 | _context?.retainValue(value:_source!);
20 | }
21 |
22 | deinit
23 | {
24 | _context?.releaseValue(value: _source!);
25 | }
26 |
27 |
28 | /// 获取源值对象
29 | public var source : LuaValue
30 | {
31 | get
32 | {
33 | return _source!;
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code-Swift/LuaPointer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LuaPointer.swift
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 16/11/30.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | public typealias LuaPointer = LSCPointer;
10 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code-Swift/LuaRunScriptConfig.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LuaRunScriptConfig.swift
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2019/3/12.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | public typealias LuaScriptController = LSCScriptController;
10 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code-Swift/LuaTuple.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LuaTuple.swift
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 17/1/19.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | public typealias LuaTuple = LSCTuple;
10 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCCoroutine+Private.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCCoroutine+Private.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2019/1/1.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCCoroutine.h"
10 | #import "LSCEngineAdapter.h"
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface LSCCoroutine ()
15 |
16 | /**
17 | 状态对象
18 | */
19 | @property (nonatomic) lua_State *state;
20 |
21 | /**
22 | 关联ID
23 | */
24 | @property (nonatomic, copy) NSString *linkId;
25 |
26 | @end
27 |
28 | NS_ASSUME_NONNULL_END
29 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCCoroutine.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCThread.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2018/12/24.
6 | // Copyright © 2018年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @class LSCContext;
14 | @class LSCScriptController;
15 |
16 | /**
17 | 线程对象
18 | */
19 | @interface LSCCoroutine : NSObject
20 |
21 | /**
22 | 上下文对象
23 | */
24 | @property (nonatomic, weak, readonly) LSCContext *context;
25 |
26 | /**
27 | 执行脚本配置
28 | */
29 | @property (nonatomic, strong, nullable) LSCScriptController *scriptController;
30 |
31 | /**
32 | 初始化
33 |
34 | @param context 上下文对象
35 | @return 线程对象
36 | */
37 | - (instancetype)initWithContext:(LSCContext *)context;
38 |
39 | @end
40 |
41 | NS_ASSUME_NONNULL_END
42 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCDataExchanger_Private.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCDataExchanger_Private.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/7/3.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCDataExchanger.h"
10 | #import "LSCContext_Private.h"
11 | #import "LSCOperationQueue.h"
12 | #import "lauxlib.h"
13 | #import "lua.h"
14 | #import "luaconf.h"
15 | #import "lualib.h"
16 |
17 | @interface LSCDataExchanger ()
18 |
19 | /**
20 | 上下文对象
21 | */
22 | @property (nonatomic, weak) LSCContext *context;
23 |
24 | /**
25 | 获取Lua对象并入栈
26 |
27 | @param nativeObject 原生对象
28 | @param state 状态
29 | @param queue 队列
30 | */
31 | - (void)getLuaObject:(id)nativeObject
32 | state:(lua_State *)state
33 | queue:(LSCOperationQueue *)queue;
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCError.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCError.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2019/3/11.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @class LSCSession;
14 |
15 | /**
16 | 异常信息
17 | */
18 | @interface LSCError : NSObject
19 |
20 | /**
21 | 消息
22 | */
23 | @property (nonatomic, copy, readonly) NSString *message;
24 |
25 | /**
26 | 会话
27 | */
28 | @property (nonatomic, weak, readonly) LSCSession *session;
29 |
30 |
31 | /**
32 | 初始化会话
33 |
34 | @param session 会话对象
35 | @param message 消息
36 | @return 异常信息
37 | */
38 | - (instancetype)initWithSession:(LSCSession *)session
39 | message:(NSString *)message;
40 |
41 | @end
42 |
43 | NS_ASSUME_NONNULL_END
44 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCError.m:
--------------------------------------------------------------------------------
1 | //
2 | // LSCError.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2019/3/11.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCError.h"
10 |
11 | @implementation LSCError
12 |
13 | - (instancetype)initWithSession:(LSCSession *)session
14 | message:(NSString *)message
15 | {
16 | if (self = [super init])
17 | {
18 | _session = session;
19 | _message = [message copy];
20 | }
21 | return self;
22 | }
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCExportMethodDescriptor.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCExportMethodDescriptor.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/9/8.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /**
12 | 导出方法描述
13 | */
14 | @interface LSCExportMethodDescriptor : NSObject
15 |
16 | /**
17 | 选择子
18 | */
19 | @property (nonatomic, readonly) SEL selector;
20 |
21 | /**
22 | 参数签名,如:@@、@I@B
23 | */
24 | @property (nonatomic, copy, readonly) NSString *paramsSignature;
25 |
26 |
27 | /**
28 | 方法签名
29 | */
30 | @property (nonatomic, strong, readonly) NSMethodSignature *methodSignature;
31 |
32 |
33 | /**
34 | 初始化
35 |
36 | @param selector 选择子
37 | @param methodSignature 方法签名
38 | @param paramsSignature 参数签名
39 | @return 方法描述
40 | */
41 | - (instancetype)initWithSelector:(SEL)selector
42 | methodSignature:(NSMethodSignature *)methodSignature
43 | paramsSignature:(NSString *)paramsSignature;
44 |
45 |
46 | /**
47 | 创建方法调用器
48 | */
49 | - (NSInvocation *)createInvocation;
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCExportMethodDescriptor.m:
--------------------------------------------------------------------------------
1 | //
2 | // LSCExportMethodDescriptor.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/9/8.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCExportMethodDescriptor.h"
10 |
11 | @implementation LSCExportMethodDescriptor
12 |
13 | - (instancetype)initWithSelector:(SEL)selector
14 | methodSignature:(NSMethodSignature *)methodSignature
15 | paramsSignature:(NSString *)paramsSignature
16 | {
17 | if (self = [super init])
18 | {
19 | _selector = selector;
20 | _methodSignature = methodSignature;
21 | _paramsSignature = paramsSignature;
22 | }
23 | return self;
24 | }
25 |
26 | - (NSInvocation *)createInvocation
27 | {
28 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:self.methodSignature];
29 | invocation.selector = self.selector;
30 |
31 | return invocation;
32 | }
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCExportType.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCExportModule.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/9/5.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /**
12 | 导出模块协议,实现此协议可以将模块导出到Lua层使用
13 | */
14 | @protocol LSCExportType
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCExportTypeAnnotation.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCExportTypeAnnotation.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/11/24.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /**
12 | 导出类型注解
13 | */
14 | @protocol LSCExportTypeAnnotation
15 |
16 | @optional
17 |
18 | /**
19 | 被排除的类方法,被排除的方法无法导出到Lua中
20 |
21 | @return 方法列表
22 | */
23 | + (NSArray *)excludeExportClassMethods;
24 |
25 | /**
26 | 被排除的属性,被排除的方法无法导出到Lua中
27 |
28 | @return 属性列表
29 | */
30 | + (NSArray *)excludeProperties;
31 |
32 | /**
33 | 被排除的实例方法,被排除的方法无法导出到Lua中
34 |
35 | @return 方法列表
36 | */
37 | + (NSArray *)excludeExportInstanceMethods;
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCExportsTypeManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCModuleExporter.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/9/5.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LSCExportType.h"
11 | #import "LSCEngineAdapter.h"
12 |
13 | @class LSCContext;
14 | @class LSCOperationQueue;
15 |
16 | /**
17 | 类型导出器
18 | */
19 | @interface LSCExportsTypeManager : NSObject
20 |
21 | /**
22 | 初始化
23 |
24 | @param context 上下文对象
25 | @return 导出器对象
26 | */
27 | - (instancetype)initWithContext:(LSCContext *)context;
28 |
29 | /**
30 | 检测对象实例是否为一个导出类型
31 |
32 | @param object 对象实例
33 | @return YES 是导出类型,否则不是.
34 | */
35 | - (BOOL)checkExportsTypeWithObject:(id)object;
36 |
37 | /**
38 | 根据一个原生对象创建一个Lua对象
39 |
40 | @param object 对象实例
41 | */
42 | - (void)createLuaObjectByObject:(id)object;
43 |
44 | /**
45 | 根据一个原生对象创建一个Lua对象
46 |
47 | @param object 对象实例
48 | @param state 状态
49 | @param queue 队列
50 | */
51 | - (void)createLuaObjectByObject:(id)object
52 | state:(lua_State *)state
53 | queue:(LSCOperationQueue *)queue;
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCFunction.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCFunction.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 16/10/27.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class LSCValue;
12 | @class LSCContext;
13 | @class LSCScriptController;
14 |
15 | /**
16 | Lua方法
17 | */
18 | @interface LSCFunction : NSObject
19 |
20 | /**
21 | 上下文对象
22 | */
23 | @property (nonatomic, strong, readonly) LSCContext *context;
24 |
25 | /**
26 | 调用方法
27 |
28 | @param arguments 参数列表
29 |
30 | @return 返回值
31 | */
32 | - (LSCValue *)invokeWithArguments:(NSArray *)arguments;
33 |
34 |
35 | /**
36 | 调用方法
37 |
38 | @param arguments 参数列表
39 | @param scriptController 脚本控制器
40 | @return 返回值
41 | */
42 | - (LSCValue *)invokeWithArguments:(NSArray *)arguments
43 | scriptController:(LSCScriptController *)scriptController;
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCFunction_Private.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCFunction_Private.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 16/10/27.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCFunction.h"
10 | #import "LSCEngineAdapter.h"
11 | #import "LSCManagedObjectProtocol.h"
12 |
13 | @class LSCContext;
14 |
15 | @interface LSCFunction ()
16 |
17 | /**
18 | 上下文对象
19 | */
20 | @property (nonatomic, strong) LSCContext *context;
21 |
22 |
23 | /**
24 | 方法的本地索引
25 | */
26 | @property (nonatomic, copy) NSString *index;
27 |
28 | /**
29 | 连接标识
30 | */
31 | @property (nonatomic, copy) NSString *linkId;
32 |
33 | /**
34 | 初始化Lua方法
35 |
36 | @param context 上下文对象
37 | @param index 参数索引
38 |
39 | @return Lua方法对象
40 | */
41 | - (instancetype)initWithContext:(LSCContext *)context
42 | index:(NSInteger)index;
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCManagedObjectProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCLuaObjectPushProtocol.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 16/11/1.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LSCEngineAdapter.h"
11 |
12 | @class LSCContext;
13 | @class LSCOperationQueue;
14 |
15 |
16 | /**
17 | 对象入栈协议
18 | */
19 | @protocol LSCManagedObjectProtocol
20 |
21 |
22 | @required
23 |
24 | /**
25 | 获取关联标识
26 |
27 | @return 关联标识
28 | */
29 | - (NSString *)linkId;
30 |
31 | /**
32 | 入栈数据
33 |
34 | @param context 上下文对象
35 | @return YES 表示已将对象入栈,NO 表示未将对象入栈
36 | */
37 | - (BOOL)pushWithContext:(LSCContext *)context;
38 |
39 |
40 | /**
41 | 入栈数据
42 |
43 | @param state lua状态
44 | @param queue 队列
45 | @return YES 表示已将对象入栈,NO 表示未将对象入栈
46 | */
47 | - (BOOL)pushWithState:(lua_State *)state queue:(LSCOperationQueue *)queue;
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCManagedValue.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCManagedValue.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/5/23.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class LSCContext;
12 | @class LSCValue;
13 |
14 | /**
15 | 管理值对象,用于维护LSCValue的值所对应的Lua对象在LSCManagedValue存在期间不被释放。
16 | */
17 | @interface LSCManagedValue : NSObject
18 |
19 | /**
20 | 源值对象
21 | */
22 | @property (nonatomic, strong, readonly) LSCValue *source;
23 |
24 | /**
25 | 初始化
26 |
27 | @param value 值
28 | @param context 上下文对象
29 | @return 管理值对象
30 | */
31 | - (instancetype)initWithValue:(LSCValue *)value
32 | context:(LSCContext *)context;
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCManagedValue.m:
--------------------------------------------------------------------------------
1 | //
2 | // LSCManagedValue.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/5/23.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCManagedValue.h"
10 | #import "LSCContext_Private.h"
11 |
12 | @interface LSCManagedValue ()
13 |
14 | /**
15 | 上下文对象
16 | */
17 | @property (nonatomic, weak) LSCContext *context;
18 |
19 | /**
20 | 源值对象
21 | */
22 | @property (nonatomic, strong) LSCValue *source;
23 |
24 | @end
25 |
26 | @implementation LSCManagedValue
27 |
28 | - (instancetype)initWithValue:(LSCValue *)value
29 | context:(LSCContext *)context
30 | {
31 | if (self = [super init])
32 | {
33 | self.context = context;
34 | self.source = value;
35 |
36 | [self.context.dataExchanger retainLuaObject:self.source];
37 | }
38 | return self;
39 | }
40 |
41 | - (void)dealloc
42 | {
43 | [self.context.dataExchanger releaseLuaObject:self.source];
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCOperationQueue.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCOperationQueue.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2018/6/28.
6 | // Copyright © 2018年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /**
12 | 操作队列
13 | */
14 | @interface LSCOperationQueue : NSObject
15 |
16 | /**
17 | 执行操作
18 |
19 | @param block 操作内容
20 | */
21 | - (void)performAction:(void (^)(void))block;
22 |
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCOperationQueue.m:
--------------------------------------------------------------------------------
1 | //
2 | // LSCOperationQueue.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2018/6/28.
6 | // Copyright © 2018年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCOperationQueue.h"
10 | #import "LSCEngineAdapter.h"
11 | #import "LSCSession_Private.h"
12 | #import
13 |
14 | #import "ldo.h"
15 |
16 | @interface LSCOperationQueue ()
17 | {
18 | @private
19 | pthread_mutex_t _lock;
20 | }
21 |
22 | @end
23 |
24 | @implementation LSCOperationQueue
25 |
26 | - (instancetype)init
27 | {
28 | if (self = [super init])
29 | {
30 | pthread_mutexattr_t attr;
31 | pthread_mutexattr_init(&attr);
32 | pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
33 |
34 | pthread_mutex_init(&_lock, &attr);
35 |
36 | pthread_mutexattr_destroy(&attr);
37 | }
38 |
39 | return self;
40 | }
41 |
42 | - (void)dealloc
43 | {
44 | pthread_mutex_destroy(&_lock);
45 | }
46 |
47 | - (void)performAction:(void (^)(void))block
48 | {
49 | pthread_mutex_lock(&_lock);
50 | block();
51 | pthread_mutex_unlock(&_lock);
52 | }
53 |
54 | @end
55 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCPointer.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCPointer.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 16/10/27.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | /**
13 | Userdata引用
14 | */
15 | typedef struct
16 | {
17 | void *value;
18 |
19 | } *LSCUserdataRef;
20 |
21 | /**
22 | Lua指针
23 | */
24 | @interface LSCPointer : NSObject
25 |
26 |
27 | /**
28 | 初始化Lua指针对象
29 |
30 | @param ref userdata引用
31 | @return 指针对象
32 | */
33 | - (instancetype)initWithUserdata:(LSCUserdataRef)ref;
34 |
35 |
36 | /**
37 | 初始化Lua指针对象
38 |
39 | @param ptr 指针
40 | @return 指针对象
41 | */
42 | - (instancetype)initWithPtr:(const void *)ptr;
43 |
44 |
45 | /**
46 | 获取Userdata引用
47 |
48 | @return 引用对象
49 | */
50 | - (const LSCUserdataRef)value;
51 |
52 | @end
53 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCScriptController+Private.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCRunScriptConfig+Private.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2019/3/12.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCScriptController.h"
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface LSCScriptController ()
14 |
15 | /**
16 | 脚本超时设置(单位:秒),超过时间则会强制退出脚本执行,默认值为0,表示没有超时限制
17 | */
18 | @property (nonatomic) NSInteger timeout;
19 |
20 | /**
21 | 是否强制结束脚本,默认为NO
22 | */
23 | @property (nonatomic) BOOL isForceExit;
24 |
25 | /**
26 | 开始时间
27 | */
28 | @property (nonatomic) NSTimeInterval startTime;
29 |
30 | @end
31 |
32 | NS_ASSUME_NONNULL_END
33 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCScriptController.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCRunScriptConfig.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2019/3/12.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | /**
14 | 执行脚本设置
15 | */
16 | @interface LSCScriptController : NSObject
17 |
18 | /**
19 | 设置脚本超时时间
20 |
21 | @param timeout 超时时间(单位:秒),如果传入0则表示不限制执行时间
22 | */
23 | - (void)setTimeout:(NSInteger)timeout;
24 |
25 | /**
26 | 强制退出执行脚本
27 | */
28 | - (void)forceExit;
29 |
30 | @end
31 |
32 | NS_ASSUME_NONNULL_END
33 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCScriptController.m:
--------------------------------------------------------------------------------
1 | //
2 | // LSCRunScriptConfig.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2019/3/12.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCScriptController.h"
10 | #import "LSCScriptController+Private.h"
11 |
12 | @implementation LSCScriptController
13 |
14 | - (void)setTimeout:(NSInteger)timeout
15 | {
16 | _timeout = timeout;
17 | }
18 |
19 | - (void)forceExit
20 | {
21 | self.isForceExit = YES;
22 | }
23 |
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCSession_Private.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCCallSession_Private.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/7/3.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCSession.h"
10 | #import "LSCContext.h"
11 | #import "lauxlib.h"
12 | #import "lua.h"
13 | #import "luaconf.h"
14 | #import "lualib.h"
15 |
16 | @interface LSCSession ()
17 |
18 | /**
19 | * Lua状态
20 | */
21 | @property (nonatomic, readonly) lua_State *state;
22 |
23 | /**
24 | 上下文对象
25 | */
26 | @property (nonatomic, weak, readonly) LSCContext *context;
27 |
28 | /**
29 | 初始化
30 |
31 | @param state 状态
32 | @return 调用会话
33 | */
34 | - (instancetype)initWithState:(lua_State *)state
35 | context:(LSCContext *)context
36 | lightweight:(BOOL)lightweight;
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCTable+Private.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTable+Private.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2019/1/16.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCTable.h"
10 | #import "LSCContext_Private.h"
11 |
12 | NS_ASSUME_NONNULL_BEGIN
13 |
14 | @interface LSCTable ()
15 |
16 | /**
17 | 是否为数组
18 | */
19 | @property (nonatomic, readonly) BOOL isArray;
20 |
21 | /**
22 | 上下文对象
23 | */
24 | @property (nonatomic, strong) LSCContext *context;
25 |
26 | /**
27 | 连接标识
28 | */
29 | @property (nonatomic, copy, readonly) NSString *linkId;
30 |
31 | /**
32 | 值对象
33 | */
34 | @property (nonatomic, strong) id valueObject;
35 |
36 | @end
37 |
38 | NS_ASSUME_NONNULL_END
39 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCTable.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTable.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2019/1/16.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @class LSCContext;
14 |
15 | @interface LSCTable : NSObject
16 |
17 | /**
18 | 初始化
19 |
20 | @param dictionary 字典
21 | @param objectId 对象标识
22 | @param context 上下文对象
23 | @return table对象
24 | */
25 | - (instancetype)initWithDictionary:(NSDictionary *)dictionary
26 | objectId:(NSString * _Nullable)objectId
27 | context:(LSCContext * _Nullable)context;
28 |
29 | /**
30 | 初始化
31 |
32 | @param array 数组
33 | @param objectId 对象标识
34 | @param context 上下文对象
35 | @return table对象
36 | */
37 | - (instancetype)initWithArray:(NSArray *)array
38 | objectId:(NSString * _Nullable)objectId
39 | context:(LSCContext * _Nullable)context;
40 |
41 | /**
42 | 设置指定键值对
43 |
44 | @param object 对象
45 | @param keyPath 键名路径
46 | */
47 | - (void)setObject:(id)object forKeyPath:(NSString *)keyPath;
48 |
49 | @end
50 |
51 | NS_ASSUME_NONNULL_END
52 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCTmpValue.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTmpValue.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/12/13.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCValue.h"
10 |
11 | @class LSCContext;
12 |
13 | /**
14 | 临时值
15 | */
16 | @interface LSCTmpValue : LSCValue
17 |
18 | /**
19 | 初始化
20 |
21 | @param context 上下文对象
22 | @param index 索引
23 | @return 临时值对象
24 | */
25 | - (instancetype)initWithContext:(LSCContext *)context
26 | index:(NSInteger)index;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCTuple.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTuple.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 17/1/17.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /**
12 | 元组,仅用于方法返回值
13 | */
14 | @interface LSCTuple : NSObject
15 |
16 | /**
17 | 元素数量
18 | */
19 | @property (nonatomic, readonly) NSInteger count;
20 |
21 | /**
22 | 添加返回值
23 |
24 | @param returnValue 返回值
25 | */
26 | - (void)addReturnValue:(id)returnValue;
27 |
28 | /**
29 | 获取元组中的返回值
30 |
31 | @param index 索引
32 | @return 返回值
33 | */
34 | - (id)returnValueForIndex:(NSInteger)index;
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCTuple.m:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTuple.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 17/1/17.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCTuple.h"
10 | #import "LSCValue_Private.h"
11 | #import "LSCTuple_Private.h"
12 |
13 | @implementation LSCTuple
14 |
15 | - (instancetype)init
16 | {
17 | if (self = [super init])
18 | {
19 | self.returnValues = [NSMutableArray array];
20 | }
21 | return self;
22 | }
23 |
24 | - (NSInteger)count
25 | {
26 | return self.returnValues.count;
27 | }
28 |
29 | - (void)addReturnValue:(id)returnValue
30 | {
31 | if (!returnValue)
32 | {
33 | returnValue = [NSNull null];
34 | }
35 |
36 | [self.returnValues addObject:returnValue];
37 | }
38 |
39 | - (id)returnValueForIndex:(NSInteger)index
40 | {
41 | id retVal = self.returnValues[index];
42 | return [retVal isKindOfClass:[NSNull class]] ? nil : retVal;
43 | }
44 |
45 | - (NSString *)description
46 | {
47 | return [self.returnValues description];
48 | }
49 |
50 | @end
51 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCTuple_Private.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTuple_Private.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 17/1/17.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCTuple.h"
10 |
11 | @class LSCContext;
12 | @class LSCSession;
13 |
14 | @interface LSCTuple ()
15 |
16 | /**
17 | 返回值集合
18 | */
19 | @property (nonatomic, strong) NSMutableArray *returnValues;
20 |
21 | @end
22 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCTypeDefinied.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCTypeDefinied.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 16/9/19.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #ifndef LSCTypeDefinied_h
10 | #define LSCTypeDefinied_h
11 |
12 | @class LSCValue;
13 |
14 | typedef NS_ENUM(NSUInteger, LSCValueType)
15 | {
16 | LSCValueTypeNil = 0,
17 | LSCValueTypeNumber = 1,
18 | LSCValueTypeBoolean = 2,
19 | LSCValueTypeString = 3,
20 | LSCValueTypeArray = 4,
21 | LSCValueTypeMap = 5,
22 | LSCValueTypePtr = 6,
23 | LSCValueTypeObject = 7,
24 | LSCValueTypeInteger = 8,
25 | LSCValueTypeData = 9,
26 | LSCValueTypeFunction = 10,
27 | LSCValueTypeTuple = 11,
28 | LSCValueTypeClass = 12
29 | };
30 |
31 | /**
32 | * 异常处理器
33 | *
34 | * @param message 异常信息
35 | */
36 | typedef void (^LSCExceptionHandler) (NSString *message);
37 |
38 | /**
39 | * 方法处理器
40 | *
41 | * @param arguments 参数列表
42 | *
43 | * @return 返回值
44 | */
45 | typedef LSCValue* (^LSCFunctionHandler) (NSArray *arguments);
46 |
47 |
48 | #endif /* LSCTypeDefinied_h */
49 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCVirtualInstance.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCObjectDescriptor.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/12/27.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @class LSCExportTypeDescriptor;
12 |
13 | /**
14 | 虚拟对象实例,用于解决由subclass衍生的类型所创建的对象实例,由于没有原生实例主体,因此需要为其在原生层中进行实例对象的描述。
15 | */
16 | @interface LSCVirtualInstance : NSObject
17 |
18 | /**
19 | 对象类型描述
20 | */
21 | @property (nonatomic, strong, readonly) LSCExportTypeDescriptor *typeDescriptor;
22 |
23 | /**
24 | 初始化对象
25 |
26 | @param typeDescriptor 类型描述
27 | @return 对象描述
28 | */
29 | - (instancetype)initWithTypeDescriptor:(LSCExportTypeDescriptor *)typeDescriptor;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LSCVirtualInstance.m:
--------------------------------------------------------------------------------
1 | //
2 | // LSCObjectDescriptor.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/12/27.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCVirtualInstance.h"
10 |
11 | @implementation LSCVirtualInstance
12 |
13 | - (instancetype)initWithTypeDescriptor:(LSCExportTypeDescriptor *)typeDescriptor
14 | {
15 | if (self = [super init])
16 | {
17 | _typeDescriptor = typeDescriptor;
18 | }
19 |
20 | return self;
21 | }
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/Code/LuaScriptCore.h:
--------------------------------------------------------------------------------
1 | //
2 | // LuaScriptCore.h
3 | // LuaScriptCore
4 | //
5 | // Created by vimfung on 16/7/15.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #define LuaScriptCoreVersion @"2.4.0"
10 |
11 | #import "LSCContext.h"
12 | #import "LSCValue.h"
13 | #import "LSCFunction.h"
14 | #import "LSCPointer.h"
15 | #import "LSCTuple.h"
16 | #import "LSCManagedValue.h"
17 | #import "LSCScriptController.h"
18 | #import "LSCConfig.h"
19 |
20 | #import "LSCExportType.h"
21 | #import "LSCExportTypeAnnotation.h"
22 | #import "LSCExportTypeDescriptor.h"
23 | #import "LSCExportMethodDescriptor.h"
24 | #import "LSCExportPropertyDescriptor.h"
25 |
26 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LSCConfig.h:
--------------------------------------------------------------------------------
1 | //
2 | // LSCConfig.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2019/4/4.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 |
14 | /**
15 | 配置信息
16 | */
17 | @interface LSCConfig : NSObject
18 |
19 | /**
20 | 是否使用完整名称导出
21 | */
22 | @property (nonatomic) BOOL fullExportName;
23 |
24 | /**
25 | 获取默认配置
26 |
27 | @return 配置信息
28 | */
29 | + (instancetype)defaultConfig;
30 |
31 | @end
32 |
33 | NS_ASSUME_NONNULL_END
34 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LSCConfig.m:
--------------------------------------------------------------------------------
1 | //
2 | // LSCConfig.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2019/4/4.
6 | // Copyright © 2019年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LSCConfig.h"
10 |
11 | @implementation LSCConfig
12 |
13 | + (instancetype)defaultConfig
14 | {
15 | static LSCConfig *config = nil;
16 | static dispatch_once_t onceToken;
17 | dispatch_once(&onceToken, ^{
18 |
19 | config = [[LSCConfig alloc] init];
20 |
21 | });
22 |
23 | return config;
24 | }
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCore-OSX-Swift/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 2.4.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSHumanReadableCopyright
22 | Copyright © 2016年 vimfung. All rights reserved.
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCore-iOS-Swift/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 2.4.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSPrincipalClass
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCore-iOS-SwiftTests/Env.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Env.swift
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/5/10.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import LuaScriptCore_iOS_Swift
11 |
12 | class Env : NSObject
13 | {
14 | static let defaultContext = setupContext();
15 |
16 | class func setupContext () -> LuaContext
17 | {
18 | let _context : LuaContext = LuaContext();
19 | return _context;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCore-iOS-SwiftTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCore.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCore.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-OSX/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/America.h:
--------------------------------------------------------------------------------
1 | //
2 | // America.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/5/18.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "Person.h"
10 |
11 | @interface America : Person
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/America.m:
--------------------------------------------------------------------------------
1 | //
2 | // America.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/5/18.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "America.h"
10 |
11 | @implementation America
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/Chinese.h:
--------------------------------------------------------------------------------
1 | //
2 | // Chinese.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/5/18.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "Person.h"
10 |
11 | @interface Chinese : Person
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/Chinese.m:
--------------------------------------------------------------------------------
1 | //
2 | // Chinese.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/5/18.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "Chinese.h"
10 |
11 | @implementation Chinese
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/English.h:
--------------------------------------------------------------------------------
1 | //
2 | // English.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/5/18.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "Person.h"
10 |
11 | @interface English : Person
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/English.m:
--------------------------------------------------------------------------------
1 | //
2 | // English.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/5/18.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "English.h"
10 |
11 | @implementation English
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/Env.h:
--------------------------------------------------------------------------------
1 | //
2 | // Env.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/5/9.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LuaScriptCore.h"
11 |
12 | @interface Env : NSObject
13 |
14 | + (LSCContext *)defaultContext;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/Env.m:
--------------------------------------------------------------------------------
1 | //
2 | // Env.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/5/9.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "Env.h"
10 |
11 | @implementation Env
12 |
13 | + (LSCContext *)defaultContext
14 | {
15 | static LSCContext *context = nil;
16 | static dispatch_once_t predicate;
17 |
18 | dispatch_once(&predicate, ^{
19 |
20 | context = [[LSCContext alloc] init];
21 |
22 | });
23 |
24 | return context;
25 | }
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/LuaLog.h:
--------------------------------------------------------------------------------
1 | //
2 | // LuaLog.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/9/6.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LSCExportType.h"
11 |
12 | @interface LuaLog : NSObject
13 |
14 | + (void)writeLog:(NSString *)msg;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/LuaLog.m:
--------------------------------------------------------------------------------
1 | //
2 | // LuaLog.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/9/6.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LuaLog.h"
10 |
11 | @implementation LuaLog
12 |
13 | + (void)writeLog:(NSString *)msg
14 | {
15 | NSLog(@"%@ log = %@", self, msg);
16 | }
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/NativePerson.h:
--------------------------------------------------------------------------------
1 | //
2 | // NativePerson.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 17/3/22.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LSCExportType.h"
11 |
12 | @class Person;
13 |
14 | @interface NativePerson : NSObject
15 |
16 | @property (nonatomic, copy) NSString *name;
17 |
18 | - (void)speak:(NSString *)content;
19 |
20 | + (void)printPersonName:(NativePerson *)person;
21 |
22 | + (Person *)createPerson;
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/NativePerson.m:
--------------------------------------------------------------------------------
1 | //
2 | // NativePerson.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 17/3/22.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "NativePerson.h"
10 | #import "Person.h"
11 |
12 | @implementation NativePerson
13 |
14 | - (void)speak:(NSString *)content
15 | {
16 | NSLog(@"%@ speak:\"%@\"", self.name, content);
17 | }
18 |
19 | + (void)printPersonName:(NativePerson *)person
20 | {
21 | NSLog(@"person name = %@", person.name);
22 | }
23 |
24 | + (Person *)createPerson
25 | {
26 | return [[Person alloc] init];
27 | }
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/Person.h:
--------------------------------------------------------------------------------
1 | //
2 | // Person.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 16/11/14.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LSCExportType.h"
11 | #import "LSCExportTypeAnnotation.h"
12 |
13 | @class NativePerson;
14 | @class LSCTuple;
15 | @class LSCFunction;
16 |
17 | @interface Person : NSObject
18 |
19 | @property (nonatomic, copy) NSString *name;
20 |
21 | - (void)speak:(NSString *)content;
22 | - (void)speakWithAge:(BOOL)age;
23 | - (LSCTuple *)test;
24 |
25 | + (void)printPersonName:(Person *)person;
26 |
27 | + (Person *)createPerson;
28 |
29 | + (NativePerson *)createNativePerson;
30 |
31 | + (void)testFuncRelease:(LSCFunction *)func;
32 |
33 | + (BOOL)returnBoolean;
34 |
35 | + (char)returnChar;
36 |
37 | - (instancetype)initWithName:(NSString *)name;
38 |
39 | - (instancetype)initWithName:(NSString *)name age:(NSInteger)age;
40 |
41 | @end
42 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/SubLuaLog.h:
--------------------------------------------------------------------------------
1 | //
2 | // SubLuaLog.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/9/7.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "LuaLog.h"
10 | #import "LSCExportTypeAnnotation.h"
11 |
12 | @interface SubLuaLog : LuaLog
13 |
14 | @property (nonatomic, copy) NSString *name;
15 |
16 | - (void)printName;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/SubLuaLog.m:
--------------------------------------------------------------------------------
1 | //
2 | // SubLuaLog.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/9/7.
6 | // Copyright © 2017年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "SubLuaLog.h"
10 |
11 | @implementation SubLuaLog
12 |
13 | - (void)printName
14 | {
15 | NSLog(@"%@ name = %@", self, self.name);
16 | }
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/Test.lua:
--------------------------------------------------------------------------------
1 | function test()
2 |
3 | local value = 256;
4 | return value * 4, 1111, 'Hello';
5 |
6 | end
7 |
8 | return test();
9 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/Test1.lua:
--------------------------------------------------------------------------------
1 | print(Person);
2 | local p = Person:createPerson();
3 | print(p);
4 | print(p.name);
5 | p.name = {a=2};
6 | print(p.name);
7 | p.value = "test value";
8 | print(p.value);
9 | p.intValue = 2222;
10 | print(p.intValue);
11 | p:speak("Hello");
12 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/Test2.lua:
--------------------------------------------------------------------------------
1 | local tbl = {};
2 |
3 | grabegecollect();
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/TestModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // TestModule.h
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 16/11/14.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "LSCExportType.h"
11 |
12 | @interface TestModule : NSObject
13 |
14 | + (NSString *)test;
15 |
16 | + (NSString *)testWithMsg:(NSString *)msg;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/TestModule.m:
--------------------------------------------------------------------------------
1 | //
2 | // TestModule.m
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 16/11/14.
6 | // Copyright © 2016年 vimfung. All rights reserved.
7 | //
8 |
9 | #import "TestModule.h"
10 | #import "LSCTuple.h"
11 |
12 | @implementation TestModule
13 |
14 | + (NSString *)test
15 | {
16 | return @"Hello World!";
17 | }
18 |
19 | + (NSString *)testWithMsg:(NSString *)msg
20 | {
21 | return [NSString stringWithFormat:@"test msg = %@", msg];
22 | }
23 |
24 | + (LSCTuple *)testTuple
25 | {
26 | LSCTuple *tuple = [[LSCTuple alloc] init];
27 | [tuple addReturnValue:@"Hello"];
28 | [tuple addReturnValue:@"World"];
29 |
30 | return tuple;
31 | }
32 |
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/config.lua:
--------------------------------------------------------------------------------
1 | return {
2 | a = 1,
3 | c = {}
4 | }
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/definedProperty.lua:
--------------------------------------------------------------------------------
1 | Person.prototype.age = {
2 |
3 | get = function (self)
4 | print("*********get age", self._age);
5 | return self._age;
6 | end,
7 | set = function (self, value)
8 | print("-------set age", self._age);
9 | self._age = value;
10 | print("+++++++set age", self._age);
11 | end
12 |
13 | };
14 |
15 | local p = Person(); p.age = 12; print (p.age);
16 |
17 | Object:subclass("Child");
18 |
19 | Child.prototype.name = {
20 | get = function (self)
21 | print ("+++++++++ get name");
22 | return self._name;
23 | end,
24 | set = function (self, value)
25 | print ("+++++++++ set name");
26 | self._name = value;
27 | end
28 | };
29 |
30 | local c = Child(); c.name = "vim"; print (c.name);
31 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCoreTests-iOS/test.out:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/iOS_OSX/LuaScriptCoreTests-iOS/test.out
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCore_5_1.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Source/iOS_OSX/LuaScriptCore_5_1.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Source/lua-common/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vimfung/LuaScriptCore/d474e006b4ab5e79dfe270b788d850cec86f9184/Source/lua-common/.DS_Store
--------------------------------------------------------------------------------
/Source/lua-common/LuaError.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by 冯鸿杰 on 2019/3/11.
3 | //
4 |
5 | #include "LuaError.h"
6 | #include "LuaSession.h"
7 |
8 | using namespace cn::vimfung::luascriptcore;
9 |
10 | LuaError::LuaError(LuaSession *session, std::string const& message)
11 | {
12 | _session = session;
13 | _session -> retain();
14 |
15 | _message = message;
16 | }
17 |
18 | LuaError::~LuaError()
19 | {
20 | _session -> release();
21 | _session = NULL;
22 | }
23 |
24 | std::string LuaError::getMessage()
25 | {
26 | return _message;
27 | }
28 |
29 | LuaSession* LuaError::getSession()
30 | {
31 | return _session;
32 | }
--------------------------------------------------------------------------------
/Source/lua-common/LuaExportMethodDescriptor.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // LuaExportMethodDescriptor.cpp
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 2017/9/16.
6 | // Copyright © 2017年 冯鸿杰. All rights reserved.
7 | //
8 |
9 | #include "LuaExportMethodDescriptor.hpp"
10 | #include "LuaValue.h"
11 |
12 | using namespace cn::vimfung::luascriptcore;
13 |
14 | LuaExportMethodDescriptor::LuaExportMethodDescriptor(std::string const& name, std::string const& methodSignature)
15 | {
16 | _name = name;
17 | _methodSignature = methodSignature;
18 | }
19 |
20 | std::string LuaExportMethodDescriptor::name()
21 | {
22 | return _name;
23 | }
24 |
25 | std::string LuaExportMethodDescriptor::methodSignature()
26 | {
27 | return _methodSignature;
28 | }
29 |
30 | LuaValue* LuaExportMethodDescriptor::invoke(LuaSession *session, LuaArgumentList arguments)
31 | {
32 | return NULL;
33 | }
34 |
--------------------------------------------------------------------------------
/Source/lua-common/LuaNativeClassFactory.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // LuaNativeClassFactory.cpp
3 | // LuaScriptCore
4 | //
5 | // Created by 冯鸿杰 on 16/11/17.
6 | // Copyright © 2016年 冯鸿杰. All rights reserved.
7 | //
8 |
9 | #include "LuaNativeClassFactory.hpp"
10 |
11 | using namespace cn::vimfung::luascriptcore;
12 |
13 | LuaNativeClassFactory& LuaNativeClassFactory::shareInstance()
14 | {
15 | static LuaNativeClassFactory factory;
16 | return factory;
17 | }
18 |
19 | void LuaNativeClassFactory::registerClass(std::string const& className, LuaNativeClass* nativeClass)
20 | {
21 | _classMap[className] = nativeClass;
22 | }
23 |
24 | LuaNativeClass* LuaNativeClassFactory::findClass(std::string const& className)
25 | {
26 | LuaClassMap::iterator it = _classMap.find(className);
27 | if (it != _classMap.end())
28 | {
29 | return it -> second;
30 | }
31 |
32 | return NULL;
33 | }
34 |
--------------------------------------------------------------------------------
/Source/lua-common/LuaObjectManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by vimfung on 16/8/29.
3 | //
4 |
5 | #ifndef SAMPLE_LUAOBJECTMANAGER_H
6 | #define SAMPLE_LUAOBJECTMANAGER_H
7 |
8 | #include