Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handling case that not have version name label #6

Merged
merged 1 commit into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/control_multi_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class VersionCategory(Enum):
PATCH = auto()
MINOR = auto()
MAJOR = auto()
NONE = auto()

# version_name 읽는 함수
def read_gradle_version_name(gradle_file_path, variable_name):
Expand Down Expand Up @@ -85,10 +86,14 @@ def update_version(arg, label_list):
version_code = int(arg['version_code'])
major_version, minor_version, patch_version, revision_version = map(int, arg['version_name'].split('.'))

isBumpLabelNotExist = True
for version_type in list(VersionCategory):
if f'bump-{version_type.name.lower()}' in label_list:
isBumpLabelExist = false
bump_version(version_type, arg['version_code_variable_name'], arg['version_name_variable_name'], version_code, major_version, minor_version, patch_version, revision_version)

if isBumpLabelNotExist:
bump_version(VersionCategory.NONE , arg['version_code_variable_name'], arg['version_name_variable_name'], version_code, major_version, minor_version, patch_version, revision_version)

# 버전 올리는 함수
def bump_version(version_category, vc_variable_name, vn_variable_name, version_code, major_version, minor_version, patch_version, revision_version) :
Expand Down
Loading