From a9db7448e787eeba669b24523f93b610f52beabd Mon Sep 17 00:00:00 2001 From: Jaguar0625 Date: Wed, 16 May 2018 14:08:06 -0400 Subject: [PATCH] delete deprecated incrementSdkVersion.py --- .gitignore | 1 + scripts/incrementSdkVersion.py | 56 ---------------------------------- 2 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 scripts/incrementSdkVersion.py diff --git a/.gitignore b/.gitignore index ce2872673..5895614d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *~ _build*/ node_modules/ +__pycache__/ catapult-*.log* npm-*.log* .idea diff --git a/scripts/incrementSdkVersion.py b/scripts/incrementSdkVersion.py deleted file mode 100644 index 34b91008c..000000000 --- a/scripts/incrementSdkVersion.py +++ /dev/null @@ -1,56 +0,0 @@ -import codecs -import json -import os -import re -from collections import OrderedDict - - -def increment_version_string(version_string): - match = re.match(r'(?P.*)\.(?P.*)\.(?P.*)', version_string) - return '{0}.{1}.{2}'.format(match.group('major'), int(match.group('minor')) + 1, match.group('patch')) - - -def mutate_json_data(filename, mutator): - with codecs.open(filename, 'r', 'utf8') as input_file: - data = json.load(input_file, object_pairs_hook=OrderedDict) - - mutator(data) - - with codecs.open(filename, 'w', 'utf8') as output_file: - json.dump(data, output_file, indent=2) - output_file.write('\n') - - -def increment_self_package_version(package_name): - print('processing {0} (self) ...'.format(package_name)) - - def mutator(data): - data["version"] = increment_version_string(data["version"]) - - mutate_json_data(os.path.join(package_name, "package.json"), mutator) - mutate_json_data(os.path.join(package_name, "package-lock.json"), mutator) - - -def increment_dependent_package_version(package_name, dependency_package_name): - print('processing {0} (dependent) ...'.format(package_name)) - - def package_mutator(data): - version = data["dependencies"][dependency_package_name] - data["dependencies"][dependency_package_name] = increment_version_string(version) - - def package_lock_mutator(data): - version = data["dependencies"][dependency_package_name]["version"] - data["dependencies"][dependency_package_name]["version"] = increment_version_string(version) - - mutate_json_data(os.path.join(package_name, "package.json"), package_mutator) - mutate_json_data(os.path.join(package_name, "package-lock.json"), package_lock_mutator) - - -def main(): - increment_self_package_version("catapult-sdk") - for package_name in ["monitor", "rest", "spammer"]: - increment_dependent_package_version(package_name, "catapult-sdk") - - -if __name__ == '__main__': - main()