Browse Source

修改一下配置

liuyuqi-dellpc 4 years ago
parent
commit
f1e67b922a
3 changed files with 12 additions and 5 deletions
  1. 3 2
      .github/workflows/android.yml
  2. 8 2
      app/build.gradle
  3. 1 1
      gradle.properties

+ 3 - 2
.github/workflows/android.yml

@@ -1,5 +1,5 @@
 name: Android CI
-
+#push自动构建
 on: [push]
 
 jobs:
@@ -8,10 +8,11 @@ jobs:
     runs-on: ubuntu-latest
 
     steps:
+# https://github.com/actions/checkout
     - uses: actions/checkout@v1
     - name: set up JDK 1.8
       uses: actions/setup-java@v1
       with:
         java-version: 1.8
     - name: Build with Gradle
-      run: ./gradlew build
+      run: ./gradlew assembleDebug

+ 8 - 2
app/build.gradle

@@ -1,13 +1,18 @@
 apply plugin: 'com.android.application'
 
+def cmd = 'git rev-list HEAD --first-parent --count'
+def gitVersion = cmd.execute().text.trim().toInteger()
+def cmd2 = 'git describe --tags'
+def version = cmd2.execute().text.trim()
+
 android {
     compileSdkVersion 28
     defaultConfig {
         applicationId "me.yoqi.calculator"
         minSdkVersion 15
         targetSdkVersion 28
-        versionCode 11
-        versionName "1.0.1"
+        versionCode gitVersion
+        versionName version
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
     }
     buildTypes {
@@ -16,6 +21,7 @@ android {
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
         }
     }
+    
 }
 
 dependencies {

+ 1 - 1
gradle.properties

@@ -6,7 +6,7 @@
 # http://www.gradle.org/docs/current/userguide/build_environment.html
 # Specifies the JVM arguments used for the daemon process.
 # The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
+org.gradle.jvmargs=-Xmx1000m
 # When configured, Gradle will run in incubating parallel mode.
 # This option should only be used with decoupled projects. More details, visit
 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects