Skip to content

Commit

Permalink
harmony update stretch so
Browse files Browse the repository at this point in the history
  • Loading branch information
biezhihua committed Mar 13, 2024
1 parent 5aa48d2 commit 5e84436
Show file tree
Hide file tree
Showing 38 changed files with 274 additions and 187 deletions.
3 changes: 1 addition & 2 deletions GaiaXHarmony/GaiaX/build-profile.json5
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
},
"targets": [
{
"name": "default",
"runtimeOS": "HarmonyOS"
"name": "default"
}
]
}
3 changes: 1 addition & 2 deletions GaiaXHarmony/app/build-profile.json5
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
},
"targets": [
{
"name": "default",
"runtimeOS": "HarmonyOS"
"name": "default"
},
{
"name": "ohosTest",
Expand Down
14 changes: 14 additions & 0 deletions GaiaXHarmony/app/oh-package-lock.json5

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions GaiaXHarmony/build-profile.json5
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
}
}
],
"compileSdkVersion": 9,
"compatibleSdkVersion": 9,
"products": [
{
"name": "default",
"signingConfig": "default",
"compileSdkVersion": "4.1.0(11)",
"compatibleSdkVersion": "4.1.0(11)",
"runtimeOS": "HarmonyOS",
}
],
"buildModeSet": [
Expand Down
6 changes: 3 additions & 3 deletions GaiaXHarmony/hvigor/hvigor-config.json5
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"hvigorVersion": "3.0.2",
"hvigorVersion": "4.0.4",
"dependencies": {
"@ohos/hvigor-ohos-plugin": "3.0.2"
"@ohos/hvigor-ohos-plugin": "4.0.4"
},
"execution": {
// "daemon": true, /* Enable daemon compilation. Default: true */
Expand All @@ -15,4 +15,4 @@
"debugging": {
// "stacktrace": false /* Disable stacktrace compilation. Default: false */
}
}
}
7 changes: 5 additions & 2 deletions GaiaXHarmony/oh-package-lock.json5

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 8 additions & 7 deletions GaiaXStretch/bindings/harmony_stretch/build-profile.json5
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@
"name": "default",
"type": "HarmonyOS",
"material": {
"certpath": "/Users/biezhihua/.ohos/config/auto_debug_MyApplication4_com.bzh.test_40086000132854920.cer",
"storePassword": "0000001A85DB8ABE4DF59E88E2316E4344AFB02656027F0D31471ADD2768FAF07E630D219752D1B4E5C6",
"certpath": "/Users/biezhihua/.ohos/config/default_harmony_stretch_2qOVVPaMDyVnGeTMr4oZ_MlqeOm6upV7KS1kqYq1NEY=.cer",
"storePassword": "0000001BAA6F8986C3D83185375A2D995FF9313326B38ADC9A7240F83D17522D7B019A8035E860B63141C6",
"keyAlias": "debugKey",
"keyPassword": "0000001ABA9E49E16C60C54745286F416365349C533930F6CCC50AAAAC6EEC7438E1563BD145884511A2",
"profile": "/Users/biezhihua/.ohos/config/auto_debug_MyApplication4_com.bzh.test_40086000132854920.p7b",
"keyPassword": "0000001BF9EE1E916673FDAA804535AF7729AFD2BC8882B223C65816E08299685662125DD136246B52C199",
"profile": "/Users/biezhihua/.ohos/config/default_harmony_stretch_2qOVVPaMDyVnGeTMr4oZ_MlqeOm6upV7KS1kqYq1NEY=.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "/Users/biezhihua/.ohos/config/auto_debug_MyApplication4_com.bzh.test_40086000132854920.p12"
"storeFile": "/Users/biezhihua/.ohos/config/default_harmony_stretch_2qOVVPaMDyVnGeTMr4oZ_MlqeOm6upV7KS1kqYq1NEY=.p12"
}
}
],
"compileSdkVersion": 9,
"compatibleSdkVersion": 9,
"products": [
{
"name": "default",
"signingConfig": "default",
"compileSdkVersion": "4.0.0(10)",
"compatibleSdkVersion": "4.0.0(10)",
"runtimeOS": "HarmonyOS",
}
],
"buildModeSet": [
Expand Down
27 changes: 18 additions & 9 deletions GaiaXStretch/bindings/harmony_stretch/entry/build-profile.json5
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
{
"apiType": "stageMode",
"buildOption": {
"napiLibFilterOption": {
"enableOverride": true
"arkOptions": {
// "apPath": "./modules.ap" /* Profile used for profile-guided optimization (PGO), a compiler optimization technique to improve app runtime performance. */
},
"externalNativeOptions": {
"path": "./src/main/cpp/CMakeLists.txt",
"arguments": "",
"cppFlags": "",
"abiFilters": [
"armeabi-v7a",
"arm64-v8a",
"x86_64"
]
}
},
"buildOptionSet": [
{
"name": "release",
"arkOptions": {
"obfuscation": {
"ruleOptions": {
"enable": true,
"files": [
"./obfuscation-rules.txt"
]
}
}
}
},
],
"targets": [
{
"name": "default",
"runtimeOS": "HarmonyOS"
"name": "default"
},
{
"name": "ohosTest",
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 18 additions & 0 deletions GaiaXStretch/bindings/harmony_stretch/entry/obfuscation-rules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Define project specific obfuscation rules here.
# You can include the obfuscation configuration files in the current module's build-profile.json5.
#
# For more details, see
# https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md

# Obfuscation options:
# -disable-obfuscation: disable all obfuscations
# -enable-property-obfuscation: obfuscate the property names
# -enable-toplevel-obfuscation: obfuscate the names in the global scope
# -compact: remove unnecessary blank spaces and all line feeds
# -remove-log: remove all console.* statements
# -print-namecache: print the name cache that contains the mapping from the old names to new names
# -apply-namecache: reuse the given cache file

# Keep options:
# -keep-property-name: specifies property names that you want to keep
# -keep-global-name: specifies names that you want to keep in the global scope
14 changes: 14 additions & 0 deletions GaiaXStretch/bindings/harmony_stretch/entry/oh-package-lock.json5

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions GaiaXStretch/bindings/harmony_stretch/entry/oh-package.json5
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"license": "",
"devDependencies": {},
"author": "",
"name": "entry",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "",
"version": "1.0.0",
"author": "",
"license": "",
"dependencies": {
"libentry.so": "file:./src/main/cpp/types/libentry"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ include_directories(${NATIVERENDER_ROOT_PATH}
${NATIVERENDER_ROOT_PATH}/include)

add_library(entry SHARED hello.cpp)
target_link_libraries(entry PUBLIC libace_napi.z.so ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${OHOS_ARCH}/libtest.so)
target_link_libraries(entry PUBLIC libace_napi.z.so ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${OHOS_ARCH}/libstretch.so)
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#include "napi/native_api.h"

extern "C" void hello_from_rust();
extern "C" int hello2_from_rust(int a, int b);
extern "C" void println_hello_from_rusts();
extern "C" int add_two_int_from_rust(int a, int b);

static napi_value Add(napi_env env, napi_callback_info info) {

int ret = hello2_from_rust(10, 10);
int ret = add_two_int_from_rust(10, 15);

napi_value ret2;
napi_create_int32(env, ret, &ret2);

println_hello_from_rusts();

return ret2;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import Want from '@ohos.app.ability.Want';
import window from '@ohos.window';

export default class EntryAbility extends UIAbility {
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam) {
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
}

onDestroy() {
onDestroy(): void {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');
}

onWindowStageCreate(windowStage: window.WindowStage) {
onWindowStageCreate(windowStage: window.WindowStage): void {
// Main window is created, set main page for this ability
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');

Expand All @@ -26,17 +26,17 @@ export default class EntryAbility extends UIAbility {
});
}

onWindowStageDestroy() {
onWindowStageDestroy(): void {
// Main window is destroyed, release UI related resources
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
}

onForeground() {
onForeground(): void {
// Ability has brought to foreground
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
}

onBackground() {
onBackground(): void {
// Ability has back to background
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import hilog from '@ohos.hilog';
import testNapi from 'libentry.so'
import testNapi from 'libentry.so';

@Entry
@Component
struct Index {
@State message: string = 'Hello World'
@State message: string = 'Hello World';

build() {
Row() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
"mainElement": "EntryAbility",
"deviceTypes": [
"phone",
"tablet"
"tablet",
"2in1"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"abilities": [
{
"name": "EntryAbility",
"srcEntry": "./ets/entryability/EntryAbility.ts",
"srcEntry": "./ets/entryability/EntryAbility.ets",
"description": "$string:EntryAbility_desc",
"icon": "$media:icon",
"label": "$string:EntryAbility_label",
"startWindowIcon": "$media:icon",
"startWindowIcon": "$media:startIcon",
"startWindowBackground": "$color:start_window_background",
"exported": true,
"skills": [
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import hilog from '@ohos.hilog';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';

export default function abilityTest() {
describe('ActsAbilityTest', function () {
describe('ActsAbilityTest', () => {
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
beforeAll(function () {
beforeAll(() => {
// Presets an action, which is performed only once before all test cases of the test suite start.
// This API supports only one parameter: preset action function.
})
beforeEach(function () {
beforeEach(() => {
// Presets an action, which is performed before each unit test case starts.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: preset action function.
})
afterEach(function () {
afterEach(() => {
// Presets a clear action, which is performed after each unit test case ends.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: clear action function.
})
afterAll(function () {
afterAll(() => {
// Presets a clear action, which is performed after all test cases of the test suite end.
// This API supports only one parameter: clear action function.
})
it('assertContain',0, function () {
it('assertContain', 0, () => {
// Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
let a = 'abc'
let b = 'b'
let a = 'abc';
let b = 'b';
// Defines a variety of assertion methods, which are used to declare expected boolean conditions.
expect(a).assertContain(b)
expect(a).assertEqual(a)
expect(a).assertContain(b);
expect(a).assertEqual(a);
})
})
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import abilityTest from './Ability.test'
import abilityTest from './Ability.test';

export default function testsuite() {
abilityTest()
abilityTest();
}
Loading

0 comments on commit 5e84436

Please sign in to comment.