提交 f7dfad36 编写于 作者: fxy060608's avatar fxy060608

chore: build

上级 07ac6620
......@@ -13,7 +13,7 @@
"size": "npm run build size-check",
"lint": "eslint packages/*/src/**/*.ts",
"format": "prettier --write --parser typescript \"packages/**/*.ts?(x)\"",
"test": "tsc -p ./test-dts/tsconfig.json && jest",
"test": "tsc -p ./test-dts/tsconfig.json && jest && node scripts/test.js",
"test-dts": "tsc -p ./test-dts/tsconfig.json && tsc -p ./test-dts/tsconfig.build.json",
"preinstall": "node ./scripts/preinstall.js",
"e2e:ssr:dev": "cd packages/playground/ssr && npm run dev:ssr",
......
import Intent from "android.content.Intent";
import JSONObject from "com.alibaba.fastjson.JSONObject";
import UniModule from "io.dcloud.feature.uniapp.common.UniModule";
import UniJSMethod from "io.dcloud.feature.uniapp.annotation.UniJSMethod";
import UniJSCallback from "io.dcloud.feature.uniapp.bridge.UniJSCallback";
import log from "./log";
export default class TestModule extends UniModule() {
TAG = "TestModule";
static REQUEST_CODE = 1000;
//run ui thread
@UniJSMethod({ uiThread: true })
testAsyncFunc(options: JSONObject, callback?: UniJSCallback) {
log(this.TAG, "testAsyncFunc--$options");
if (callback != null) {
const data = new JSONObject();
data["code"] = "success12312";
callback.invoke(data);
}
}
//run JS thread
@UniJSMethod({ uiThread: false })
testSyncFunc(options: JSONObject): JSONObject {
const data = new JSONObject();
data["code"] = "success456";
return data;
}
override onActivityResult(requestCode: Int, resultCode: Int, data: Intent) {
if (requestCode == TestModule.REQUEST_CODE && data.hasExtra("respond")) {
log(this.TAG, "原生页面返回----" + data.getStringExtra("respond"));
} else {
super.onActivityResult(requestCode, resultCode, data);
}
}
}
import Log from "android.util.Log";
export default function log(tag: string, msg: string) {
Log.e(tag, msg);
}
{
"name": "UTS Plugin",
"id": "DCloud-UTSPlugin",
"version": "0.0.1",
"description": "UTS示例插件",
"_dp_type":"nativeplugin",
"_dp_nativeplugin":{
"android": {
"plugins": [
{
"type": "module",
"name": "DCloud-UTSPlugin",
"class": "io.dcloud.uniplugin.TestModule"
},
{
"type": "component",
"name": "uts-richtext",
"class": "io.dcloud.uniplugin.TestComponent"
}
],
"integrateType": "uts",
"dependencies":[
{
"id": "com.zzhoujay.richtext:richtext",
"source": "implementation 'com.zzhoujay.richtext:richtext:3.0.7'"
}
],
"minSdkVersion" : 21
}
}
}
\ No newline at end of file
package io.dcloud.uniplugin.TestModule;
import android.content.Intent;
import com.alibaba.fastjson.JSONObject;
import io.dcloud.feature.uniapp.common.UniModule;
import io.dcloud.feature.uniapp.annotation.UniJSMethod;
import io.dcloud.feature.uniapp.bridge.UniJSCallback;
import io.dcloud.uniplugin.log.log;
open class TestModule : UniModule() {
open var TAG = "TestModule";
@UniJSMethod( uiThread = true )
open fun testAsyncFunc(options: JSONObject, callback: UniJSCallback?) {
log(this.TAG, "testAsyncFunc--$options");
if (callback != null) {
val data = JSONObject();
data["code"] = "success12312";
callback.invoke(data);
}
}
@UniJSMethod( uiThread = false )
open fun testSyncFunc(options: JSONObject): JSONObject {
val data = JSONObject();
data["code"] = "success456";
return data;
}
override open fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) {
if (requestCode == TestModule.REQUEST_CODE && data.hasExtra("respond")) {
log(this.TAG, "原生页面返回----" + data.getStringExtra("respond"));
}
else {
super.onActivityResult(requestCode, resultCode, data);
}
}
companion object {
var REQUEST_CODE = 1000;
}
}
{"version":3,"sources":["/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/TestModule.uts"],"names":["TestModule","UniModule","TAG","UniJSMethod","uiThread","testAsyncFunc","options","callback","log","data","JSONObject","invoke","testSyncFunc","onActivityResult","requestCode","resultCode","REQUEST_CODE","hasExtra","getStringExtra"],"mappings":";AAAA,OAAmB,sBAAwB,CAAC;AAC5C,OAAuB,+BAAiC,CAAC;AACzD,OAAsB,yCAA2C,CAAC;AAClE,OAAwB,+CAAiD,CAAC;AAC1E,OAA0B,6CAA+C,CAAC;AAC1E,OAA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log;
import android.util.Log;
fun log(tag: String, msg: String) {
Log.e(tag, msg);
}
{"version":3,"sources":["/Users/fxy/Projects/GitHub/uni-app/uni-app-next/packages/playground/uts/nativeplugins/test-uniplugin/android/src/io/dcloud/uniplugin/log.uts"],"names":["log","tag","msg","Log","e"],"mappings":"AAAA;AAAA,OAAgB,gBAAkB,CAAC;AACpB,IAASA,GAAG,CAACC,GAAW,EAAN,MAAM,EAAEC,GAAW,EAAN,MAAM,EAAE;IACpDC,GAAG,CAACC,CAAC,CAACH,GAAG,EAAEC,GAAG,CAAC,CAAC"}
\ No newline at end of file
{
"name": "UTS Plugin",
"id": "DCloud-UTSPlugin",
"version": "0.0.1",
"description": "UTS示例插件",
"_dp_type":"nativeplugin",
"_dp_nativeplugin":{
"android": {
"plugins": [
{
"type": "module",
"name": "DCloud-UTSPlugin",
"class": "io.dcloud.uniplugin.TestModule"
},
{
"type": "component",
"name": "uts-richtext",
"class": "io.dcloud.uniplugin.TestComponent"
}
],
"integrateType": "uts",
"dependencies":[
{
"id": "com.zzhoujay.richtext:richtext",
"source": "implementation 'com.zzhoujay.richtext:richtext:3.0.7'"
}
],
"minSdkVersion" : 21
}
}
}
\ No newline at end of file
......@@ -14095,7 +14095,7 @@ const publishRecorderStateChange = (state, res = {}) => {
const Recorder = {
start({ duration = 60000, sampleRate, numberOfChannels, encodeBitRate, format = 'mp3', frameSize,
// audioSource = 'auto',
}) {
} = {}) {
if (recording) {
return publishRecorderStateChange('start');
}
......@@ -14178,7 +14178,7 @@ class RecorderManager {
resume() {
Recorder.resume();
}
start(options) {
start(options = {}) {
Recorder.start(options);
}
stop() {
......
const path = require('path')
const { runBuild, UtsTarget } = require('../packages/uts/dist')
const projectDir = path.resolve(__dirname, '../packages/playground/uts')
// uts
runBuild(UtsTarget.KOTLIN, {
silent: false,
input: {
dir: path.resolve(projectDir, 'nativeplugins/test-uniplugin'),
extname: '.uts',
},
output: {
dir: path.resolve(projectDir, 'unpackage/nativeplugins/test-uniplugin'),
sourceMap: true,
inlineSourcesContent: false,
},
})
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册