diff --git a/scripts/__init__.py b/scripts/__init__.py new file mode 100644 index 0000000..cc31abc --- /dev/null +++ b/scripts/__init__.py @@ -0,0 +1 @@ +__author__ = 'rzaitov' diff --git a/scripts/build_command.py b/scripts/build_command.py new file mode 100644 index 0000000..62926c8 --- /dev/null +++ b/scripts/build_command.py @@ -0,0 +1,3 @@ +class BuildCommand: + def Execute(self): + return None diff --git a/scripts/commands/__init__.py b/scripts/commands/__init__.py new file mode 100644 index 0000000..cc31abc --- /dev/null +++ b/scripts/commands/__init__.py @@ -0,0 +1 @@ +__author__ = 'rzaitov' diff --git a/scripts/commands/testflight_command.py b/scripts/commands/testflight_command.py new file mode 100644 index 0000000..9a279b8 --- /dev/null +++ b/scripts/commands/testflight_command.py @@ -0,0 +1,33 @@ +import os +import inspect +cur_abs_dir_path = os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0]) +print('testflight_command', cur_abs_dir_path) + +import sys +parent = os.path.split(cur_abs_dir_path)[0] +if parent not in sys.path: + sys.path.append(parent) + +import build_command as bcmd +import testflight as tf + +class PublishToTestFlightCommand(bcmd.BuildCommand): + def __init__(self, api_token, team_token, notes): + self._publisher = tf.TestFlightPublisherBase(api_token, team_token, notes) + + def Execute(self): + self._publisher.Publish() + +if __name__ == '__main__': + import argparse + + parser = argparse.ArgumentParser() + parser.add_argument('path') + parser.add_argument('-at', '--api_token', required=True, help='api token') + parser.add_argument('-tt', '--team_token', required=True, help='team token') + parser.add_argument('-n', '--notes', default=tf.TestFlightPublisherBase.DefaultNotes, help='upload notes') + + args = parser.parse_args() + + cmd = PublishToTestFlightCommand(args.api_token, args.team_token, args.notes) + cmd.Execute() \ No newline at end of file diff --git a/scripts/post_build.py b/scripts/post_build.py deleted file mode 100644 index 53e6b34..0000000 --- a/scripts/post_build.py +++ /dev/null @@ -1,8 +0,0 @@ -import testflight as tf - -def PublishToTestFlight(config): - publisher = tf.TestFlightPublisher(config) - publisher.Publish() - -def PrintToConsole(config): - print 'Sample post build action!' \ No newline at end of file diff --git a/scripts/settings.py b/scripts/settings.py index c0a4cdb..ed76719 100644 --- a/scripts/settings.py +++ b/scripts/settings.py @@ -23,8 +23,8 @@ ios_development_root = { 'projects_to_exclude': ['NotCompileApp'], 'info_plist_rel_path': 'BuildSample/Info.plist', - 'post_build_file': 'post_build.py', - 'post_build_actions' : ['PrintToConsole', 'PublishToTestFlight'], + #'post_build_file': 'post_build.py', + #'post_build_actions' : ['PrintToConsole', 'PublishToTestFlight'], 'patch': patch.PathcIos, 'parent': ios_root diff --git a/scripts/testflight.py b/scripts/testflight.py index d43cb9a..980f960 100644 --- a/scripts/testflight.py +++ b/scripts/testflight.py @@ -33,21 +33,4 @@ class TestFlightPublisher(TestFlightPublisherBase): ipa_rel_path = 'BuildSample/bin/iPhone/Release/BuildSample-{0}.ipa'.format(self._config['version']) ipa_abs_path = os.path.join(sln_dir, ipa_rel_path) - return TestFlightPublisherBase.Publish(self, ipa_abs_path) - -if __name__ == '__main__': - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument('path') - parser.add_argument('-at', '--api_token', required=True, help='api token') - parser.add_argument('-tt', '--team_token', required=True, help='team token') - parser.add_argument('-n', '--notes', default=TestFlightPublisherBase.DefaultNotes, help='upload notes') - - args = parser.parse_args() - - publisher = TestFlightPublisherBase(args.api_token, args.team_token, args.notes) - publisher.Publish(args.path) - - - + return TestFlightPublisherBase.Publish(self, ipa_abs_path) \ No newline at end of file