Skip to content

Commit

Permalink
Added formatting to build process.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Cobbe committed Nov 16, 2016
1 parent a14c07f commit 2690f27
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 0 additions & 2 deletions Format/reformat_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
# `sh reformat_files.sh list_files_reform.txt`
#

echo "Reformating source..."

if [ -z "$1" ]; then
echo "specify the file that contains a list of files"
exit
Expand Down
24 changes: 22 additions & 2 deletions generate_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
type=str,
help='Path to clone of stone repository.',
)
_cmdline_parser.add_argument(
'-n',
'--no-documentation',
type=str,
help='Sets whether no documentation should be generated.',
)


def main():
Expand All @@ -54,15 +60,20 @@ def main():

dropbox_pkg_path = os.path.abspath('Source/ObjectiveDropboxOfficial/PlatformNeutral')
dropbox_tests_path = os.path.abspath('ObjectiveDropbox/DBSerializationTests')
dropbox_format_path = os.path.abspath('Format')

if verbose:
print('Dropbox package path: %s' % dropbox_pkg_path)

if verbose:
print('Generating Obj-C types')

types_cmd = ['python', '-m', 'stone.cli', '-a', 'host', '-a', 'style', 'obj_c_types', dropbox_pkg_path] + specs

if not args.no_documentation:
types_cmd += ['--', '-d', 'true']
o = subprocess.check_output(
(['python', '-m', 'stone.cli', '-a', 'host', '-a', 'style', 'obj_c_types', dropbox_pkg_path] +
specs),
(types_cmd),
cwd=stone_path)
if o:
print('Output:', o)
Expand Down Expand Up @@ -93,6 +104,15 @@ def main():
# if o:
# print('Output:', o)

with open(dropbox_format_path + '/list_files_reformat.txt', "w") as outfile:
get_files_cmd = ['find', '../Source/', '-iname', '*.[mh]']
subprocess.call(get_files_cmd, stdout=outfile, cwd=dropbox_format_path)

subprocess.call(['echo', 'Reformating source...'])
o = subprocess.check_output((['sh', 'reformat_files.sh', 'list_files_reformat.txt']), cwd=dropbox_format_path)
if o:
print('Output:', o)

def _get_client_args():
input_doc = "The file to upload, as an {} object."
dest_doc = ('The file url of the desired download output location.')
Expand Down
2 changes: 1 addition & 1 deletion stone

0 comments on commit 2690f27

Please sign in to comment.