From ed06c10f254a22ec4bf402c780283ad780573c80 Mon Sep 17 00:00:00 2001 From: lafay <2021211506@stu.hit.edu.cn> Date: Tue, 16 Jun 2026 00:07:50 +0800 Subject: [PATCH] build(ci): remove Jiguang Maven repository from build workflows and Huawei plugin --- .gitea/workflows/build.yml | 3 --- plugins/withHuaweiPush.js | 18 +++--------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index fa8c92e..7c674f0 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -186,7 +186,6 @@ jobs: maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/central' } maven { url 'https://developer.huawei.com/repo/' } - maven { url 'https://developer.jiguang.cn/maven' } google() mavenCentral() gradlePluginPortal() @@ -222,7 +221,6 @@ jobs: maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/central' } maven { url 'https://developer.huawei.com/repo/' } - maven { url 'https://developer.jiguang.cn/maven' } maven { url 'https://www.jitpack.io' } google() mavenCentral() @@ -278,7 +276,6 @@ jobs: maven { url 'https://maven.aliyun.com/repository/central' } maven { url 'https://www.jitpack.io' } maven { url 'https://developer.huawei.com/repo/' } - maven { url 'https://developer.jiguang.cn/maven' } google() mavenCentral() } diff --git a/plugins/withHuaweiPush.js b/plugins/withHuaweiPush.js index f49d1f4..92b7c2e 100644 --- a/plugins/withHuaweiPush.js +++ b/plugins/withHuaweiPush.js @@ -22,38 +22,26 @@ const withHuaweiPush = (config, options = {}) => { // is applied via buildscript classpath in build.gradle with the apms-plugin excluded. if (!contents.includes('developer.huawei.com/repo')) { const repoLine = ` maven { url 'https://developer.huawei.com/repo/' }`; - const jigLine = ` maven { url 'https://developer.jiguang.cn/maven' }`; const hasPluginManagement = contents.includes('pluginManagement'); const hasRepositoriesInPM = /pluginManagement\s*\{[\s\S]*?repositories\s*\{/.test(contents); if (hasRepositoriesInPM) { config.modResults.contents = contents.replace( /(pluginManagement\s*\{[\s\S]*?repositories\s*\{)/, - `$1\n ${repoLine}\n ${jigLine}` + `$1\n ${repoLine}` ); } else if (hasPluginManagement) { config.modResults.contents = contents.replace( /(pluginManagement\s*\{)/, - `$1\n repositories {\n gradlePluginPortal()\n google()\n mavenCentral()\n ${repoLine}\n ${jigLine}\n }` + `$1\n repositories {\n gradlePluginPortal()\n google()\n mavenCentral()\n ${repoLine}\n }` ); } else { config.modResults.contents = - `pluginManagement {\n repositories {\n ${repoLine}\n ${jigLine}\n }\n}\n\n` + + `pluginManagement {\n repositories {\n ${repoLine}\n }\n}\n\n` + config.modResults.contents; } } - // Add Jiguang Maven repo to dependencyResolutionManagement (for jcore/jpush SDK) - if (!contents.includes('developer.jiguang.cn/maven')) { - const depMgmtPattern = /dependencyResolutionManagement\s*\{[\s\S]*?repositories\s*\{/; - if (depMgmtPattern.test(config.modResults.contents)) { - config.modResults.contents = config.modResults.contents.replace( - depMgmtPattern, - `$&\n maven { url 'https://developer.jiguang.cn/maven' }` - ); - } - } - // Ensure Huawei Maven repo in dependencyResolutionManagement (Gradle 9+) if (!config.modResults.contents.match(/dependencyResolutionManagement[\s\S]*developer\.huawei\.com\/repo/)) { const depMgmtPattern = /dependencyResolutionManagement\s*\{[\s\S]*?repositories\s*\{/;