From 3db05fe7ac8555218f0ccca2dbdbe27d59d9688f Mon Sep 17 00:00:00 2001 From: ChuYong Date: Sun, 28 Jan 2024 23:30:04 +0900 Subject: [PATCH] feat: Gradle Optimize --- fastlane/Fastfile | 49 +++++++++++++++++++++++------------------------ gradle.properties | 7 +++++-- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 654c946..700bf52 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -1,5 +1,4 @@ default_platform(:android) -$slack_url = ENV["SLACK_URL"] platform :android do desc "Runs all the tests" @@ -14,15 +13,6 @@ platform :android do service_credentials_file: ENV["SERVICE_CREDENTIAL_FILE_PATH"] ) increment_version_code({ version_code: latest_release[:buildVersion].to_i + 1, gradle_file_path: "app/build.gradle.kts" }) - gradle(task: "bundleRelease") - firebase_app_distribution( - app: ENV["FIREBASE_APP_ID"], - groups: "qa", - release_notes: "Text of release notes", - debug: true, - android_artifact_type: "AAB", - service_credentials_file: ENV["SERVICE_CREDENTIAL_FILE_PATH"] - ) version_name = get_version_name( gradle_file_path: "./app/build.gradle.kts", ext_constant_name: "versionName" @@ -31,6 +21,15 @@ platform :android do gradle_file_path: "./app/build.gradle.kts", ext_constant_name: "versionCode" ) + gradle(task: "clean bundleRelease") + firebase_app_distribution( + app: ENV["FIREBASE_APP_ID"], + groups: "qa", + release_notes: "Text of release notes", + debug: true, + android_artifact_type: "AAB", + service_credentials_file: ENV["SERVICE_CREDENTIAL_FILE_PATH"] + ) build_success("Dev 버전", version_name, version_code) rescue => exception build_fail("Dev 버전", version_name, version_code, exception) @@ -40,13 +39,6 @@ platform :android do lane :deploy_internal_test do latest_release = google_play_track_version_codes(track: 'internal') increment_version_code({ version_code: latest_release[0].to_i + 1, gradle_file_path: "app/build.gradle.kts" }) - gradle(task: "bundleRelease") - upload_to_play_store( - track: 'internal', - skip_upload_apk: true, - skip_upload_images: true, - skip_upload_metadata: true - ) version_name = get_version_name( gradle_file_path: "./app/build.gradle.kts", ext_constant_name: "versionName" @@ -55,6 +47,13 @@ platform :android do gradle_file_path: "./app/build.gradle.kts", ext_constant_name: "versionCode" ) + gradle(task: "clean bundleRelease") + upload_to_play_store( + track: 'internal', + skip_upload_apk: true, + skip_upload_images: true, + skip_upload_metadata: true + ) build_success("내부 테스트", version_name, version_code) rescue => exception build_fail("내부 테스트", version_name, version_code, exception) @@ -64,12 +63,6 @@ platform :android do lane :deploy_production do latest_release = google_play_track_version_codes(track: 'production') increment_version_code({ version_code: latest_release[0].to_i + 1, gradle_file_path: "app/build.gradle.kts" }) - gradle(task: "bundleRelease") - upload_to_play_store( - track: 'production', - skip_upload_apk: true, - sync_image_upload: true - ) version_name = get_version_name( gradle_file_path: "./app/build.gradle.kts", ext_constant_name: "versionName" @@ -78,6 +71,12 @@ platform :android do gradle_file_path: "./app/build.gradle.kts", ext_constant_name: "versionCode" ) + gradle(task: "clean bundleRelease") + upload_to_play_store( + track: 'production', + skip_upload_apk: true, + sync_image_upload: true + ) build_success("프로덕션", version_name, version_code) rescue => exception build_fail("프로덕션", version_name, version_code, exception) @@ -87,7 +86,7 @@ platform :android do slack( message: "삐삐(#{title}) AOS 배포 성공", success: true, - slack_url: $slack_url, + slack_url: ENV["SLACK_URL"], payload: { "빌드 날짜" => Time.new.to_s, "배포 버전" => "#{versionName}(#{versionCode})" @@ -99,7 +98,7 @@ platform :android do slack( message: "삐삐(#{title}) AOS 배포 실패", success: false, - slack_url: $slack_url, + slack_url: ENV["SLACK_URL"], payload: { "빌드 날짜" => Time.new.to_s, "배포 버전" => "#{versionName}(#{versionCode})", diff --git a/gradle.properties b/gradle.properties index 6dc67e2..22f8eee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,9 @@ # 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=-Xmx2048m -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xms6144m -Xmx11000m -XX:-UseGCOverheadLimit -XX:+HeapDumpOnOutOfMemoryError -XX:MaxPermSize=512m -XX:+UseParallelGC -Dfile.encoding=UTF-8 +org.gradle.daemon=true +org.gradle.configureondemand=true # 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 @@ -21,4 +23,5 @@ kotlin.code.style=official # 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 -android.enableR8.fullMode=false \ No newline at end of file +android.enableR8.fullMode=false +org.gradle.parallel=true \ No newline at end of file