|
2 | 2 |
|
3 | 3 | ## 使用 |
4 | 4 |
|
5 | | -可用的平台 `.net8.0`, `win-x64`, `linux-x64`, `osx-x64`, `osx-arm64` |
| 5 | +可用的平台 `.net8.0`, `win-x64`, `linux-x64`, `osx` ([universal binary](https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary)) |
| 6 | + |
| 7 | +Python 的 `osx` 版本目前仅支持 `osx-arm64` |
6 | 8 |
|
7 | 9 | 目前不支持`AOT` |
8 | 10 |
|
|
18 | 20 | 引入需要的扩展,以下是支持的扩展,同样的,也需要引入对应的 `NativeAssets` |
19 | 21 |
|
20 | 22 | * `Puerts.Lua` |
21 | | -* `Puerts.QuickJS` |
22 | 23 | * `Puerts.NodeJS` |
| 24 | +* `Puerts.Python` |
| 25 | +* `Puerts.QuickJS` |
23 | 26 | * `Puerts.V8` |
24 | 27 |
|
25 | 28 | 简单用例,已引入 `Puerts.Core`、 `Puerts.V8` 以及对应的 `NativeAssets` 包 |
26 | 29 |
|
27 | 30 | ```csharp |
28 | 31 | using Puerts; |
29 | 32 |
|
30 | | -var jsEnv = new ScriptEnv( |
31 | | - new BackendV8()); |
32 | | - jsEnv.Eval(@" |
33 | | - CS.System.Console.WriteLine('hello world'); |
34 | | - "); |
35 | | - jsEnv.Dispose(); |
36 | | - |
37 | | - Console.WriteLine("Press any key to exit..."); |
| 33 | +var jsEnv = new ScriptEnv(new BackendV8()); |
| 34 | +jsEnv.Eval(@"CS.System.Console.WriteLine('hello world');"); |
| 35 | +jsEnv.Dispose(); |
| 36 | +Console.WriteLine("Press any key to exit..."); |
38 | 37 | ``` |
39 | 38 |
|
40 | 39 | ## 包版本定义 |
41 | 40 |
|
42 | 41 | [Directory.Build.props](Directory.Build.props) |
43 | 42 |
|
44 | | -构建包的版本 |
| 43 | +构建包的版本可以通过设置 `Directory.Build.props` 中的各个版本号来定义 |
45 | 44 |
|
46 | | -```xml |
47 | | -<BuildPackageVersion>0.0.1</BuildPackageVersion> |
| 45 | +版本是从各个upm包的 [package.json](../upms/core/package.json) 中读取的 |
48 | 46 |
|
49 | | -<PuertsCoreVersion>$(BuildPackageVersion)</PuertsCoreVersion> |
50 | | -<PuertsQuickJsVersion>$(BuildPackageVersion)</PuertsQuickJsVersion> |
51 | | -<PuertsNodeJsVersion>$(BuildPackageVersion)</PuertsNodeJsVersion> |
52 | | -<PuertsV8Version>$(BuildPackageVersion)</PuertsV8Version> |
53 | | -<PuertsLuaVersion>$(BuildPackageVersion)</PuertsLuaVersion> |
| 47 | +```xml |
| 48 | +<PuertsCoreVersion></PuertsCoreVersion> |
| 49 | +<PuertsLuaVersion></PuertsLuaVersion> |
| 50 | +<PuertsNodeJsVersion></PuertsNodeJsVersion> |
| 51 | +<PuertsPythonVersion></PuertsPythonVersion> |
| 52 | +<PuertsQuickJsVersion></PuertsQuickJsVersion> |
| 53 | +<PuertsV8Version></PuertsV8Version> |
54 | 54 | ``` |
55 | 55 |
|
56 | 56 | 设置目标的框架 |
|
0 commit comments