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

MauiBlazor iOS Scenarios #2387

Merged
merged 3 commits into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/scenarios/mauiblazorios/post.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'''
post cleanup script
'''

from shared.postcommands import clean_directories

clean_directories()
42 changes: 42 additions & 0 deletions src/scenarios/mauiblazorios/pre.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
'''
pre-command
'''
import sys
import os
from zipfile import ZipFile
from performance.logger import setup_loggers, getLogger
from shutil import copyfile, copytree, move
from shared.const import PUBDIR
from argparse import ArgumentParser

setup_loggers(True)

parser = ArgumentParser()
parser.add_argument('--unzip', help='Unzip ipa file and report extracted tree', action='store_true', default=False)
parser.add_argument(
'--name',
dest='name',
required=True,
type=str,
help='Name of the file/folder to setup (with .app or .ipa)')
args = parser.parse_args()

name = args.name
namezip = '%s.zip' % (name)
if not os.path.exists(PUBDIR):
os.mkdir(PUBDIR)
if not os.path.exists(name):
getLogger().error('Cannot find %s' % (name))
exit(-1)
if args.unzip:
if not os.path.exists(namezip):
copyfile(name, namezip)

with ZipFile(namezip) as zip:
zip.extractall(os.path.join('.', PUBDIR))

else:
if(os.path.isdir(name)):
copytree(name, PUBDIR, dirs_exist_ok=True)
else:
copyfile(name, os.path.join(PUBDIR, name))
12 changes: 12 additions & 0 deletions src/scenarios/mauiblazorios/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'''
C# Console app
'''
from shared.runner import TestTraits, Runner

EXENAME = 'MauiBlazoriOSDefault'

if __name__ == "__main__":
traits = TestTraits(exename=EXENAME,
guiapp='false',
)
Runner(traits).run()