Merge pull request #2370 from ag2s20150909/master

加速Github Action
pull/2380/head
kunfei 2 years ago committed by GitHub
commit 1da155be38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      .github/workflows/cronet.yml
  2. 3
      .github/workflows/release.yml
  3. 4
      .github/workflows/test.yml
  4. 1
      app/build.gradle
  5. 15
      epublib/src/main/java/me/ag2s/epublib/epub/PackageDocumentWriter.java
  6. 9
      gradle.properties

@ -14,6 +14,9 @@ jobs:
with: with:
fetch-depth: 1 fetch-depth: 1
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
- name: Check Cronet Updates - name: Check Cronet Updates
run: | run: |
echo "获取cronet最新版本" echo "获取cronet最新版本"

@ -69,6 +69,9 @@ jobs:
echo "统一版本号" echo "统一版本号"
sed "/def version/c def version = \"${{ env.VERSION }}\"" $GITHUB_WORKSPACE/app/build.gradle -i 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 - name: Build With Gradle
run: | run: |
echo "开始进行${{ env.product }}构建" echo "开始进行${{ env.product }}构建"

@ -70,6 +70,10 @@ jobs:
sed '$a\RELEASE_KEY_ALIAS=legado' $GITHUB_WORKSPACE/gradle.properties -i 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_STORE_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i
sed '$a\RELEASE_KEY_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 - name: Build With Gradle
run: | run: |
if [ ${{ env.type }} == 'release' ]; then if [ ${{ env.type }} == 'release' ]; then

@ -59,6 +59,7 @@ android {
} }
} }
buildFeatures { buildFeatures {
buildConfig true
viewBinding true viewBinding true
compose true compose true
} }

@ -9,7 +9,6 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import me.ag2s.epublib.BuildConfig;
import me.ag2s.epublib.Constants; import me.ag2s.epublib.Constants;
import me.ag2s.epublib.domain.EpubBook; import me.ag2s.epublib.domain.EpubBook;
import me.ag2s.epublib.domain.Guide; import me.ag2s.epublib.domain.Guide;
@ -52,20 +51,18 @@ public class PackageDocumentWriter extends PackageDocumentBase {
serializer.endDocument(); serializer.endDocument();
serializer.flush(); serializer.flush();
} catch (IOException e) { } catch (IOException e) {
if (BuildConfig.DEBUG) { e.printStackTrace();
e.printStackTrace();
}
} }
} }
/** /**
* Writes the package's spine. * Writes the package's spine.
* *
* @param book e * @param book e
* @param epubWriter g * @param epubWriter g
* @param serializer g * @param serializer g
* @throws IOException g * @throws IOException g
* @throws IllegalStateException g * @throws IllegalStateException g
* @throws IllegalArgumentException 1@throws XMLStreamException * @throws IllegalArgumentException 1@throws XMLStreamException
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
@ -180,8 +177,8 @@ public class PackageDocumentWriter extends PackageDocumentBase {
/** /**
* List all spine references * List all spine references
* *
* @throws IOException f * @throws IOException f
* @throws IllegalStateException f * @throws IllegalStateException f
* @throws IllegalArgumentException f * @throws IllegalArgumentException f
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")

@ -23,10 +23,17 @@ kotlin.incremental.useClasspathSnapshot=true
android.enableResourceOptimizations=true android.enableResourceOptimizations=true
android.enableNewResourceShrinker=true android.enableNewResourceShrinker=true
android.experimental.enableNewResourceShrinker.preciseShrinking=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 # 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. # and none from the library's dependencies, thereby reducing the size of the R class for that library.
android.nonTransitiveRClass=true android.nonTransitiveRClass=true
#https://chromiumdash.appspot.com/releases?platform=Android #https://chromiumdash.appspot.com/releases?platform=Android
CronetVersion=106.0.5249.79 CronetVersion=106.0.5249.79
android.injected.testOnly=false android.injected.testOnly=false
Loading…
Cancel
Save