init project
This commit is contained in:
commit
17f8f49968
16
.gitignore
vendored
Normal file
16
.gitignore
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
/node_modules
|
||||
/oh_modules
|
||||
/local.properties
|
||||
/.idea
|
||||
**/build
|
||||
/.hvigor
|
||||
.cxx
|
||||
/.clangd
|
||||
/.clang-format
|
||||
/.clang-tidy
|
||||
**/.test
|
||||
/.appanalyzer
|
||||
**/cj_res
|
||||
**/*.cj.macrocall
|
||||
**/ability_mainability_entry.cj
|
||||
**/module_**_entry.cj
|
10
AppScope/app.json5
Normal file
10
AppScope/app.json5
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"app": {
|
||||
"bundleName": "com.example.himi",
|
||||
"vendor": "example",
|
||||
"versionCode": 1000000,
|
||||
"versionName": "1.0.0",
|
||||
"icon": "$media:app_icon",
|
||||
"label": "$string:app_name"
|
||||
}
|
||||
}
|
8
AppScope/resources/base/element/string.json
Normal file
8
AppScope/resources/base/element/string.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"string": [
|
||||
{
|
||||
"name": "app_name",
|
||||
"value": "himi"
|
||||
}
|
||||
]
|
||||
}
|
BIN
AppScope/resources/base/media/app_icon.png
Normal file
BIN
AppScope/resources/base/media/app_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
41
build-profile.json5
Normal file
41
build-profile.json5
Normal file
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"app": {
|
||||
"signingConfigs": [],
|
||||
"products": [
|
||||
{
|
||||
"name": "default",
|
||||
"signingConfig": "default",
|
||||
"compatibleSdkVersion": "5.0.0(12)",
|
||||
"runtimeOS": "HarmonyOS",
|
||||
"buildOption": {
|
||||
"strictMode": {
|
||||
"caseSensitiveCheck": true,
|
||||
"useNormalizedOHMUrl": true
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"buildModeSet": [
|
||||
{
|
||||
"name": "debug",
|
||||
},
|
||||
{
|
||||
"name": "release"
|
||||
}
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"name": "entry",
|
||||
"srcPath": "./entry",
|
||||
"targets": [
|
||||
{
|
||||
"name": "default",
|
||||
"applyToProducts": [
|
||||
"default"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
20
code-linter.json5
Normal file
20
code-linter.json5
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"files": [
|
||||
"**/*.ets"
|
||||
],
|
||||
"ignore": [
|
||||
"**/src/ohosTest/**/*",
|
||||
"**/src/test/**/*",
|
||||
"**/src/mock/**/*",
|
||||
"**/node_modules/**/*",
|
||||
"**/oh_modules/**/*",
|
||||
"**/build/**/*",
|
||||
"**/.preview/**/*"
|
||||
],
|
||||
"ruleSet": [
|
||||
"plugin:@performance/recommended",
|
||||
"plugin:@typescript-eslint/recommended"
|
||||
],
|
||||
"rules": {
|
||||
}
|
||||
}
|
6
entry/.gitignore
vendored
Normal file
6
entry/.gitignore
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
/node_modules
|
||||
/oh_modules
|
||||
/.preview
|
||||
/build
|
||||
/.cxx
|
||||
/.test
|
15
entry/build-profile.json5
Normal file
15
entry/build-profile.json5
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"apiType": "stageMode",
|
||||
"buildOption": {
|
||||
"cangjieOptions": {
|
||||
"path": "./src/main/cangjie/cjpm.toml"
|
||||
}
|
||||
},
|
||||
"buildOptionSet": [
|
||||
],
|
||||
"targets": [
|
||||
{
|
||||
"name": "default"
|
||||
}
|
||||
]
|
||||
}
|
6
entry/hvigorfile.ts
Normal file
6
entry/hvigorfile.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
import { hapTasks } from '@ohos/cangjie-build-support';
|
||||
|
||||
export default {
|
||||
system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
|
||||
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
|
||||
}
|
10
entry/oh-package.json5
Normal file
10
entry/oh-package.json5
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"name": "entry",
|
||||
"version": "1.0.0",
|
||||
"description": "Please describe the basic information.",
|
||||
"main": "",
|
||||
"author": "",
|
||||
"license": "",
|
||||
"dependencies": {}
|
||||
}
|
||||
|
3
entry/src/main/cangjie/cjpm.lock
Normal file
3
entry/src/main/cangjie/cjpm.lock
Normal file
|
@ -0,0 +1,3 @@
|
|||
version = 0
|
||||
|
||||
[requires]
|
37
entry/src/main/cangjie/cjpm.toml
Normal file
37
entry/src/main/cangjie/cjpm.toml
Normal file
|
@ -0,0 +1,37 @@
|
|||
[target.aarch64-linux-ohos]
|
||||
compile-option = "-B \"${DEVECO_CANGJIE_HOME}/compiler/third_party/llvm/bin\" -B \"${DEVECO_CANGJIE_HOME}/musl/usr/lib/aarch64-linux-ohos\" -L \"${DEVECO_CANGJIE_HOME}/musl/usr/lib/aarch64-linux-ohos\" -L \"${DEVECO_CANGJIE_HOME}/build/linux_ohos_aarch64_llvm/openssl\" --sysroot \"${DEVECO_CANGJIE_HOME}/musl\""
|
||||
|
||||
[target.x86_64-linux-ohos]
|
||||
compile-option = "-B \"${DEVECO_CANGJIE_HOME}/compiler/third_party/llvm/bin\" -B \"${DEVECO_CANGJIE_HOME}/musl/usr/lib/x86_64-linux-ohos\" -L \"${DEVECO_CANGJIE_HOME}/musl/usr/lib/x86_64-linux-ohos\" -L \"${DEVECO_CANGJIE_HOME}/build/linux_ohos_x86_64_llvm/openssl\" --sysroot \"${DEVECO_CANGJIE_HOME}/musl\""
|
||||
|
||||
[dependencies]
|
||||
cj_res_entry = {path = "./cj_res", version = "1.0.0"}
|
||||
|
||||
[package]
|
||||
cjc-version = "0.48.2"
|
||||
compile-option = ""
|
||||
description = "CangjieUI Application"
|
||||
link-option = ""
|
||||
name = "ohos_app_cangjie_entry"
|
||||
output-type = "dynamic"
|
||||
src-dir = "src"
|
||||
target-dir = ""
|
||||
version = "1.0.0"
|
||||
package-configuration = {}
|
||||
scripts = {}
|
||||
|
||||
[target.aarch64-linux-ohos.bin-dependencies]
|
||||
path-option = ["${AARCH64_LIBS}", "${AARCH64_MACRO_LIBS}", "${AARCH64_KIT_LIBS}"]
|
||||
package-option = {}
|
||||
|
||||
[target.x86_64-linux-ohos.bin-dependencies]
|
||||
path-option = ["${X86_64_OHOS_LIBS}", "${X86_64_OHOS_MACRO_LIBS}", "${X86_64_OHOS_KIT_LIBS}"]
|
||||
|
||||
[target.x86_64-unknown-windows-gnu.bin-dependencies]
|
||||
path-option = ["${X86_64_LIBS}", "${X86_64_MACRO_LIBS}"]
|
||||
package-option = {}
|
||||
|
||||
[profile]
|
||||
build = {incremental = true, lto = ""}
|
||||
customized-option = {debug = "-g -Woff all", release = "--fast-math -O2 -s -Woff all"}
|
||||
test = {}
|
12
entry/src/main/cangjie/src/ability_stage.cj
Normal file
12
entry/src/main/cangjie/src/ability_stage.cj
Normal file
|
@ -0,0 +1,12 @@
|
|||
package ohos_app_cangjie_entry
|
||||
|
||||
internal import ohos.ability.Ability
|
||||
internal import ohos.ability.Want
|
||||
internal import ohos.ability.LaunchParam
|
||||
internal import ohos.window.WindowStage
|
||||
|
||||
class MyAbilityStage <: AbilityStage {
|
||||
public override func onCreate(): Unit {
|
||||
AppLog.info("MyAbilityStage onCreated.")
|
||||
}
|
||||
}
|
34
entry/src/main/cangjie/src/index.cj
Normal file
34
entry/src/main/cangjie/src/index.cj
Normal file
|
@ -0,0 +1,34 @@
|
|||
package ohos_app_cangjie_entry
|
||||
|
||||
internal import ohos.base.LengthProp
|
||||
internal import ohos.component.Column
|
||||
internal import ohos.component.Row
|
||||
internal import ohos.component.Button
|
||||
internal import ohos.component.Text
|
||||
internal import ohos.component.CustomView
|
||||
internal import ohos.component.CJEntry
|
||||
internal import ohos.component.loadNativeView
|
||||
internal import ohos.state_manage.SubscriberManager
|
||||
internal import ohos.state_manage.ObservedProperty
|
||||
internal import ohos.state_manage.LocalStorage
|
||||
import ohos.state_macro_manage.Entry
|
||||
import ohos.state_macro_manage.Component
|
||||
import ohos.state_macro_manage.State
|
||||
import ohos.state_macro_manage.r
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
class MyView {
|
||||
@State
|
||||
var message: String = "Hello Cangjie"
|
||||
|
||||
func build() {
|
||||
Row {
|
||||
Column {
|
||||
Button(message).onClick {
|
||||
evt => AppLog.info("Hello Cangjie")
|
||||
}.fontSize(40).height(80)
|
||||
}.width(100.percent)
|
||||
}.height(100.percent)
|
||||
}
|
||||
}
|
26
entry/src/main/cangjie/src/main_ability.cj
Normal file
26
entry/src/main/cangjie/src/main_ability.cj
Normal file
|
@ -0,0 +1,26 @@
|
|||
package ohos_app_cangjie_entry
|
||||
|
||||
internal import ohos.base.AppLog
|
||||
internal import ohos.ability.AbilityStage
|
||||
internal import ohos.ability.LaunchReason
|
||||
internal import cj_res_entry.app
|
||||
|
||||
class MainAbility <: Ability {
|
||||
public init() {
|
||||
super()
|
||||
registerSelf()
|
||||
}
|
||||
|
||||
public override func onCreate(want: Want, launchParam: LaunchParam): Unit {
|
||||
AppLog.info("MainAbility OnCreated.${want.abilityName}")
|
||||
match (launchParam.launchReason) {
|
||||
case LaunchReason.START_ABILITY => AppLog.info("START_ABILITY")
|
||||
case _ => ()
|
||||
}
|
||||
}
|
||||
|
||||
public override func onWindowStageCreate(windowStage: WindowStage): Unit {
|
||||
AppLog.info("MainAbility onWindowStageCreate.")
|
||||
windowStage.loadContent("MyView")
|
||||
}
|
||||
}
|
36
entry/src/main/module.json5
Normal file
36
entry/src/main/module.json5
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"module": {
|
||||
"name": "entry",
|
||||
"type": "entry",
|
||||
"description": "$string:module_desc",
|
||||
"mainElement": "EntryAbility",
|
||||
"deviceTypes": [
|
||||
"phone"
|
||||
],
|
||||
"deliveryWithInstall": true,
|
||||
"installationFree": false,
|
||||
"srcEntry": "ohos_app_cangjie_entry.MyAbilityStage",
|
||||
"abilities": [
|
||||
{
|
||||
"name": "EntryAbility",
|
||||
"srcEntry": "ohos_app_cangjie_entry.MainAbility",
|
||||
"description": "$string:EntryAbility_desc",
|
||||
"icon": "$media:layered_image",
|
||||
"label": "$string:EntryAbility_label",
|
||||
"startWindowIcon": "$media:startIcon",
|
||||
"startWindowBackground": "$color:start_window_background",
|
||||
"exported": true,
|
||||
"skills": [
|
||||
{
|
||||
"entities": [
|
||||
"entity.system.home"
|
||||
],
|
||||
"actions": [
|
||||
"action.system.home"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
8
entry/src/main/resources/base/element/color.json
Normal file
8
entry/src/main/resources/base/element/color.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"color": [
|
||||
{
|
||||
"name": "start_window_background",
|
||||
"value": "#FFFFFF"
|
||||
}
|
||||
]
|
||||
}
|
16
entry/src/main/resources/base/element/string.json
Normal file
16
entry/src/main/resources/base/element/string.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"string": [
|
||||
{
|
||||
"name": "module_desc",
|
||||
"value": "module description"
|
||||
},
|
||||
{
|
||||
"name": "EntryAbility_desc",
|
||||
"value": "description"
|
||||
},
|
||||
{
|
||||
"name": "EntryAbility_label",
|
||||
"value": "label"
|
||||
}
|
||||
]
|
||||
}
|
BIN
entry/src/main/resources/base/media/background.png
Normal file
BIN
entry/src/main/resources/base/media/background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
BIN
entry/src/main/resources/base/media/foreground.png
Normal file
BIN
entry/src/main/resources/base/media/foreground.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
7
entry/src/main/resources/base/media/layered_image.json
Normal file
7
entry/src/main/resources/base/media/layered_image.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"layered-image":
|
||||
{
|
||||
"background" : "$media:background",
|
||||
"foreground" : "$media:foreground"
|
||||
}
|
||||
}
|
BIN
entry/src/main/resources/base/media/startIcon.png
Normal file
BIN
entry/src/main/resources/base/media/startIcon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
2
entry/src/main/resources/base/profile/main_pages.json
Normal file
2
entry/src/main/resources/base/profile/main_pages.json
Normal file
|
@ -0,0 +1,2 @@
|
|||
{
|
||||
}
|
16
entry/src/main/resources/en_US/element/string.json
Normal file
16
entry/src/main/resources/en_US/element/string.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"string": [
|
||||
{
|
||||
"name": "module_desc",
|
||||
"value": "module description"
|
||||
},
|
||||
{
|
||||
"name": "EntryAbility_desc",
|
||||
"value": "description"
|
||||
},
|
||||
{
|
||||
"name": "EntryAbility_label",
|
||||
"value": "label"
|
||||
}
|
||||
]
|
||||
}
|
16
entry/src/main/resources/zh_CN/element/string.json
Normal file
16
entry/src/main/resources/zh_CN/element/string.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"string": [
|
||||
{
|
||||
"name": "module_desc",
|
||||
"value": "模块描述"
|
||||
},
|
||||
{
|
||||
"name": "EntryAbility_desc",
|
||||
"value": "description"
|
||||
},
|
||||
{
|
||||
"name": "EntryAbility_label",
|
||||
"value": "label"
|
||||
}
|
||||
]
|
||||
}
|
BIN
hvigor/cangjie-build-support-1.0.5.tgz
Normal file
BIN
hvigor/cangjie-build-support-1.0.5.tgz
Normal file
Binary file not shown.
23
hvigor/hvigor-config.json5
Normal file
23
hvigor/hvigor-config.json5
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"modelVersion": "5.0.0",
|
||||
"dependencies": {
|
||||
"@ohos/cangjie-build-support": "file:cangjie-build-support-1.0.5.tgz"
|
||||
},
|
||||
"execution": {
|
||||
// "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */
|
||||
// "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */
|
||||
// "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */
|
||||
// "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */
|
||||
// "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */
|
||||
},
|
||||
"logging": {
|
||||
// "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
|
||||
},
|
||||
"debugging": {
|
||||
// "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
|
||||
},
|
||||
"nodeOptions": {
|
||||
// "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/
|
||||
// "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/
|
||||
}
|
||||
}
|
6
hvigorfile.ts
Normal file
6
hvigorfile.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
import { appTasks } from '@ohos/cangjie-build-support';
|
||||
|
||||
export default {
|
||||
system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
|
||||
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
|
||||
}
|
27
oh-package-lock.json5
Normal file
27
oh-package-lock.json5
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"meta": {
|
||||
"stableOrder": true
|
||||
},
|
||||
"lockfileVersion": 3,
|
||||
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
|
||||
"specifiers": {
|
||||
"@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0",
|
||||
"@ohos/hypium@1.0.19": "@ohos/hypium@1.0.19"
|
||||
},
|
||||
"packages": {
|
||||
"@ohos/hamock@1.0.0": {
|
||||
"name": "@ohos/hamock",
|
||||
"version": "1.0.0",
|
||||
"integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==",
|
||||
"resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har",
|
||||
"registryType": "ohpm"
|
||||
},
|
||||
"@ohos/hypium@1.0.19": {
|
||||
"name": "@ohos/hypium",
|
||||
"version": "1.0.19",
|
||||
"integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==",
|
||||
"resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.19.har",
|
||||
"registryType": "ohpm"
|
||||
}
|
||||
}
|
||||
}
|
10
oh-package.json5
Normal file
10
oh-package.json5
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"modelVersion": "5.0.0",
|
||||
"description": "Please describe the basic information.",
|
||||
"dependencies": {
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ohos/hypium": "1.0.19",
|
||||
"@ohos/hamock": "1.0.0"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user