Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
6f44d4fd
U
uni-app
项目概览
DCloud
/
uni-app
6 个月 前同步成功
通知
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看板
提交
6f44d4fd
编写于
12月 30, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(uts): compiler
上级
8480de6e
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
14 addition
and
5 deletion
+14
-5
packages/playground/uts/uni_modules/test-component/utssdk/app-android/index.vue
...s/uni_modules/test-component/utssdk/app-android/index.vue
+0
-1
packages/playground/uts/unpackage/dist/dev/.sourcemap/app/uni_modules/test-component/utssdk/app-android/index.kt.map
...ni_modules/test-component/utssdk/app-android/index.kt.map
+1
-1
packages/uni-uts-v1/src/kotlin.ts
packages/uni-uts-v1/src/kotlin.ts
+6
-2
packages/uni-uts-v1/src/swift.ts
packages/uni-uts-v1/src/swift.ts
+5
-1
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/src/types.ts
packages/uts/src/types.ts
+1
-0
scripts/test.js
scripts/test.js
+1
-0
未找到文件。
packages/playground/uts/uni_modules/test-component/utssdk/app-android/index.vue
浏览文件 @
6f44d4fd
...
...
@@ -38,7 +38,6 @@ class CustomAnimListener extends Animator.AnimatorListener {
//原生提供以下属性或方法的实现
export
default
{
name
:
"
animation-view
"
,
/**
* 当播放到末尾时触发 ended 事件(自然播放结束会触发回调,循环播放结束及手动停止动画不会触发)
*/
...
...
packages/playground/uts/unpackage/dist/dev/.sourcemap/app/uni_modules/test-component/utssdk/app-android/index.kt.map
浏览文件 @
6f44d4fd
{"version":3,"sources":["uni_modules/test-component/utssdk/app-android/index.vue"],"sourcesContent":["\n\n\n\n\n\nimport Animator from 'android.animation.Animator'\nimport TextUtils from 'android.text.TextUtils'\nimport View from 'android.view.View'\nimport LottieAnimationView from 'com.airbnb.lottie.LottieAnimationView'\nimport LottieDrawable from 'com.airbnb.lottie.LottieDrawable'\n\n\nclass CustomAnimListener extends Animator.AnimatorListener {\n\n comp: UTSComponent<LottieAnimationView>\n constructor(com: UTSComponent<LottieAnimationView>) {\n super();\n this.comp = com\n }\n\n override onAnimationStart(animation: Animator | null) {\n }\n\n override onAnimationEnd(animation: Animator | null, isReverse: Boolean) {\n this.comp.emit(\"bindended\")\n }\n\n override onAnimationEnd(animation: Animator | null) {\n }\n\n override onAnimationCancel(animation: Animator | null) {\n }\n\n override onAnimationRepeat(animation: Animator | null) {\n }\n}\n\n//原生提供以下属性或方法的实现 \nexport default {\n name: \"animation-view\",\n /**\n * 当播放到末尾时触发 ended 事件(自然播放结束会触发回调,循环播放结束及手动停止动画不会触发)\n */\n emits: ['bindended'],\n props: {\n /**\n * 动画资源地址,目前只支持绝对路径\n */\n \"path\": {\n type: String,\n\t\t\tdefault:\"\"\n },\n /**\n * 动画是否循环播放\n */\n \"autoplay\": {\n type: Boolean,\n\t\t\tdefault:false\n },\n /**\n * 动画是否自动播放\n */\n \"loop\": {\n type: Boolean,\n\t\t\tdefault:false\n },\n /**\n * 是否隐藏动画\n */\n \"hidden\": {\n type: Boolean,\n\t\t\tdefault:false\n },\n /**\n * 动画操作,可取值 play、pause、stop\n */\n \"action\": {\n type: String,\n\t\t\tdefault:\"stop\"\n }\n\n },\n data() {\n return {\n\n }\n },\n watch: {\n \"path\": {\n handler(newPath: string, oldPath: string) {\n\n let lottieAnimationView = this.$el\n\n if (lottieAnimationView != null && !TextUtils.isEmpty(newPath)) {\n if (newPath.startsWith(\"http://\") || newPath.startsWith(\"https://\")) {\n lottieAnimationView.setAnimationFromUrl(newPath)\n } else {\n // 默认是asset了\n lottieAnimationView.setAnimation(newPath)\n }\n }\n if (this.autoplay) {\n lottieAnimationView.playAnimation()\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n \"loop\": {\n handler(newLoop: Boolean, oldLoop: Boolean) {\n\n if (newLoop) {\n this.$el.repeatCount = Int.MAX_VALUE\n } else {\n // 不循环则设置成1次\n this.$el.repeatCount = 0\n }\n\n if (this.autoplay) {\n this.$el.playAnimation()\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n\n \"autoplay\": {\n handler(newValue: boolean, oldValue: boolean) {\n\n if (newValue) {\n this.$el.playAnimation()\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n\n \"action\": {\n handler(newAction: string, oldAction: string) {\n\n if (newAction == \"play\" || newAction == \"pause\" || newAction == \"stop\") {\n\n\n if (this.action == \"play\") {\n this.$el.playAnimation()\n } else if (this.action == \"play\") {\n this.$el.pauseAnimation()\n } else if (this.action == \"stop\") {\n this.$el.cancelAnimation()\n this.$el.clearAnimation()\n }\n\n } else {\n // 非法入参,不管\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n\n \"hidden\": {\n handler(newValue: boolean, oldValue: boolean) {\n\n if (newValue) {\n this.$el.visibility = View.GONE\n } else {\n this.$el.visibility = View.VISIBLE\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n\n },\n methods: {\n setRepeatMode(repeat: string) {\n if (\"RESTART\" == repeat) {\n this.$el.repeatMode = LottieDrawable.RESTART\n } else if (\"REVERSE\" == repeat) {\n this.$el.repeatMode = LottieDrawable.RESTART\n }\n },\n privateMethod() {\t//如何定义不对外暴露的API? 暂不支持,需在export外写 \n }\n },\n created() {\t\t\t//创建组件,替换created \n\n },\n NVBeforeLoad() {\t\t//组件将要创建,对应前端beforeMount \n //可选实现,这里可以提前做一些操作 \n },\n NVLoad(): LottieAnimationView { //创建原生View,必须定义返回值类型(Android需要明确知道View类型,需特殊校验) \n //必须实现 \n let lottieAnimationView = new LottieAnimationView(getContext())\n return lottieAnimationView\n },\n NVLoaded() {\t\t\t//原生View已创建 \n //可选实现,这里可以做后续操作 \n this.$el.repeatMode = LottieDrawable.RESTART;\n this.$el.visibility = View.GONE\n this.$el.repeatCount = 0\n this.$el.addAnimatorListener(new CustomAnimListener(this))\n\n },\n NVLayouted() {\t//原生View布局完成 \n //可选实现,这里可以做布局后续操作 \n },\n NVBeforeUnload() {\t\t//原生View将释放 \n //可选实现,这里可以做释放View之前的操作 \n },\n NVUnloaded() {\t\t\t//原生View已释放 \n //可选实现,这里可以做释放View之后的操作 \n },\n unmounted() {\t//组件销毁 \n //可选实现 \n }\n}\n\n\n\n\n\n\n\n\n"],"names":[],"mappings":";;;;;;AAMA,OAAqB,0BAA4B,CAAA;AACjD,OAAsB,sBAAwB,CAAA;AAC9C,OAAiB,iBAAmB,CAAA;AACpC,OAAgC,qCAAuC,CAAA;AACvE,OAA2B,gCAAkC,CAAA;;;;;;;AAG7D,WAAM,qBAA2B,SAAS,gBAAgB;IAEtD,SAAA,MAAM,aAAa,qBAAoB;IACvC,YAAY,KAAK,aAAa,oBAAoB,IAC9C,KAAK,GAD2C;QAEhD,IAAI,CAAC,IAAI,GAAG;IAChB;IAEA,aAAS,iBAAiB,WAAW,SAAe,EAAE,CACtD;IAEA,aAAS,eAAe,WAAW,SAAe,EAAE,WAAW,OAAO,EAAE;QACpE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACnB;IAEA,aAAS,eAAe,WAAW,SAAe,EAAE,CACpD;IAE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AAC,QAAQ,EACb,IAAI,CAAC,KAAG,CAAC,aAAa;QAE9B;;sBAKqC,OAAO,kBAApC,UAAmB,SAAmB;YAE1C,IAAI,UACA,IAAI,CAAC,KAAG,CAAC,aAAa;QAE9B;;sBAKsC,MAAM,gBAApC,WAAmB,UAAmB;YAE1C,IAAI,aAAa,UAAU,aAAa,WAAW,aAAa,QAAQ;gBAGpE,IAAI,IAAI,CAAC,MAAM,IAAI,QACf,IAAI,CAAC,KAAG,CAAC,aAAa;qBACnB,IAAI,IAAI,CAAC,MAAM,IAAI,QACtB,IAAI,CAAC,KAAG,CAAC,cAAc;qBACpB,IAAI,IAAI,CAAC,MAAM,IAAI,QAAQ;oBAC9B,IAAI,CAAC,KAAG,CAAC,eAAe;oBACxB,IAAI,CAAC,KAAG,CAAC,cAAc;gBAC3B;YAEJ;QAGJ;;sBAKqC,OAAO,gBAApC,UAAmB,SAAmB;YAE1C,IAAI,UACA,IAAI,CAAC,KAAG,CAAC,UAAU,GAAG,KAAK,IAAI;iBAE/B,IAAI,CAAC,KAAG,CAAC,UAAU,GAAG,KAAK,OAAO;QAE1C;;;;qCAnHM;;;;;yCAOA;;;;;qCAOA;;;;;uCAOA;;;;;uCAOA"}
\ No newline at end of file
{"version":3,"sources":["uni_modules/test-component/utssdk/app-android/index.vue"],"sourcesContent":["\n\n\n\n\n\nimport Animator from 'android.animation.Animator'\nimport TextUtils from 'android.text.TextUtils'\nimport View from 'android.view.View'\nimport LottieAnimationView from 'com.airbnb.lottie.LottieAnimationView'\nimport LottieDrawable from 'com.airbnb.lottie.LottieDrawable'\n\n\nclass CustomAnimListener extends Animator.AnimatorListener {\n\n comp: UTSComponent<LottieAnimationView>\n constructor(com: UTSComponent<LottieAnimationView>) {\n super();\n this.comp = com\n }\n\n override onAnimationStart(animation: Animator | null) {\n }\n\n override onAnimationEnd(animation: Animator | null, isReverse: Boolean) {\n this.comp.emit(\"bindended\")\n }\n\n override onAnimationEnd(animation: Animator | null) {\n }\n\n override onAnimationCancel(animation: Animator | null) {\n }\n\n override onAnimationRepeat(animation: Animator | null) {\n }\n}\n\n//原生提供以下属性或方法的实现 \nexport default {\n /**\n * 当播放到末尾时触发 ended 事件(自然播放结束会触发回调,循环播放结束及手动停止动画不会触发)\n */\n emits: ['bindended'],\n props: {\n /**\n * 动画资源地址,目前只支持绝对路径\n */\n \"path\": {\n type: String,\n\t\t\tdefault:\"\"\n },\n /**\n * 动画是否循环播放\n */\n \"autoplay\": {\n type: Boolean,\n\t\t\tdefault:false\n },\n /**\n * 动画是否自动播放\n */\n \"loop\": {\n type: Boolean,\n\t\t\tdefault:false\n },\n /**\n * 是否隐藏动画\n */\n \"hidden\": {\n type: Boolean,\n\t\t\tdefault:false\n },\n /**\n * 动画操作,可取值 play、pause、stop\n */\n \"action\": {\n type: String,\n\t\t\tdefault:\"stop\"\n }\n\n },\n data() {\n return {\n\n }\n },\n watch: {\n \"path\": {\n handler(newPath: string, oldPath: string) {\n\n let lottieAnimationView = this.$el\n\n if (lottieAnimationView != null && !TextUtils.isEmpty(newPath)) {\n if (newPath.startsWith(\"http://\") || newPath.startsWith(\"https://\")) {\n lottieAnimationView.setAnimationFromUrl(newPath)\n } else {\n // 默认是asset了\n lottieAnimationView.setAnimation(newPath)\n }\n }\n if (this.autoplay) {\n lottieAnimationView.playAnimation()\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n \"loop\": {\n handler(newLoop: Boolean, oldLoop: Boolean) {\n\n if (newLoop) {\n this.$el.repeatCount = Int.MAX_VALUE\n } else {\n // 不循环则设置成1次\n this.$el.repeatCount = 0\n }\n\n if (this.autoplay) {\n this.$el.playAnimation()\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n\n \"autoplay\": {\n handler(newValue: boolean, oldValue: boolean) {\n\n if (newValue) {\n this.$el.playAnimation()\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n\n \"action\": {\n handler(newAction: string, oldAction: string) {\n\n if (newAction == \"play\" || newAction == \"pause\" || newAction == \"stop\") {\n\n\n if (this.action == \"play\") {\n this.$el.playAnimation()\n } else if (this.action == \"play\") {\n this.$el.pauseAnimation()\n } else if (this.action == \"stop\") {\n this.$el.cancelAnimation()\n this.$el.clearAnimation()\n }\n\n } else {\n // 非法入参,不管\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n\n \"hidden\": {\n handler(newValue: boolean, oldValue: boolean) {\n\n if (newValue) {\n this.$el.visibility = View.GONE\n } else {\n this.$el.visibility = View.VISIBLE\n }\n },\n immediate: false //创建时是否通过此方法更新属性,默认值为false \n },\n\n },\n methods: {\n setRepeatMode(repeat: string) {\n if (\"RESTART\" == repeat) {\n this.$el.repeatMode = LottieDrawable.RESTART\n } else if (\"REVERSE\" == repeat) {\n this.$el.repeatMode = LottieDrawable.RESTART\n }\n },\n privateMethod() {\t//如何定义不对外暴露的API? 暂不支持,需在export外写 \n }\n },\n created() {\t\t\t//创建组件,替换created \n\n },\n NVBeforeLoad() {\t\t//组件将要创建,对应前端beforeMount \n //可选实现,这里可以提前做一些操作 \n },\n NVLoad(): LottieAnimationView { //创建原生View,必须定义返回值类型(Android需要明确知道View类型,需特殊校验) \n //必须实现 \n let lottieAnimationView = new LottieAnimationView(getContext())\n return lottieAnimationView\n },\n NVLoaded() {\t\t\t//原生View已创建 \n //可选实现,这里可以做后续操作 \n this.$el.repeatMode = LottieDrawable.RESTART;\n this.$el.visibility = View.GONE\n this.$el.repeatCount = 0\n this.$el.addAnimatorListener(new CustomAnimListener(this))\n\n },\n NVLayouted() {\t//原生View布局完成 \n //可选实现,这里可以做布局后续操作 \n },\n NVBeforeUnload() {\t\t//原生View将释放 \n //可选实现,这里可以做释放View之前的操作 \n },\n NVUnloaded() {\t\t\t//原生View已释放 \n //可选实现,这里可以做释放View之后的操作 \n },\n unmounted() {\t//组件销毁 \n //可选实现 \n }\n}\n\n\n\n\n\n\n\n\n"],"names":[],"mappings":";;;;;;AAMA,OAAqB,0B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OA"}
\ No newline at end of file
packages/uni-uts-v1/src/kotlin.ts
浏览文件 @
6f44d4fd
...
...
@@ -55,9 +55,10 @@ export function createKotlinResolveTypeReferenceName(
function
parseKotlinPackage
(
filename
:
string
)
{
const
res
=
resolvePackage
(
filename
)
if
(
!
res
)
{
return
{
package
:
''
}
return
{
id
:
''
,
package
:
''
}
}
return
{
id
:
res
.
id
,
package
:
parseKotlinPackageWithPluginId
(
res
.
name
,
res
.
is_uni_modules
),
}
}
...
...
@@ -311,9 +312,11 @@ export async function compile(
imports
.
push
(
rClass
)
}
const
componentsCode
=
genComponentsCode
(
filename
,
components
)
const
{
package
:
pluginPackage
,
id
:
pluginId
}
=
parseKotlinPackage
(
filename
)
const
input
:
Parameters
<
typeof
bundle
>
[
1
][
'
input
'
]
=
{
root
:
inputDir
,
filename
,
pluginId
,
}
const
isUTSFileExists
=
fs
.
existsSync
(
filename
)
if
(
componentsCode
)
{
...
...
@@ -329,12 +332,13 @@ export async function compile(
return
}
}
const
result
=
await
bundle
(
UtsTarget
.
KOTLIN
,
{
input
,
output
:
{
isPlugin
:
true
,
outDir
:
outputDir
,
package
:
p
arseKotlinPackage
(
filename
).
p
ackage
,
package
:
p
luginP
ackage
,
sourceMap
:
sourceMap
?
resolveUTSSourceMapPath
()
:
false
,
extname
:
'
kt
'
,
imports
,
...
...
packages/uni-uts-v1/src/swift.ts
浏览文件 @
6f44d4fd
...
...
@@ -20,11 +20,13 @@ function parseSwiftPackage(filename: string) {
const
res
=
resolvePackage
(
filename
)
if
(
!
res
)
{
return
{
id
:
''
,
namespace
:
''
,
}
}
const
namespace
=
parseSwiftPackageWithPluginId
(
res
.
name
,
res
.
is_uni_modules
)
return
{
id
:
res
.
id
,
namespace
,
}
}
...
...
@@ -161,9 +163,11 @@ export async function compile(
const
{
bundle
,
UtsTarget
}
=
getUtsCompiler
()
// let time = Date.now()
const
componentsCode
=
genComponentsCode
(
filename
,
components
)
const
{
namespace
,
id
:
pluginId
}
=
parseSwiftPackage
(
filename
)
const
input
:
Parameters
<
typeof
bundle
>
[
1
][
'
input
'
]
=
{
root
:
inputDir
,
filename
,
pluginId
,
}
const
isUTSFileExists
=
fs
.
existsSync
(
filename
)
if
(
componentsCode
)
{
...
...
@@ -184,7 +188,7 @@ export async function compile(
output
:
{
isPlugin
:
true
,
outDir
:
outputDir
,
package
:
parseSwiftPackage
(
filename
).
namespace
,
package
:
namespace
,
sourceMap
:
sourceMap
?
resolveUTSSourceMapPath
()
:
false
,
extname
:
'
swift
'
,
imports
:
[
'
DCloudUTSFoundation
'
],
...
...
packages/uts-darwin-arm64/uts.darwin-arm64.node
浏览文件 @
6f44d4fd
无法预览此类型文件
packages/uts-darwin-x64/uts.darwin-x64.node
浏览文件 @
6f44d4fd
无法预览此类型文件
packages/uts/src/types.ts
浏览文件 @
6f44d4fd
...
...
@@ -17,6 +17,7 @@ export type UtsParseOptions = UtsParserConfig & {
export
type
UtsInputOptions
=
UtsParseOptions
&
{
root
:
string
pluginId
:
string
filename
:
string
fileContent
?:
string
fileAppendContent
?:
string
...
...
scripts/test.js
浏览文件 @
6f44d4fd
...
...
@@ -89,6 +89,7 @@ async function testKotlinComponent() {
await
bundle
(
UtsTarget
.
KOTLIN
,
{
input
:
{
root
:
projectDir
,
pluginId
:
'
animation-view
'
,
filename
:
path
.
resolve
(
projectDir
,
'
uni_modules/test-component/utssdk/app-android/index.uts
'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录