change add_framework to 'append' type (less confusing with positional arguments). Change name to --add-frameworks, as the flag can now be specified once per additional framework. Add frameworks from create also
This commit is contained in:
parent
49c607a80d
commit
b4219a5165
1 changed files with 4 additions and 3 deletions
|
@ -1332,6 +1332,7 @@ Xcode:
|
||||||
description="Create a new xcode project")
|
description="Create a new xcode project")
|
||||||
parser.add_argument("name", help="Name of your project")
|
parser.add_argument("name", help="Name of your project")
|
||||||
parser.add_argument("directory", help="Directory where your project lives")
|
parser.add_argument("directory", help="Directory where your project lives")
|
||||||
|
parser.add_argument("--add-framework", action="append", help="Additional Frameworks to include with this project")
|
||||||
args = parser.parse_args(sys.argv[2:])
|
args = parser.parse_args(sys.argv[2:])
|
||||||
|
|
||||||
from cookiecutter.main import cookiecutter
|
from cookiecutter.main import cookiecutter
|
||||||
|
@ -1362,7 +1363,7 @@ Xcode:
|
||||||
"{}-ios".format(args.name.lower()),
|
"{}-ios".format(args.name.lower()),
|
||||||
"{}.xcodeproj".format(args.name.lower()),
|
"{}.xcodeproj".format(args.name.lower()),
|
||||||
"project.pbxproj")
|
"project.pbxproj")
|
||||||
update_pbxproj(filename)
|
update_pbxproj(filename, pbx_frameworks=args.add_framework)
|
||||||
print("--")
|
print("--")
|
||||||
print("Project directory : {}-ios".format(
|
print("Project directory : {}-ios".format(
|
||||||
args.name.lower()))
|
args.name.lower()))
|
||||||
|
@ -1373,7 +1374,7 @@ Xcode:
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description="Update an existing xcode project")
|
description="Update an existing xcode project")
|
||||||
parser.add_argument("filename", help="Path to your project or xcodeproj")
|
parser.add_argument("filename", help="Path to your project or xcodeproj")
|
||||||
parser.add_argument("--add-frameworks", nargs="*", help="Frameworks to add to this project")
|
parser.add_argument("--add-framework", action="append", help="Additional Frameworks to include with this project")
|
||||||
args = parser.parse_args(sys.argv[2:])
|
args = parser.parse_args(sys.argv[2:])
|
||||||
|
|
||||||
filename = args.filename
|
filename = args.filename
|
||||||
|
@ -1391,7 +1392,7 @@ Xcode:
|
||||||
print("ERROR: {} not found".format(filename))
|
print("ERROR: {} not found".format(filename))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
update_pbxproj(filename, pbx_frameworks=args.add_frameworks)
|
update_pbxproj(filename, pbx_frameworks=args.add_framework)
|
||||||
print("--")
|
print("--")
|
||||||
print("Project {} updated".format(filename))
|
print("Project {} updated".format(filename))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue