Signed-off-by: yangbo <1442420648@qq.com>
Change-Id: Ie78954a5baf1cbb907678f4e192cb93d03318b95
This commit is contained in:
yangbo
2022-01-25 15:18:33 +08:00
parent 908debf2c2
commit 2d5a93043b
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -19,7 +19,7 @@
"postinstall": "node npm-install.js",
"richtest": "cd test/rich/testcase && webpack --config ../../../webpack.rich.config.js && mocha ../test.js",
"litetest": "cd test/lite/testcase && webpack --config ../../../webpack.lite.config.js && mocha ../test.js",
"cardtest": "cd test/card/testcase && webpack --env utTestForCard --config ../../../webpack.rich.config.js && mocha ../test.js",
"cardtest": "cd test/card/testcase && webpack --config ../../../webpack.rich.config.js && mocha ../test.js",
"test": "npm run build && npm run richtest && npm run litetest && npm run cardtest"
},
"devDependencies": {
+3 -3
View File
@@ -226,7 +226,7 @@ function readManifest(manifestFilePath) {
function readModulePages(moduleJson) {
if (moduleJson.module.uiSyntax === 'hml' && moduleJson.module.pages) {
const modulePagePath = path.resolve(process.env.aceProfilePath,
`${moduleJson.module.pages.replace(/\@profile\:/, '')}.json`);
`${moduleJson.module.pages.replace(/\$profile\:/, '')}.json`);
if (fs.existsSync(modulePagePath)) {
const pagesConfig = JSON.parse(fs.readFileSync(modulePagePath, 'utf-8'));
return pagesConfig.src;
@@ -241,7 +241,7 @@ function readFormPages(moduleJson) {
if (extensionAbility.type && extensionAbility.type === 'form' && extensionAbility.metadata &&
extensionAbility.metadata.length) {
extensionAbility.metadata.forEach(item => {
if (item.resource && /\@profile\:/.test(item.resource)) {
if (item.resource && /\$profile\:/.test(item.resource)) {
parseFormConfig(item.resource, pages);
}
});
@@ -253,7 +253,7 @@ function readFormPages(moduleJson) {
function parseFormConfig(resource, pages) {
const resourceFile = path.resolve(process.env.aceProfilePath,
`${resource.replace(/\@profile\:/, '')}.json`);
`${resource.replace(/\$profile\:/, '')}.json`);
if (fs.existsSync(resourceFile)) {
const pagesConfig = JSON.parse(fs.readFileSync(resourceFile, 'utf-8'));
if (pagesConfig.forms && pagesConfig.forms.length) {
+3 -3
View File
@@ -178,9 +178,6 @@ let config = {
}
function setConfigs(env) {
if (env.utTestForCard) {
env.DEVICE_LEVEL = "card";
}
if (process.env.aceModuleJsonPath || env.aceModuleJsonPath) {
process.env.compileMode = 'moduleJson';
}
@@ -203,6 +200,9 @@ function setConfigs(env) {
(env.watchMode && env.watchMode === 'true') || false;
if (process.env.abilityType === 'page' || process.env.abilityType === 'form') {
const manifest = readManifest(process.env.aceManifestPath)
if (process.env.compileMode !== 'moduleJson') {
process.env.DEVICE_LEVEL = manifest.type === 'form' ? 'card' : 'rich'
}
process.env.PLATFORM_VERSION = PLATFORM.VERSION6;
const version = parseInt(manifest.minPlatformVersion);
if (version == 5) {