-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add CLI tool scaffolding #5
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
Conversation
remove caches pyc fix
…scaffolding-66ff # Conflicts: # .cursor/rules/overview.mdc # .gitignore
src/app_size_analyzer/__init__.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These __init__.py
files are annoying to add/maintain but I've seen they are recommended to help IDEs with completions.
console = Console() | ||
|
||
|
||
@click.group(invoke_without_command=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This uses click
as the CLI lib which I've seen other projects in Sentry use.
click.echo(ctx.get_help()) | ||
|
||
|
||
@cli.command() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit of a mouthful to read but this essentially sets up the ios
subcommand, so these flags are only applicable to iOS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Longer term I think we'll want to try to infer iOS vs Android from the artifact itself and avoid subcommands, but I do think for now it's fine for iOS-specific args
console.print(f"[bold green]✓[/bold green] Results written to: [cyan]{output_path}[/cyan]") | ||
|
||
|
||
def _print_table_output(results: AnalysisResults, quiet: bool) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll probably delete this table output at some point but so far it's been helpful with debugging.
extract_archive(input_path, temp_dir) | ||
return find_app_bundle(temp_dir, platform="ios") | ||
|
||
def _extract_app_info(self, app_bundle_path: Path) -> AppInfo: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a lot of this we don't need anymore since we'll do it on the upload path, right? Particularly because we will need it for build distribution too so it shouldn't be tied to size analysis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea not sure exactly where that will live but it will definitely not be part of size analysis later on. Just threw in here for now.
# Conflicts: # .cursor/rules/overview.mdc # .gitignore
Adds a basic analysis CLI tool for iOS apps. Running:
will spit out an
ios-analysis-report.json
file with basic information.