From d128440b385de1aa96353dfee641089bef3c5266 Mon Sep 17 00:00:00 2001 From: Juyoung Jin Date: Mon, 7 Nov 2022 17:41:16 +0900 Subject: [PATCH 1/6] =?UTF-8?q?chore:=20firebase=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++-- app/build.gradle | 4 ++++ build.gradle | 12 +++++++++++- settings.gradle | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 53e730c7..88f599ef 100644 --- a/.gitignore +++ b/.gitignore @@ -60,7 +60,7 @@ captures/ .cxx/ # Google Services (e.g. APIs or Firebase) -# google-services.json +google-services.json # Freeline freeline.py @@ -83,4 +83,4 @@ lint/generated/ lint/outputs/ lint/tmp/ # lint/reports/ -/.idea/ +/.idea/ \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index ca1b3645..39f39ef0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' + id 'com.google.gms.google-services' } android { @@ -40,4 +41,7 @@ dependencies { testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + + implementation platform('com.google.firebase:firebase-bom:31.0.2') + implementation 'com.google.firebase:firebase-analytics-ktx' } diff --git a/build.gradle b/build.gradle index 9b606409..194a9a3c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,16 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath 'com.google.gms:google-services:4.3.13' + } +} + plugins { id 'com.android.application' version '7.3.0' apply false id 'com.android.library' version '7.3.0' apply false id 'org.jetbrains.kotlin.android' version '1.7.10' apply false -} +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 2f5528c2..a9f6be5b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -13,4 +13,4 @@ dependencyResolutionManagement { } } rootProject.name = "UCMC" -include ':app' +include ':app' \ No newline at end of file From 237316a77e26fe75a34ac459551a7c4cf280128c Mon Sep 17 00:00:00 2001 From: minseonglove Date: Mon, 7 Nov 2022 21:30:30 +0900 Subject: [PATCH 2/6] =?UTF-8?q?deploy=20:=20=EB=B9=8C=EB=93=9C=20=EC=9E=90?= =?UTF-8?q?=EB=8F=99=ED=99=94=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ucmcCI.yml | 64 ++++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 3 ++- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 .github/ucmcCI.yml diff --git a/.github/ucmcCI.yml b/.github/ucmcCI.yml new file mode 100644 index 00000000..34ea450b --- /dev/null +++ b/.github/ucmcCI.yml @@ -0,0 +1,64 @@ +name: ucmc CI + +on: + push: + branches: [ develop, sandbox ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Create google-service + run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./app/google-services.json + - name: Build with Gradle + run: ./gradlew build + - name: Build Signed APK + uses: victorbnl/build-signed-apk@main + with: + keystore_b64: ${{ secrets.SIGN_KEY }} + keystore_password: ${{ secrets.KEY_STORE_PASSWORD }} + key_alias: ${{ secrets.ALIAS }} + key_password: ${{ secrets.KEY_STORE_PASSWORD }} + env: + BUILD_TOOLS_VERSION: "30.0.2" + - name: signed app bundle + uses: actions/upload-artifact@v3 + with: + path: ./app/build/outputs/apk/release/app-release.apk + - name: Download APK from build + uses: actions/download-artifact@v3 + with: + name: artifact + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d-%H-%M')" + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.CI_TOKEN }} + with: + tag_name: ${{ steps.date.outputs.date }} + release_name: Release-dev-${{ steps.date.outputs.date }} + - name: Upload Release APK + id: upload_release_asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.CI_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./app/build/outputs/apk/release/app-release.apk + asset_name: UCMC.apk + asset_content_type: application/zip diff --git a/.gitignore b/.gitignore index 88f599ef..4e50dc50 100644 --- a/.gitignore +++ b/.gitignore @@ -83,4 +83,5 @@ lint/generated/ lint/outputs/ lint/tmp/ # lint/reports/ -/.idea/ \ No newline at end of file +/.idea/ +/app/release/output-metadata.json From 97deac7bf8d144d6f1a699f622d6ee433be8c85f Mon Sep 17 00:00:00 2001 From: minseonglove Date: Mon, 7 Nov 2022 21:33:06 +0900 Subject: [PATCH 3/6] =?UTF-8?q?chore=20:=20ci=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=EC=9D=84=20workflows=20=EB=94=94=EB=A0=89=ED=86=A0=EB=A6=AC?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/{ => workflows}/ucmcCI.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/ucmcCI.yml (100%) diff --git a/.github/ucmcCI.yml b/.github/workflows/ucmcCI.yml similarity index 100% rename from .github/ucmcCI.yml rename to .github/workflows/ucmcCI.yml From 842b5e6a1560373d2aa1fe024789507d6309c49e Mon Sep 17 00:00:00 2001 From: minseonglove Date: Mon, 7 Nov 2022 21:40:11 +0900 Subject: [PATCH 4/6] =?UTF-8?q?chore=20:=20=EB=A6=B4=EB=A6=AC=EC=A6=88=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ucmcCI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ucmcCI.yml b/.github/workflows/ucmcCI.yml index 34ea450b..fa55b0d3 100644 --- a/.github/workflows/ucmcCI.yml +++ b/.github/workflows/ucmcCI.yml @@ -51,7 +51,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.CI_TOKEN }} with: tag_name: ${{ steps.date.outputs.date }} - release_name: Release-dev-${{ steps.date.outputs.date }} + release_name: Release-prod-${{ steps.date.outputs.date }} - name: Upload Release APK id: upload_release_asset uses: actions/upload-release-asset@v1 From 8bd3cce29428e0d6147f70c957fad277d341d753 Mon Sep 17 00:00:00 2001 From: minseonglove Date: Tue, 8 Nov 2022 19:30:10 +0900 Subject: [PATCH 5/6] =?UTF-8?q?build=20:=20ktlint=20=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=EB=B8=8C=EB=9F=AC=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 39f39ef0..a3e02d90 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,6 +4,10 @@ plugins { id 'com.google.gms.google-services' } +configurations { + ktlint +} + android { namespace 'com.gta.ucmc' compileSdk 33 @@ -34,6 +38,7 @@ android { } dependencies { + ktlint 'com.pinterest:ktlint:0.47.1' implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.appcompat:appcompat:1.5.1' implementation 'com.google.android.material:material:1.7.0' @@ -45,3 +50,18 @@ dependencies { implementation platform('com.google.firebase:firebase-bom:31.0.2') implementation 'com.google.firebase:firebase-analytics-ktx' } + +task ktlint(type: JavaExec, group: "verification") { + description = "Check Kotlin code style." + mainClass.set("com.pinterest.ktlint.Main") + classpath = configurations.ktlint + args "src/**/*.kt" +} +check.dependsOn ktlint + +task ktlintFormat(type: JavaExec, group: "formatting") { + description = "Fix Kotlin code style deviations." + mainClass.set("com.pinterest.ktlint.Main") + classpath = configurations.ktlint + args "-F", "src/**/*.kt" +} From 978d72b2d91e4ac68e017009cc796f1203a7645d Mon Sep 17 00:00:00 2001 From: minseonglove Date: Tue, 8 Nov 2022 19:30:51 +0900 Subject: [PATCH 6/6] =?UTF-8?q?build=20:=20ktlint=20=EB=9D=BC=EC=9D=B4?= =?UTF-8?q?=EB=B8=8C=EB=9F=AC=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gta/ucmc/ExampleInstrumentedTest.kt | 6 ++---- app/src/main/java/com/gta/ucmc/MainActivity.kt | 2 +- app/src/test/java/com/gta/ucmc/ExampleUnitTest.kt | 3 +-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/androidTest/java/com/gta/ucmc/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/gta/ucmc/ExampleInstrumentedTest.kt index 657bdaf6..d6c6df9c 100644 --- a/app/src/androidTest/java/com/gta/ucmc/ExampleInstrumentedTest.kt +++ b/app/src/androidTest/java/com/gta/ucmc/ExampleInstrumentedTest.kt @@ -1,13 +1,11 @@ package com.gta.ucmc -import androidx.test.platform.app.InstrumentationRegistry import androidx.test.ext.junit.runners.AndroidJUnit4 - +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Assert.assertEquals import org.junit.Test import org.junit.runner.RunWith -import org.junit.Assert.* - /** * Instrumented test, which will execute on an Android device. * diff --git a/app/src/main/java/com/gta/ucmc/MainActivity.kt b/app/src/main/java/com/gta/ucmc/MainActivity.kt index f7a056d4..4f617ba9 100644 --- a/app/src/main/java/com/gta/ucmc/MainActivity.kt +++ b/app/src/main/java/com/gta/ucmc/MainActivity.kt @@ -1,7 +1,7 @@ package com.gta.ucmc -import androidx.appcompat.app.AppCompatActivity import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { diff --git a/app/src/test/java/com/gta/ucmc/ExampleUnitTest.kt b/app/src/test/java/com/gta/ucmc/ExampleUnitTest.kt index 23931776..30f2da17 100644 --- a/app/src/test/java/com/gta/ucmc/ExampleUnitTest.kt +++ b/app/src/test/java/com/gta/ucmc/ExampleUnitTest.kt @@ -1,9 +1,8 @@ package com.gta.ucmc +import org.junit.Assert.assertEquals import org.junit.Test -import org.junit.Assert.* - /** * Example local unit test, which will execute on the development machine (host). *