mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
openharmony: add servoshell for ohos (#33295)
* openharmony: add servoshell for ohos Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * ohos: handle missing signing config on forks Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> --------- Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
parent
457d37d94e
commit
157e28c59b
31 changed files with 625 additions and 9 deletions
34
support/openharmony/hvigorfile.ts
Normal file
34
support/openharmony/hvigorfile.ts
Normal file
|
@ -0,0 +1,34 @@
|
|||
import { appTasks, OhosAppContext, OhosPluginId } from '@ohos/hvigor-ohos-plugin';
|
||||
import { getNode } from '@ohos/hvigor'
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
const rootNode = getNode(__filename);
|
||||
rootNode.afterNodeEvaluate(node => {
|
||||
const appContext = node.getContext(OhosPluginId.OHOS_APP_PLUGIN) as OhosAppContext;
|
||||
const buildProfileOpt = appContext.getBuildProfileOpt();
|
||||
const signingConfigsPath = process.env["SERVO_OHOS_SIGNING_CONFIG"];
|
||||
if (signingConfigsPath) {
|
||||
if (!fs.existsSync(signingConfigsPath)) {
|
||||
console.error("File referenced by SERVO_OHOS_SIGNING_CONFIG does not exist!");
|
||||
return;
|
||||
}
|
||||
const basePath = path.dirname(signingConfigsPath);
|
||||
const signingConfigs = JSON.parse(fs.readFileSync(signingConfigsPath));
|
||||
for (const config of signingConfigs) {
|
||||
config.material.certpath = path.resolve(basePath, config.material.certpath);
|
||||
config.material.profile = path.resolve(basePath, config.material.profile);
|
||||
config.material.storeFile = path.resolve(basePath, config.material.storeFile);
|
||||
}
|
||||
buildProfileOpt['app']['signingConfigs'] = signingConfigs;
|
||||
} else {
|
||||
console.log('Signing config not found in enviroment. hvigor will fallback to build-profile.json5.')
|
||||
}
|
||||
// Set the obj object back to the context object to enable the build process and results.
|
||||
appContext.setBuildProfileOpt(buildProfileOpt);
|
||||
})
|
||||
|
||||
export default {
|
||||
system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
|
||||
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue