Skip to content

Commit

Permalink
feat: Gradle Optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
CChuYong committed Jan 28, 2024
1 parent 0948965 commit 3db05fe
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
49 changes: 24 additions & 25 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
default_platform(:android)
$slack_url = ENV["SLACK_URL"]

platform :android do
desc "Runs all the tests"
Expand All @@ -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"
Expand All @@ -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)
Expand All @@ -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"
Expand All @@ -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)
Expand All @@ -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"
Expand All @@ -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)
Expand All @@ -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})"
Expand All @@ -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})",
Expand Down
7 changes: 5 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
android.enableR8.fullMode=false
org.gradle.parallel=true

0 comments on commit 3db05fe

Please sign in to comment.