1
0

20211019-tzx

This commit is contained in:
xuegao
2021-10-19 21:16:30 +08:00
parent 5f3c658a6d
commit c4f81f63e6
24 changed files with 157 additions and 255 deletions

View File

@@ -1,2 +1,5 @@
/build
/node_modules
/.gradle
.idea
/.idea
app.iml

View File

@@ -1,26 +1,91 @@
apply plugin: 'com.huawei.ohos.hap'
apply plugin: 'com.huawei.ohos.decctest'
//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510
ohos {
compileSdkVersion 6
apply plugin: 'com.android.application'
apply plugin: 'walle'
android {
compileSdkVersion 28
defaultConfig {
compatibleSdkVersion 6
applicationId "com.heweather.owp"
minSdkVersion 19
targetSdkVersion 28
versionCode 3
versionName "1.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
signingConfigs {
he {
keyAlias "heweather"
keyPassword "He123qwe."
storeFile rootProject.file("he.jks")
storePassword "He123qwe."
}
}
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.he
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.he
}
}
allprojects {
repositories {
mavenCentral()
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
// Move the tests to tests/java, tests/res, etc...
// instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
buildscript {
repositories {
jcenter()
}
}
//生成渠道包 ./gradlew clean assembleReleaseChannels
//支持 productFlavors ./gradlew clean assembleMeituanReleaseChannels
//生成单个渠道包 ./gradlew clean assembleReleaseChannels -PchannelList=google
//生成多个渠道包 ./gradlew clean assembleReleaseChannels -PchannelList=google,dianping
walle {
// 指定渠道包的输出路径
apkOutputFolder = new File("${project.buildDir}/channels")
// 定制渠道包的APK的文件名称
apkFileNameFormat = '${appName}-${channel}-${buildType}-v${versionName}-${versionCode}-${buildTime}.apk'
// 渠道配置文件
channelFile = new File("${project.getProjectDir()}/channel")
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
testImplementation 'junit:junit:4.13.1'
ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.200'
}
decc {
supportType = ['html','xml']
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'joda-time:joda-time:2.10'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.zhy:okhttputils:2.6.2'
implementation files('libs/android-logging-log4j-1.0.3.jar')
implementation files('libs/log4j-1.2.17.jar')
implementation 'com.google.code.gson:gson:2.8.0'
implementation files('libs/AMap_Location_V4.0.1_20180426.jar')
implementation files('libs/HeWeather_sdk.jar')
}

View File

@@ -1 +0,0 @@
# config module specific ProGuard rules here.

View File

@@ -1,51 +0,0 @@
{
"app": {
"bundleName": "com.example.myapplication",
"vendor": "example",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.myapplication",
"name": ".MyApplication",
"mainAbility": "com.example.myapplication.MainAbility",
"deviceType": [
"phone",
"tablet",
"tv",
"wearable",
"car"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"name": "com.example.myapplication.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
}
]
}
}

View File

@@ -1,5 +1,5 @@
package com.heweather.owp.adapter;
/**/
import android.annotation.SuppressLint;
import android.content.Context;
import android.support.annotation.NonNull;

View File

@@ -1,16 +0,0 @@
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "Java_Empty Ability"
},
{
"name": "mainability_HelloWorld",
"value": "Hello World"
}
]
}

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<shape xmlns:ohos="http://schemas.huawei.com/res/ohos"
ohos:shape="rectangle">
<solid
ohos:color="#FFFFFF"/>
</shape>

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<DirectionalLayout
xmlns:ohos="http://schemas.huawei.com/res/ohos"
ohos:height="match_parent"
ohos:width="match_parent"
ohos:alignment="center"
ohos:orientation="vertical">
<Text
ohos:id="$+id:text_helloworld"
ohos:height="match_content"
ohos:width="match_content"
ohos:background_element="$graphic:background_ability_main"
ohos:layout_alignment="horizontal_center"
ohos:text="$string:mainability_HelloWorld"
ohos:text_size="40vp"
/>
</DirectionalLayout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -1,16 +0,0 @@
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "Java_Empty Ability"
},
{
"name": "mainability_HelloWorld",
"value": "Hello World"
}
]
}

View File

@@ -1,16 +0,0 @@
{
"string": [
{
"name": "entry_MainAbility",
"value": "entry_MainAbility"
},
{
"name": "mainability_description",
"value": "Java_Empty Ability"
},
{
"name": "mainability_HelloWorld",
"value": "你好,世界"
}
]
}

View File

@@ -1,14 +0,0 @@
package com.example.myapplication;
import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class ExampleOhosTest {
@Test
public void testBundleName() {
final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
assertEquals("com.example.myapplication", actualBundleName);
}
}

View File

@@ -1,9 +0,0 @@
package com.example.myapplication;
import org.junit.Test;
public class ExampleTest {
@Test
public void onStart() {
}
}