From e8fb546a1826dc4d90478e9e902c4895305bb8d4 Mon Sep 17 00:00:00 2001 From: Rustam Zaitov Date: Wed, 2 Oct 2013 21:57:39 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=20=D0=B0?= =?UTF-8?q?=D0=B1=D1=81=D1=82=D1=80=D0=B0=D0=BA=D1=82=D0=BD=D0=BE=D0=B9=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B=20=D0=B8=20?= =?UTF-8?q?=D0=BE=D0=B4=D0=BD=D0=B8=D0=BC=20=D0=B8=D0=B7=20=D0=BD=D0=B0?= =?UTF-8?q?=D1=81=D0=BB=D0=B5=D0=B4=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2=20=D1=81?= =?UTF-8?q?=D0=B4=D0=B0=D0=BB=D0=B0=D0=BB=20testflight=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/__init__.py | 1 + scripts/build_command.py | 3 +++ scripts/commands/__init__.py | 1 + scripts/commands/testflight_command.py | 33 ++++++++++++++++++++++++++ scripts/post_build.py | 8 ------- scripts/settings.py | 4 ++-- scripts/testflight.py | 19 +-------------- 7 files changed, 41 insertions(+), 28 deletions(-) create mode 100644 scripts/__init__.py create mode 100644 scripts/build_command.py create mode 100644 scripts/commands/__init__.py create mode 100644 scripts/commands/testflight_command.py delete mode 100644 scripts/post_build.py 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