mx-jpush-expo
Version:
Expo 集成极光推送(JPush)一体化解决方案,支持 iOS/Android 厂商通道
49 lines • 1.64 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LEGACY_PROJECT_BUILD_TAGS = void 0;
exports.getVendorChannels = getVendorChannels;
exports.getProjectVendorFlags = getProjectVendorFlags;
exports.getBuildscriptRepositories = getBuildscriptRepositories;
/**
* 获取当前配置的厂商通道列表
*/
function getVendorChannels() {
return globalThis.__JPUSH_VENDOR_CHANNELS__;
}
/**
* 获取厂商通道开启状态标记
*/
function getProjectVendorFlags(vendorChannels) {
const channels = vendorChannels || getVendorChannels();
if (!channels)
return {};
return Object.fromEntries(Object.entries(channels).map(([key, value]) => [key, Boolean(value?.enabled || value?.appId || value?.appKey)]));
}
/**
* 旧版本生成标签列表,用于清理旧配置
*/
exports.LEGACY_PROJECT_BUILD_TAGS = [
'jpush-buildscript-repositories',
'jpush-buildscript-classpaths',
'jpush-allprojects-repositories',
'jpush-huawei-maven-buildscript',
'jpush-honor-maven-buildscript',
'jpush-vendor-classpaths',
'jpush-huawei-maven-allprojects',
'jpush-honor-maven-allprojects',
];
/**
* 获取buildscript需要添加的maven仓库配置
*/
function getBuildscriptRepositories(vendorChannels) {
const flags = getProjectVendorFlags(vendorChannels);
const repos = [];
if (flags.huawei) {
repos.push(`maven { url 'https://developer.huawei.com/repo/' }`);
}
if (flags.honor) {
repos.push(`maven { url 'https://developer.hihonor.com/repo' }`);
}
return repos.join('\n ');
}
//# sourceMappingURL=vendorChannels.js.map