Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MuGuiLin
uni-app
提交
e7e894cb
U
uni-app
项目概览
MuGuiLin
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e7e894cb
编写于
8月 16, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(uts): compiler
上级
5cdfd682
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
37 addition
and
17 deletion
+37
-17
packages/playground/uts/uni_modules/test-uniplugin/app-android/index.uts
...ound/uts/uni_modules/test-uniplugin/app-android/index.uts
+5
-1
packages/playground/uts/uni_modules/test-uniplugin/static/logo.png
...playground/uts/uni_modules/test-uniplugin/static/logo.png
+0
-0
packages/playground/uts/unpackage/dist/app-plus/uni_modules/test-uniplugin/app-android/index.kt
.../app-plus/uni_modules/test-uniplugin/app-android/index.kt
+6
-1
packages/uni-uts-vite/src/utils/compiler.ts
packages/uni-uts-vite/src/utils/compiler.ts
+26
-15
packages/uts-darwin-arm64/uts.darwin-arm64.node
packages/uts-darwin-arm64/uts.darwin-arm64.node
+0
-0
packages/uts-darwin-x64/uts.darwin-x64.node
packages/uts-darwin-x64/uts.darwin-x64.node
+0
-0
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
+0
-0
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
+0
-0
未找到文件。
packages/playground/uts/uni_modules/test-uniplugin/app-android/index.uts
浏览文件 @
e7e894cb
import Log from 'android.util.Log'
import { IUser } from './interface.uts'
import { login } from './login.uts'
import logo from '../static/logo.png'
export class User implements IUser {
async login(name: string, pwd: string) {
login(name, pwd)
Log.info('123')
Log.info(logo)
}
register(name: string) {
Log.info(logo)
}
register(name: string) {}
}
packages/playground/uts/uni_modules/test-uniplugin/static/logo.png
0 → 100644
浏览文件 @
e7e894cb
3.9 KB
packages/playground/uts/unpackage/dist/app-plus/uni_modules/test-uniplugin/app-android/index.kt
浏览文件 @
e7e894cb
package
uts.modules.testUniPlugin;
import
kotlinx.coroutines.*;
import
io.dcloud.uts.runtime.*;
import
io.dcloud.uts.andriod.getResourcePath;
import
android.util.Log;
interface
IUser
{
fun
register
(
name
:
String
):
Unit
;
...
...
@@ -12,10 +13,14 @@ fun login(name: String, pwd: String): UtsJSONObject {
var
pwd
=
pwd
};
}
val
__default
=
getResourcePath
(
"static/logo.png"
);
open
class
User
:
IUser
{
open
suspend
fun
login
(
name
:
String
,
pwd
:
String
)
=
CoroutineScope
(
Dispatchers
.
Default
).
async
{
login
(
name
,
pwd
);
Log
.
info
(
"123"
);
Log
.
info
(
__default
);
}
override
fun
register
(
name
:
String
)
{
Log
.
info
(
__default
);
}
override
fun
register
(
name
:
String
)
{}
}
packages/uni-uts-vite/src/utils/compiler.ts
浏览文件 @
e7e894cb
...
...
@@ -3,9 +3,8 @@ import fs from 'fs-extra'
import
path
from
'
path
'
import
AdmZip
from
'
adm-zip
'
import
{
sync
}
from
'
fast-glob
'
import
{
once
}
from
'
@dcloudio/uni-shared
'
import
type
{
parse
,
bundle
,
UtsTarget
}
from
'
@dcloudio/uts
'
import
{
normalizePath
}
from
'
@dcloudio/uni-cli-shared
'
import
{
installHBuilderXPlugin
,
normalizePath
}
from
'
@dcloudio/uni-cli-shared
'
import
{
camelize
}
from
'
@vue/shared
'
export
function
getUtsCompiler
():
{
...
...
@@ -69,8 +68,12 @@ export async function compile(filename: string) {
}
else
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
// 开发模式下,需要生成 dex
if
(
fs
.
existsSync
(
kotlinFile
))
{
const
compilerServer
=
getCompilerServer
()
if
(
!
compilerServer
)
{
return
}
const
{
getDefaultJar
,
compile
}
=
compilerServer
time
=
Date
.
now
()
const
{
getDefaultJar
,
compile
}
=
getCompilerServer
()
const
jarFile
=
resolveJarPath
(
kotlinFile
)
const
options
=
{
kotlinc
:
resolveKotlincArgs
(
...
...
@@ -179,19 +182,27 @@ function resolveClassPath(jars: string[]) {
return
jars
.
join
(
os
.
platform
()
===
'
win32
'
?
'
;
'
:
'
:
'
)
}
const
getCompilerServer
=
once
(()
=>
{
// eslint-disable-next-line no-restricted-globals
return
require
(
path
.
resolve
(
process
.
env
.
UNI_HBUILDERX_PLUGINS
,
'
uniAppRun-Extension/out/main.js
'
))
as
{
const
getCompilerServer
=
():
|
{
getDefaultJar
():
string
[]
compile
(
options
:
{
kotlinc
:
string
[];
d8
:
string
[]
},
projectPath
:
string
):
Promise
<
boolean
>
}
})
|
false
=>
{
try
{
const
compilerServerPath
=
path
.
resolve
(
process
.
env
.
UNI_HBUILDERX_PLUGINS
,
'
uniapp-runextension/out/main.js
'
)
// eslint-disable-next-line no-restricted-globals
return
require
(
compilerServerPath
)
}
catch
(
e
)
{
installHBuilderXPlugin
(
'
uniapp-runextension
'
)
}
return
false
}
export
function
parsePackage
(
filepath
:
string
)
{
const
parts
=
normalizePath
(
filepath
).
split
(
'
/
'
)
...
...
packages/uts-darwin-arm64/uts.darwin-arm64.node
浏览文件 @
e7e894cb
无法预览此类型文件
packages/uts-darwin-x64/uts.darwin-x64.node
浏览文件 @
e7e894cb
无法预览此类型文件
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
浏览文件 @
e7e894cb
无法预览此类型文件
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
浏览文件 @
e7e894cb
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录