如何在ts代码中获取BuildProfile的自定义构建参数,比如像下面的BuildProfile.ets:
/**
* Use these variables when you tailor your ArkTS code. They must be of the const type.
*/
export const BUNDLE_NAME = 'com.c2vl.kgamebox.hm';
export const BUNDLE_TYPE = 'app';
export const VERSION_CODE = 308060;
export const VERSION_NAME = '3.8.6';
export const TARGET_NAME = 'default';
export const PRODUCT_NAME = 'default';
export const BUILD_MODE_NAME = 'debugQA1';
export const DEBUG = true;
export const environment = 'debugQA1';
export const baseDomain = 'langren001.com';
export const baseSubDomain = 'qa-rancher.langren001.com';
export const tcpPort = '6656';
/**
* BuildProfile Class is used only for compatibility purposes.
*/
export default class BuildProfile {
static readonly BUNDLE_NAME = BUNDLE_NAME;
static readonly BUNDLE_TYPE = BUNDLE_TYPE;
static readonly VERSION_CODE = VERSION_CODE;
static readonly VERSION_NAME = VERSION_NAME;
static readonly TARGET_NAME = TARGET_NAME;
static readonly PRODUCT_NAME = PRODUCT_NAME;
static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
static readonly DEBUG = DEBUG;
static readonly environment = environment;
static readonly baseDomain = baseDomain;
static readonly baseSubDomain = baseSubDomain;
static readonly tcpPort = tcpPort;
}
您看一下文档内的获取方式:
https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-hvigor-get-build-profile-para-guide-V5\#section195881502412