From e43832d210f7dc508aa378c6a1acb03794cdb281 Mon Sep 17 00:00:00 2001 From: shifujun Date: Mon, 22 Feb 2021 20:49:22 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=95=B4=E7=90=86Github=20Actions?= =?UTF-8?q?=EF=BC=8C=E6=94=AF=E6=8C=81=E5=8F=91=E5=B8=83=E4=BA=8C=E8=BF=9B?= =?UTF-8?q?=E5=88=B6=E5=88=B0Github=20Packages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 同时修复二进制sample的构建,并加到PR检查中。 #462 --- .github/workflows/pr-check.yml | 62 +++++++++++++++++++ .github/workflows/release.yml | 42 +++++++++++++ .../workflows/{android.yml => snapshot.yml} | 20 ++++-- .github/workflows/windows.yml | 20 ------ buildScripts/gradle/common.gradle | 12 +++- buildScripts/gradle/maven.gradle | 43 +++++++++++-- .../sample/maven/host-project/build.gradle | 12 +++- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../sample/maven/manager-project/build.gradle | 12 +++- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../sample/maven/plugin-project/build.gradle | 12 +++- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../plugin-shadow-apk/build.gradle | 10 +++ .../sample-loader/proguard-rules.pro | 1 + .../sample-runtime/proguard-rules.pro | 5 +- .../sunflower/host-project/build.gradle | 12 +++- .../sunflower/manager-project/build.gradle | 12 +++- .../sunflower/plugin-project/build.gradle | 24 ++++++- .../sample-loader/proguard-rules.pro | 1 + .../sample-runtime/proguard-rules.pro | 5 +- 20 files changed, 266 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/pr-check.yml create mode 100644 .github/workflows/release.yml rename .github/workflows/{android.yml => snapshot.yml} (61%) delete mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml new file mode 100644 index 000000000..1ab318a2a --- /dev/null +++ b/.github/workflows/pr-check.yml @@ -0,0 +1,62 @@ +name: PR Check + +on: + pull_request: + branches: [ master ] + +jobs: + build-and-test-on-macos: + runs-on: macos-latest + steps: + - name: checkout + uses: actions/checkout@v2 + - name: buildSdk + run: ./gradlew buildSdk + - name: lintSdk + run: ./gradlew lintSdk + - name: build sample/source + run: ./gradlew build + - name: unit test + run: ./gradlew jvmTestSdk -S + - name: run androidTestSdk on API 28 emulator + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 28 + target: default + arch: x86_64 + profile: pixel_xl + script: ./gradlew androidTestSdk + build-on-windows: + runs-on: windows-latest + steps: + - name: checkout + uses: actions/checkout@v2 + - name: buildSdk + run: ./gradlew buildSdk + - name: lintSdk + run: ./gradlew lintSdk + - name: build sample/source + run: ./gradlew build + build-samples: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + - name: build sample/maven/host-project + working-directory: projects/sample/maven/host-project + run: ./gradlew assemble + - name: build sample/maven/manager-project + working-directory: projects/sample/maven/manager-project + run: ./gradlew assemble + - name: build sample/maven/plugin-project + working-directory: projects/sample/maven/plugin-project + run: ./gradlew assemble + - name: build sample/sunflower/host-project + working-directory: projects/sample/sunflower/host-project + run: ./gradlew assemble + - name: build sample/sunflower/manager-project + working-directory: projects/sample/sunflower/manager-project + run: ./gradlew assemble + - name: build sample/sunflower/plugin-project + working-directory: projects/sample/sunflower/plugin-project + run: ./gradlew assemble diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..a171f9a4d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Publish release + +on: + release: + types: + - created + +jobs: + build-and-test: + runs-on: macos-latest + steps: + - name: checkout + uses: actions/checkout@v2 + - name: buildSdk + run: ./gradlew buildSdk + - name: lintSdk + run: ./gradlew lintSdk + - name: build sample/source + run: ./gradlew build + - name: unit test + run: ./gradlew jvmTestSdk -S + - name: run androidTestSdk on API 28 emulator + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: 28 + target: default + arch: x86_64 + profile: pixel_xl + script: ./gradlew androidTestSdk + publish: + needs: build-and-test + runs-on: macos-latest + env: + PUBLISH_RELEASE: true + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v3.x + - name: checkout + uses: actions/checkout@v2 + - name: publish + run: ./gradlew publish diff --git a/.github/workflows/android.yml b/.github/workflows/snapshot.yml similarity index 61% rename from .github/workflows/android.yml rename to .github/workflows/snapshot.yml index 30162bf7b..2dfef7206 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/snapshot.yml @@ -1,13 +1,11 @@ -name: Android CI +name: Publish snapshot on: push: branches: [ master ] - pull_request: - branches: [ master ] jobs: - test: + build-and-test: runs-on: macos-latest steps: - name: checkout @@ -28,4 +26,16 @@ jobs: arch: x86_64 profile: pixel_xl script: ./gradlew androidTestSdk - + publish: + needs: build-and-test + runs-on: macos-latest + env: + PUBLISH_RELEASE: false + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v3.x + - name: checkout + uses: actions/checkout@v2 + - name: publish + run: ./gradlew publish diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index 6372b71bb..000000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Windows build check - -on: - pull_request: - branches: [ master ] - -jobs: - test: - runs-on: windows-latest - steps: - - name: checkout - uses: actions/checkout@v2 - - name: buildSdk - run: ./gradlew buildSdk - - name: lintSdk - run: ./gradlew lintSdk - - name: build sample/source - run: ./gradlew build - - diff --git a/buildScripts/gradle/common.gradle b/buildScripts/gradle/common.gradle index efae697f6..948c3a911 100644 --- a/buildScripts/gradle/common.gradle +++ b/buildScripts/gradle/common.gradle @@ -12,11 +12,17 @@ allprojects { ext.MIN_SDK_VERSION = 14 ext.TARGET_SDK_VERSION = 28 ext.VERSION_CODE = 1 - ext.VERSION_NAME = "2.0.12" + + if ("${System.env.CI}".equalsIgnoreCase("true")) { + ext.VERSION_NAME = System.getenv("GITHUB_REF_SLUG") + } else { + ext.VERSION_NAME = "local" + } + if ("${System.env.PUBLISH_RELEASE}".equalsIgnoreCase("true")) { ext.VERSION_SUFFIX = "" - } else if ("${System.env.ORANGE}".equalsIgnoreCase("true")) { - ext.VERSION_SUFFIX = "-${System.env.ORANGE_COMMIT_SHORT}-SNAPSHOT" + } else if ("${System.env.CI}".equalsIgnoreCase("true")) { + ext.VERSION_SUFFIX = "-${System.env.GITHUB_SHA_SHORT}-SNAPSHOT" } else { ext.VERSION_SUFFIX = "-${gitShortRev()}-SNAPSHOT" } diff --git a/buildScripts/gradle/maven.gradle b/buildScripts/gradle/maven.gradle index cef2d6295..7677227a7 100644 --- a/buildScripts/gradle/maven.gradle +++ b/buildScripts/gradle/maven.gradle @@ -71,15 +71,15 @@ def gitShortRev() { } def setScm(scm) { - scm.appendNode('connection', 'https://github.com/Tencent/Shadow.git') + scm.appendNode('connection', "https://github.com/${System.getenv("GITHUB_ACTOR")}/Shadow.git") def commit - if ("${System.env.ORANGE}".equalsIgnoreCase("true")) { - commit = "${System.env.ORANGE_COMMIT}" + if ("${System.env.CI}".equalsIgnoreCase("true")) { + commit = System.getenv("GITHUB_SHA") } else { commit = gitShortRev() } - scm.appendNode('url', "https://github.com/Tencent/Shadow/commit/$commit") + scm.appendNode('url', "https://github.com/${System.getenv("GITHUB_ACTOR")}/Shadow/commit/$commit") } def setGeneratePomFileAndDepends(publicationName) { @@ -387,7 +387,40 @@ publishing { } } repositories { - mavenLocal() + def useLocalCredential = false + Properties properties = new Properties() + def propertiesFile = project.rootProject.file('local.properties') + if (propertiesFile.exists()) { + properties.load(propertiesFile.newDataInputStream()) + + if ("${properties.getProperty('gpr.local')}".equalsIgnoreCase('true')) { + def user = properties.getProperty('gpr.user') + def key = properties.getProperty('gpr.key') + maven { + name = "GitHubPackages" + credentials { + username = user + password = key + } + url "https://maven.pkg.github.com/${user}/shadow" + } + + useLocalCredential = true + } + } + + if (!useLocalCredential && "${System.env.CI}".equalsIgnoreCase("true")) { + maven { + name = "GitHubPackages" + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + url "https://maven.pkg.github.com/" + "${System.env.GITHUB_REPOSITORY}".toLowerCase() + } + } else { + mavenLocal() + } } } diff --git a/projects/sample/maven/host-project/build.gradle b/projects/sample/maven/host-project/build.gradle index 623290a91..2875d5d57 100644 --- a/projects/sample/maven/host-project/build.gradle +++ b/projects/sample/maven/host-project/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.shadow_version = '2.0.12-c3a2c91f-SNAPSHOT' + ext.shadow_version = 'master-b4632d8f-SNAPSHOT' repositories { google() jcenter() @@ -17,6 +17,16 @@ allprojects { repositories { google() jcenter() + maven { + name = "GitHubPackages" + url "https://maven.pkg.github.com/shifujun/shadow" + //一个只读账号兼容Github Packages暂时不支持匿名下载 + //https://github.community/t/download-from-github-package-registry-without-authentication/14407 + credentials { + username = 'readonlypat' + password = '\u0062\u0036\u0064\u0037\u0035\u0032\u0062\u0061\u0035\u0038\u0063\u0064\u0032\u0061\u0038\u0037\u0064\u0033\u0034\u0033\u0039\u0038\u0035\u0036\u0032\u0034\u0065\u0039\u0031\u0036\u0066\u0065\u0065\u0062\u0031\u0065\u0033\u0037\u0061\u0039' + } + } mavenLocal() } } diff --git a/projects/sample/maven/host-project/gradle/wrapper/gradle-wrapper.properties b/projects/sample/maven/host-project/gradle/wrapper/gradle-wrapper.properties index 5a8d0377e..d15a30de6 100644 --- a/projects/sample/maven/host-project/gradle/wrapper/gradle-wrapper.properties +++ b/projects/sample/maven/host-project/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/projects/sample/maven/manager-project/build.gradle b/projects/sample/maven/manager-project/build.gradle index 623290a91..2875d5d57 100644 --- a/projects/sample/maven/manager-project/build.gradle +++ b/projects/sample/maven/manager-project/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.shadow_version = '2.0.12-c3a2c91f-SNAPSHOT' + ext.shadow_version = 'master-b4632d8f-SNAPSHOT' repositories { google() jcenter() @@ -17,6 +17,16 @@ allprojects { repositories { google() jcenter() + maven { + name = "GitHubPackages" + url "https://maven.pkg.github.com/shifujun/shadow" + //一个只读账号兼容Github Packages暂时不支持匿名下载 + //https://github.community/t/download-from-github-package-registry-without-authentication/14407 + credentials { + username = 'readonlypat' + password = '\u0062\u0036\u0064\u0037\u0035\u0032\u0062\u0061\u0035\u0038\u0063\u0064\u0032\u0061\u0038\u0037\u0064\u0033\u0034\u0033\u0039\u0038\u0035\u0036\u0032\u0034\u0065\u0039\u0031\u0036\u0066\u0065\u0065\u0062\u0031\u0065\u0033\u0037\u0061\u0039' + } + } mavenLocal() } } diff --git a/projects/sample/maven/manager-project/gradle/wrapper/gradle-wrapper.properties b/projects/sample/maven/manager-project/gradle/wrapper/gradle-wrapper.properties index 5a8d0377e..d15a30de6 100644 --- a/projects/sample/maven/manager-project/gradle/wrapper/gradle-wrapper.properties +++ b/projects/sample/maven/manager-project/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/projects/sample/maven/plugin-project/build.gradle b/projects/sample/maven/plugin-project/build.gradle index 623290a91..2875d5d57 100644 --- a/projects/sample/maven/plugin-project/build.gradle +++ b/projects/sample/maven/plugin-project/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.shadow_version = '2.0.12-c3a2c91f-SNAPSHOT' + ext.shadow_version = 'master-b4632d8f-SNAPSHOT' repositories { google() jcenter() @@ -17,6 +17,16 @@ allprojects { repositories { google() jcenter() + maven { + name = "GitHubPackages" + url "https://maven.pkg.github.com/shifujun/shadow" + //一个只读账号兼容Github Packages暂时不支持匿名下载 + //https://github.community/t/download-from-github-package-registry-without-authentication/14407 + credentials { + username = 'readonlypat' + password = '\u0062\u0036\u0064\u0037\u0035\u0032\u0062\u0061\u0035\u0038\u0063\u0064\u0032\u0061\u0038\u0037\u0064\u0033\u0034\u0033\u0039\u0038\u0035\u0036\u0032\u0034\u0065\u0039\u0031\u0036\u0066\u0065\u0065\u0062\u0031\u0065\u0033\u0037\u0061\u0039' + } + } mavenLocal() } } diff --git a/projects/sample/maven/plugin-project/gradle/wrapper/gradle-wrapper.properties b/projects/sample/maven/plugin-project/gradle/wrapper/gradle-wrapper.properties index 5a8d0377e..d15a30de6 100644 --- a/projects/sample/maven/plugin-project/gradle/wrapper/gradle-wrapper.properties +++ b/projects/sample/maven/plugin-project/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/projects/sample/maven/plugin-project/plugin-shadow-apk/build.gradle b/projects/sample/maven/plugin-project/plugin-shadow-apk/build.gradle index 8432234d5..a01585645 100644 --- a/projects/sample/maven/plugin-project/plugin-shadow-apk/build.gradle +++ b/projects/sample/maven/plugin-project/plugin-shadow-apk/build.gradle @@ -19,6 +19,16 @@ buildscript { repositories { google() jcenter() + maven { + name = "GitHubPackages" + url "https://maven.pkg.github.com/shifujun/shadow" + //一个只读账号兼容Github Packages暂时不支持匿名下载 + //https://github.community/t/download-from-github-package-registry-without-authentication/14407 + credentials { + username = 'readonlypat' + password = '\u0062\u0036\u0064\u0037\u0035\u0032\u0062\u0061\u0035\u0038\u0063\u0064\u0032\u0061\u0038\u0037\u0064\u0033\u0034\u0033\u0039\u0038\u0035\u0036\u0032\u0034\u0065\u0039\u0031\u0036\u0066\u0065\u0065\u0062\u0031\u0065\u0033\u0037\u0061\u0039' + } + } mavenLocal() } diff --git a/projects/sample/maven/plugin-project/sample-loader/proguard-rules.pro b/projects/sample/maven/plugin-project/sample-loader/proguard-rules.pro index 6ec10b9f3..348aa86a8 100644 --- a/projects/sample/maven/plugin-project/sample-loader/proguard-rules.pro +++ b/projects/sample/maven/plugin-project/sample-loader/proguard-rules.pro @@ -52,3 +52,4 @@ -dontwarn com.tencent.shadow.dynamic.loader.** -dontwarn com.tencent.shadow.core.common.** -dontwarn com.tencent.shadow.core.loader.** +-dontwarn module-info diff --git a/projects/sample/maven/plugin-project/sample-runtime/proguard-rules.pro b/projects/sample/maven/plugin-project/sample-runtime/proguard-rules.pro index ba73588d3..d88464bcb 100644 --- a/projects/sample/maven/plugin-project/sample-runtime/proguard-rules.pro +++ b/projects/sample/maven/plugin-project/sample-runtime/proguard-rules.pro @@ -25,4 +25,7 @@ -keep class com.tencent.shadow.core.runtime.**{*;} #需要keep在宿主AndroidManifest.xml注册的壳子activity --keep class com.tencent.shadow.sample.runtime.**{*;} \ No newline at end of file +-keep class com.tencent.shadow.sample.runtime.**{*;} + +#GeneratedPluginContainerActivity包含新版本API的接口,可能在业务编译时使用的低版本compileSDK中找不到 +-dontwarn com.tencent.shadow.core.runtime.container.GeneratedPluginContainerActivity diff --git a/projects/sample/sunflower/host-project/build.gradle b/projects/sample/sunflower/host-project/build.gradle index 0bbdf930f..6525c2813 100644 --- a/projects/sample/sunflower/host-project/build.gradle +++ b/projects/sample/sunflower/host-project/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.shadow_version = '2.0.12-4de02e2e-SNAPSHOT' + ext.shadow_version = 'master-b4632d8f-SNAPSHOT' repositories { google() jcenter() @@ -17,6 +17,16 @@ allprojects { repositories { google() jcenter() + maven { + name = "GitHubPackages" + url "https://maven.pkg.github.com/shifujun/shadow" + //一个只读账号兼容Github Packages暂时不支持匿名下载 + //https://github.community/t/download-from-github-package-registry-without-authentication/14407 + credentials { + username = 'readonlypat' + password = '\u0062\u0036\u0064\u0037\u0035\u0032\u0062\u0061\u0035\u0038\u0063\u0064\u0032\u0061\u0038\u0037\u0064\u0033\u0034\u0033\u0039\u0038\u0035\u0036\u0032\u0034\u0065\u0039\u0031\u0036\u0066\u0065\u0065\u0062\u0031\u0065\u0033\u0037\u0061\u0039' + } + } mavenLocal() } } diff --git a/projects/sample/sunflower/manager-project/build.gradle b/projects/sample/sunflower/manager-project/build.gradle index 0bbdf930f..6525c2813 100644 --- a/projects/sample/sunflower/manager-project/build.gradle +++ b/projects/sample/sunflower/manager-project/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.shadow_version = '2.0.12-4de02e2e-SNAPSHOT' + ext.shadow_version = 'master-b4632d8f-SNAPSHOT' repositories { google() jcenter() @@ -17,6 +17,16 @@ allprojects { repositories { google() jcenter() + maven { + name = "GitHubPackages" + url "https://maven.pkg.github.com/shifujun/shadow" + //一个只读账号兼容Github Packages暂时不支持匿名下载 + //https://github.community/t/download-from-github-package-registry-without-authentication/14407 + credentials { + username = 'readonlypat' + password = '\u0062\u0036\u0064\u0037\u0035\u0032\u0062\u0061\u0035\u0038\u0063\u0064\u0032\u0061\u0038\u0037\u0064\u0033\u0034\u0033\u0039\u0038\u0035\u0036\u0032\u0034\u0065\u0039\u0031\u0036\u0066\u0065\u0065\u0062\u0031\u0065\u0033\u0037\u0061\u0039' + } + } mavenLocal() } } diff --git a/projects/sample/sunflower/plugin-project/build.gradle b/projects/sample/sunflower/plugin-project/build.gradle index c1e0e1f8f..f93f12e26 100644 --- a/projects/sample/sunflower/plugin-project/build.gradle +++ b/projects/sample/sunflower/plugin-project/build.gradle @@ -15,7 +15,7 @@ */ buildscript { - ext.shadow_version = '2.0.12-4de02e2e-SNAPSHOT' + ext.shadow_version = 'master-b4632d8f-SNAPSHOT' // Define versions in a single place ext { // Sdk and tools @@ -25,7 +25,7 @@ buildscript { // App dependencies appCompatVersion = '1.1.0-beta01' - constraintLayoutVersion = '2.0.0-beta1' + constraintLayoutVersion = '2.0.0-beta4' coreTestingVersion = '2.0.0' coroutinesVersion = "1.3.0-M2" espressoVersion = '3.1.1' @@ -53,6 +53,16 @@ buildscript { repositories { google() jcenter() + maven { + name = "GitHubPackages" + url "https://maven.pkg.github.com/shifujun/shadow" + //一个只读账号兼容Github Packages暂时不支持匿名下载 + //https://github.community/t/download-from-github-package-registry-without-authentication/14407 + credentials { + username = 'readonlypat' + password = '\u0062\u0036\u0064\u0037\u0035\u0032\u0062\u0061\u0035\u0038\u0063\u0064\u0032\u0061\u0038\u0037\u0064\u0033\u0034\u0033\u0039\u0038\u0035\u0036\u0032\u0034\u0065\u0039\u0031\u0036\u0066\u0065\u0065\u0062\u0031\u0065\u0033\u0037\u0061\u0039' + } + } mavenLocal() } @@ -72,6 +82,16 @@ allprojects { repositories { google() jcenter() + maven { + name = "GitHubPackages" + url "https://maven.pkg.github.com/shifujun/shadow" + //一个只读账号兼容Github Packages暂时不支持匿名下载 + //https://github.community/t/download-from-github-package-registry-without-authentication/14407 + credentials { + username = 'readonlypat' + password = '\u0062\u0036\u0064\u0037\u0035\u0032\u0062\u0061\u0035\u0038\u0063\u0064\u0032\u0061\u0038\u0037\u0064\u0033\u0034\u0033\u0039\u0038\u0035\u0036\u0032\u0034\u0065\u0039\u0031\u0036\u0066\u0065\u0065\u0062\u0031\u0065\u0033\u0037\u0061\u0039' + } + } mavenLocal() } } diff --git a/projects/sample/sunflower/plugin-project/sample-loader/proguard-rules.pro b/projects/sample/sunflower/plugin-project/sample-loader/proguard-rules.pro index 6ec10b9f3..348aa86a8 100644 --- a/projects/sample/sunflower/plugin-project/sample-loader/proguard-rules.pro +++ b/projects/sample/sunflower/plugin-project/sample-loader/proguard-rules.pro @@ -52,3 +52,4 @@ -dontwarn com.tencent.shadow.dynamic.loader.** -dontwarn com.tencent.shadow.core.common.** -dontwarn com.tencent.shadow.core.loader.** +-dontwarn module-info diff --git a/projects/sample/sunflower/plugin-project/sample-runtime/proguard-rules.pro b/projects/sample/sunflower/plugin-project/sample-runtime/proguard-rules.pro index ba73588d3..d88464bcb 100644 --- a/projects/sample/sunflower/plugin-project/sample-runtime/proguard-rules.pro +++ b/projects/sample/sunflower/plugin-project/sample-runtime/proguard-rules.pro @@ -25,4 +25,7 @@ -keep class com.tencent.shadow.core.runtime.**{*;} #需要keep在宿主AndroidManifest.xml注册的壳子activity --keep class com.tencent.shadow.sample.runtime.**{*;} \ No newline at end of file +-keep class com.tencent.shadow.sample.runtime.**{*;} + +#GeneratedPluginContainerActivity包含新版本API的接口,可能在业务编译时使用的低版本compileSDK中找不到 +-dontwarn com.tencent.shadow.core.runtime.container.GeneratedPluginContainerActivity