From d0e7e60a093b15b4a273faa22db488c190109e55 Mon Sep 17 00:00:00 2001 From: ag2s20150909 Date: Mon, 3 Oct 2022 18:51:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8A=A0=E9=80=9FGithub=20Action=20https:/?= =?UTF-8?q?/github.com/gradle/gradle-build-action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cronet.yml | 3 +++ .github/workflows/release.yml | 3 +++ .github/workflows/test.yml | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/.github/workflows/cronet.yml b/.github/workflows/cronet.yml index c9c44d86b..f332ed4e1 100644 --- a/.github/workflows/cronet.yml +++ b/.github/workflows/cronet.yml @@ -14,6 +14,9 @@ jobs: with: fetch-depth: 1 + - name: Set up Gradle + uses: gradle/gradle-build-action@v2 + - name: Check Cronet Updates run: | echo "获取cronet最新版本" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04efc5872..e243922ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,6 +69,9 @@ jobs: echo "统一版本号" sed "/def version/c def version = \"${{ env.VERSION }}\"" $GITHUB_WORKSPACE/app/build.gradle -i + - name: Set up Gradle + uses: gradle/gradle-build-action@v2 + - name: Build With Gradle run: | echo "开始进行${{ env.product }}构建" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c85287c4c..d6f2fa452 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,6 +70,10 @@ jobs: sed '$a\RELEASE_KEY_ALIAS=legado' $GITHUB_WORKSPACE/gradle.properties -i sed '$a\RELEASE_STORE_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i sed '$a\RELEASE_KEY_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i + + - name: Set up Gradle + uses: gradle/gradle-build-action@v2 + - name: Build With Gradle run: | if [ ${{ env.type }} == 'release' ]; then From 147ea164699426283a3441312519a39effc41d92 Mon Sep 17 00:00:00 2001 From: ag2s20150909 Date: Mon, 3 Oct 2022 19:10:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=8A=A0=E9=80=9FGithub=20Action=20https:/?= =?UTF-8?q?/github.com/gradle/gradle-build-action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 1 + .../ag2s/epublib/epub/PackageDocumentWriter.java | 15 ++++++--------- gradle.properties | 9 ++++++++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 99c22e592..aa7de1186 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -59,6 +59,7 @@ android { } } buildFeatures { + buildConfig true viewBinding true compose true } diff --git a/epublib/src/main/java/me/ag2s/epublib/epub/PackageDocumentWriter.java b/epublib/src/main/java/me/ag2s/epublib/epub/PackageDocumentWriter.java index 73073db2a..29ff2c92e 100644 --- a/epublib/src/main/java/me/ag2s/epublib/epub/PackageDocumentWriter.java +++ b/epublib/src/main/java/me/ag2s/epublib/epub/PackageDocumentWriter.java @@ -9,7 +9,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import me.ag2s.epublib.BuildConfig; import me.ag2s.epublib.Constants; import me.ag2s.epublib.domain.EpubBook; import me.ag2s.epublib.domain.Guide; @@ -52,20 +51,18 @@ public class PackageDocumentWriter extends PackageDocumentBase { serializer.endDocument(); serializer.flush(); } catch (IOException e) { - if (BuildConfig.DEBUG) { - e.printStackTrace(); - } + e.printStackTrace(); } } /** * Writes the package's spine. * - * @param book e + * @param book e * @param epubWriter g * @param serializer g - * @throws IOException g - * @throws IllegalStateException g + * @throws IOException g + * @throws IllegalStateException g * @throws IllegalArgumentException 1@throws XMLStreamException */ @SuppressWarnings("unused") @@ -180,8 +177,8 @@ public class PackageDocumentWriter extends PackageDocumentBase { /** * List all spine references * - * @throws IOException f - * @throws IllegalStateException f + * @throws IOException f + * @throws IllegalStateException f * @throws IllegalArgumentException f */ @SuppressWarnings("unused") diff --git a/gradle.properties b/gradle.properties index 77528d5f5..860ebea1c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -23,10 +23,17 @@ kotlin.incremental.useClasspathSnapshot=true android.enableResourceOptimizations=true android.enableNewResourceShrinker=true android.experimental.enableNewResourceShrinker.preciseShrinking=true +# https://blog.gradle.org/introducing-file-system-watching +org.gradle.vfs.watch=true +# Disable buildFeatures flags by default +android.defaults.buildfeatures.aidl=false +android.defaults.buildfeatures.buildconfig=false +android.defaults.buildfeatures.renderscript=false +android.defaults.buildfeatures.resvalues=false +android.defaults.buildfeatures.shaders=false # enables namespacing of each library's R class so that its R class includes only the resources declared in the library itself # and none from the library's dependencies, thereby reducing the size of the R class for that library. android.nonTransitiveRClass=true #https://chromiumdash.appspot.com/releases?platform=Android CronetVersion=106.0.5249.79 - android.injected.testOnly=false \ No newline at end of file