Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package argument when building android from CLI #5285

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions launcher/game/android.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ init python:
c.save(p.path)


def android_build(p=None, gui=True, bundle=False, install=False, launch=False, destination=None, opendir=False):
def android_build(p=None, gui=True, bundle=False, install=False, launch=False, destination=None, opendir=False, packages=None):
"""
This actually builds the package.
"""
Expand All @@ -220,9 +220,12 @@ init python:
reporter = distribute.TextReporter()
rapt_interface = rapt.interface.Interface()

if not packages:
packages = ['android']

distribute.Distributor(p,
reporter=reporter,
packages=[ 'android' ],
packages=packages,
build_update=False,
noarchive=True,
packagedest=dist,
Expand Down Expand Up @@ -711,6 +714,7 @@ init python:
ap.add_argument("--install", action="store_true", help="Installs the app on a device.")
ap.add_argument("--launch", action="store_true", help="Launches the app after build and install complete. Implies --install.")
ap.add_argument("--destination", "--dest", default=None, action="store", help="The directory where the packaged files should be placed.")
ap.add_argument("--package", action="append", help="If given, a package to build. Defaults to building all packages.")

args = ap.parse_args()

Expand All @@ -719,7 +723,12 @@ init python:

p = project.Project(args.android_project)

android_build(p=p, gui=False, bundle=args.bundle, install=args.install, launch=args.launch, destination=args.destination)
if args.package:
packages = args.package
else:
packages = None

android_build(p=p, gui=False, bundle=args.bundle, install=args.install, launch=args.launch, destination=args.destination, packages=packages)

return False

Expand Down