Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
7ea00805
U
uni-app
项目概览
DCloud
/
uni-app
14 天 前同步成功
通知
751
Star
38709
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
8
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
8
Issue
8
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
7ea00805
编写于
2月 06, 2023
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(uts): compiler
上级
f1e72ae9
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
15 addition
and
19 deletion
+15
-19
packages/playground/uts/uni_modules/test-uniplugin/utssdk/app-android/index.uts
...s/uni_modules/test-uniplugin/utssdk/app-android/index.uts
+3
-3
packages/playground/uts/unpackage/dist/dev/.sourcemap/app/uni_modules/test-uniplugin/utssdk/app-android/index.kt.map
...ni_modules/test-uniplugin/utssdk/app-android/index.kt.map
+1
-1
packages/playground/uts/unpackage/dist/dev/app-plus/uni_modules/test-uniplugin/utssdk/app-android/index.kt
...us/uni_modules/test-uniplugin/utssdk/app-android/index.kt
+2
-12
packages/uni-uts-v1/__tests__/sourceMap.spec.ts
packages/uni-uts-v1/__tests__/sourceMap.spec.ts
+3
-3
packages/uni-uts-v1/src/kotlin.ts
packages/uni-uts-v1/src/kotlin.ts
+1
-0
packages/uni-uts-v1/src/swift.ts
packages/uni-uts-v1/src/swift.ts
+1
-0
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-linux-x64-gnu/uts.linux-x64-gnu.node
packages/uts-linux-x64-gnu/uts.linux-x64-gnu.node
+0
-0
packages/uts-linux-x64-musl/uts.linux-x64-musl.node
packages/uts-linux-x64-musl/uts.linux-x64-musl.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/uts/src/types.ts
packages/uts/src/types.ts
+1
-0
scripts/test.js
scripts/test.js
+3
-0
未找到文件。
packages/playground/uts/uni_modules/test-uniplugin/utssdk/app-android/index.uts
浏览文件 @
7ea00805
import Log from 'android.util.Log'
import FrameLayout from 'android.widget.FrameLayout'
import View from 'android.view.View'
import { login } from 'login'
import { IUser } from './interface'
import { login } from './login'
import logo from '../../static/logo.png'
const test = arrayOf(1, 2, 3)
...
...
@@ -52,7 +52,7 @@ export class User implements IUser {
register(name: string, callback: () => void) {
Log.info(logo as FrameLayout)
}
test(view: View) {
test(view: View) {
console.log(new TestClass())
}
}
...
...
@@ -63,6 +63,6 @@ export function register(name: string, callback: () => void) { }
export function offMemoryWarning(
callback: null | ((level: number) => void) = null
) { }
class TestClass{
class TestClass
{
}
\ No newline at end of file
packages/playground/uts/unpackage/dist/dev/.sourcemap/app/uni_modules/test-uniplugin/utssdk/app-android/index.kt.map
浏览文件 @
7ea00805
{"version":3,"sources":["uni_modules/test-uniplugin/static/logo.png","uni_modules/test-uniplugin/utssdk/app-android/index.uts","uni_modules/test-uniplugin/utssdk/app-android/interface.uts","uni_modules/test-uniplugin/utssdk/app-android/utils.uts","uni_modules/test-uniplugin/utssdk/app-android/login.uts"],"sourcesContent":["import { UTSAndroid } from 'io.dcloud.uts'\nexport default UTSAndroid.getResourcePath('uni_modules/test-uniplugin/static/logo.png')\n ","import Log from 'android.util.Log'\nimport FrameLayout from 'android.widget.FrameLayout'\nimport View from 'android.view.View'\nimport { IUser } from './interface'\nimport { login } from './login'\nimport logo from '../../static/logo.png'\n\nconst test = arrayOf(1, 2, 3)\n\ntype GetBatteryInfoOptions = {\n success?: (res: UTSJSONObject) => void\n fail?: (res: UTSJSONObject) => void\n complete?: (res: UTSJSONObject) => void\n}\nexport class User implements IUser {\n async login(name: string, pwd: string) {\n setTimeout(() => {\n console.log('timeout')\n }, 1000)\n login(name, pwd)\n for (let i = 0; i < 10; i++) {\n console.log(i)\n }\n Log.info(logo)\n\n console.log('def android')\n\n\n\n\n\n\n\n\n console.log('ndef ios')\n\n\n console.log('def android || def ios')\n\n\n\n\n const a = -3\n console.log(~a)\n new XToast<XToast<unknown>>(getUniActivity())\n .setContentView(R.layout.toast_hint)\n .setDuration(1000)\n .setImageDrawable(android.R.id.icon, R.mipmap.ic_dialog_tip_finish)\n .setText(android.R.id.message, '点我消失')\n .show()\n }\n register(name: string, callback: () => void) {\n Log.info(logo as FrameLayout)\n }\n test(view: View) { \n console.log(new TestClass())\n }\n}\nfunction login(name: string, callback: () => void) { }\n\n@Suppress(\"DEPRECATION\")\nexport function register(name: string, callback: () => void) { }\nexport function offMemoryWarning(\n callback: null | ((level: number) => void) = null\n) { }\nclass TestClass{\n\n}\n","export interface IUser {\n register(name: string): void\n}\n","export function test(){\n console.log('test')\n}\n","import { test } from \"./utils.uts\"\nexport function login(name: string, pwd: string) {\n console.log('login')\n test()\n return { name, pwd }\n}\n"],"names":[],"mappings":";;;;;;AAAA;ACAA,OAAgB,gBAAkB,CAAA;AAClC,OAAwB,0BAA4B,CAAA;AACpD,OAAiB,iBAAmB,CAAA;UCFnB;QACf,SAAS,MAAM,MAAM,GAAG,IAAI;;ACDvB,IAAS,OAAM;IAClB,QAAQ,GAAG,CAAC;AAChB;ACDO,IAAS,MAAM,MAAM,MAAM,EAAE,KAAK,MAA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BAA6C,IAAI,EACjD,CAAE;AACJ,WAAM;AAEN"}
\ No newline at end of file
{"version":3,"sources":["uni_modules/test-uniplugin/static/logo.png","uni_modules/test-uniplugin/utssdk/app-android/index.uts","uni_modules/test-uniplugin/utssdk/app-android/interface.uts"],"sourcesContent":["import { UTSAndroid } from 'io.dcloud.uts'\nexport default UTSAndroid.getResourcePath('uni_modules/test-uniplugin/static/logo.png')\n ","import Log from 'android.util.Log'\nimport FrameLayout from 'android.widget.FrameLayout'\nimport View from 'android.view.View'\nimport { login } from 'login'\nimport { IUser } from './interface'\nimport logo from '../../static/logo.png'\n\nconst test = arrayOf(1, 2, 3)\n\ntype GetBatteryInfoOptions = {\n success?: (res: UTSJSONObject) => void\n fail?: (res: UTSJSONObject) => void\n complete?: (res: UTSJSONObject) => void\n}\nexport class User implements IUser {\n async login(name: string, pwd: string) {\n setTimeout(() => {\n console.log('timeout')\n }, 1000)\n login(name, pwd)\n for (let i = 0; i < 10; i++) {\n console.log(i)\n }\n Log.info(logo)\n\n console.log('def android')\n\n\n\n\n\n\n\n\n console.log('ndef ios')\n\n\n console.log('def android || def ios')\n\n\n\n\n const a = -3\n console.log(~a)\n new XToast<XToast<unknown>>(getUniActivity())\n .setContentView(R.layout.toast_hint)\n .setDuration(1000)\n .setImageDrawable(android.R.id.icon, R.mipmap.ic_dialog_tip_finish)\n .setText(android.R.id.message, '点我消失')\n .show()\n }\n register(name: string, callback: () => void) {\n Log.info(logo as FrameLayout)\n }\n test(view: View) {\n console.log(new TestClass())\n }\n}\nfunction login(name: string, callback: () => void) { }\n\n@Suppress(\"DEPRECATION\")\nexport function register(name: string, callback: () => void) { }\nexport function offMemoryWarning(\n callback: null | ((level: number) => void) = null\n) { }\nclass TestClass {\n\n}\n","export interface IUser {\n register(name: string): void\n}\n"],"names":[],"mappings":";;;;;;AAAA;ACAA,OAAgB,gBAAkB,CAAA;AAClC,OAAwB,0BAA4B,CAAA;AACpD,OAAiB,iBAAmB,CAAA;AACpC;UCHiB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packages/playground/uts/unpackage/dist/dev/app-plus/uni_modules/test-uniplugin/utssdk/app-android/index.kt
浏览文件 @
7ea00805
...
...
@@ -8,22 +8,12 @@ import io.dcloud.uts.UTSAndroid;
import
android.util.Log;
import
android.widget.FrameLayout;
import
android.view.View;
import
login.login;
interface
IUser
{
fun
register
(
name
:
String
):
Unit
;
}
fun
test
()
{
console
.
log
(
"test"
,
" at uni_modules/test-uniplugin/utssdk/app-android/utils.uts:2"
);
}
fun
login
(
name
:
String
,
pwd
:
String
):
UTSJSONObject
{
console
.
log
(
"login"
,
" at uni_modules/test-uniplugin/utssdk/app-android/login.uts:3"
);
test
();
return
object
:
UTSJSONObject
()
{
var
name
=
name
var
pwd
=
pwd
};
}
val
default
=
UTSAndroid
.
getResourcePath
(
"uni_modules/test-uniplugin/static/logo.png"
);
val
test
1
=
arrayOf
(
1
,
2
,
3
);
val
test
=
arrayOf
(
1
,
2
,
3
);
open
class
GetBatteryInfoOptions
:
UTSJSONObject
()
{
open
var
success
:
UTSCallback
?
=
null
;
open
var
fail
:
UTSCallback
?
=
null
;
...
...
packages/uni-uts-v1/__tests__/sourceMap.spec.ts
浏览文件 @
7ea00805
...
...
@@ -137,7 +137,7 @@ describe('uts:sourceMap', () => {
outputDir
,
})
expect
(
res
).
toEqual
({
line
:
1
8
,
line
:
1
5
,
column
:
16
,
lastColumn
:
null
,
source
:
resolve
(
...
...
@@ -165,8 +165,8 @@ describe('uts:sourceMap', () => {
column
:
16
,
})
expect
(
line
).
toBe
(
3
)
expect
(
column
).
toBe
(
1
4
)
expect
(
line
).
toBe
(
5
)
expect
(
column
).
toBe
(
1
1
)
expect
(
source
).
toContain
(
'
login.uts
'
)
})
test
(
'
originalPositionFor ios
'
,
async
()
=>
{
...
...
packages/uni-uts-v1/src/kotlin.ts
浏览文件 @
7ea00805
...
...
@@ -313,6 +313,7 @@ export async function compile(
root
:
inputDir
,
filename
,
pluginId
,
paths
:
{},
}
const
isUTSFileExists
=
fs
.
existsSync
(
filename
)
if
(
componentsCode
)
{
...
...
packages/uni-uts-v1/src/swift.ts
浏览文件 @
7ea00805
...
...
@@ -169,6 +169,7 @@ export async function compile(
root
:
inputDir
,
filename
,
pluginId
,
paths
:
{},
}
const
isUTSFileExists
=
fs
.
existsSync
(
filename
)
if
(
componentsCode
)
{
...
...
packages/uts-darwin-arm64/uts.darwin-arm64.node
浏览文件 @
7ea00805
无法预览此类型文件
packages/uts-darwin-x64/uts.darwin-x64.node
浏览文件 @
7ea00805
无法预览此类型文件
packages/uts-linux-x64-gnu/uts.linux-x64-gnu.node
浏览文件 @
7ea00805
无法预览此类型文件
packages/uts-linux-x64-musl/uts.linux-x64-musl.node
浏览文件 @
7ea00805
无法预览此类型文件
packages/uts-win32-ia32-msvc/uts.win32-ia32-msvc.node
浏览文件 @
7ea00805
无法预览此类型文件
packages/uts-win32-x64-msvc/uts.win32-x64-msvc.node
浏览文件 @
7ea00805
无法预览此类型文件
packages/uts/src/types.ts
浏览文件 @
7ea00805
...
...
@@ -21,6 +21,7 @@ export type UtsInputOptions = UtsParseOptions & {
filename
:
string
fileContent
?:
string
fileAppendContent
?:
string
paths
:
Record
<
string
,
string
>
}
export
type
UtsOutputOptions
=
{
...
...
scripts/test.js
浏览文件 @
7ea00805
...
...
@@ -28,6 +28,9 @@ async function testKotlin() {
projectDir
,
'
uni_modules/test-uniplugin/utssdk/app-android/index.uts
'
),
paths
:
{
'
login
'
:
'
./login
'
}
},
output
:
{
outDir
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录