Skip to content

Conversation

@myavuzokumus
Copy link

What does this PR do?

This PR introduces a major enhancement by adding support for dynamic flutter build windows arguments. Users can now pass arguments like --obfuscate, --split-debug-info, and --dart-define directly through the inno_build command line.

This resolves the limitation of the previous implementation, which only supported --debug and --release flags, and enables users to leverage the full power of Flutter's build capabilities for professional production builds.

Outline of the changes

  • FlutterBuilder Refactored: The FlutterBuilder service is no longer limited to a few fixed parameters. It now accepts a Map<String, dynamic> of arguments, which it dynamically appends to the flutter build command.
  • Dynamic Argument Parsing: The main InnoBuild class now intelligently collects all Flutter-related arguments passed to the CLI and forwards them to the FlutterBuilder.
  • Easily Extensible: A new constant list, _flutterBuildOptions, has been added to make it trivial to add support for new Flutter arguments in the future without changing the core logic.
  • New CLI Options: The ArgParser has been updated to officially support:
    • --obfuscate
    • --split-debug-info=<path>
    • --dart-define=<key=value> (can be used multiple times)
    • --target=<path>

How to use

After these changes, users can build their applications with advanced options:

Example 1: Build with obfuscation

dart run inno_build --release --obfuscate```

**Example 2: Split debug info and define a variable**
```bash
dart run inno_build --release --split-debug-info=build/symbols --dart-define=API_URL=https://prod.api.com

This contribution significantly increases the utility and professionalism of the package.

myavuzokumus and others added 2 commits August 16, 2025 11:44
Refactors the Flutter build process to allow any argument from the
`flutter build windows` command to be passed through the CLI.

This change introduces a more flexible and scalable architecture by:
- Modifying `FlutterBuilder` to accept a dynamic map of arguments.
- Adding a predefined list of passthrough options in `inno_build.dart`
  to easily manage and extend supported arguments.
- Updating `ArgParser` in the main executable to include new options
  like `--obfuscate`, `--split-debug-info`, and `--dart-define`.

This enables crucial features like code obfuscation and compile-time
variable definitions, making the tool suitable for more professional
and secure production builds.
Copy link
Owner

@izzalDev izzalDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear @myavuzokumus

Thanks for your idea—it's very interesting. However, I belive it would be more dynamic and efficient to directly passthrough the flutter build windows arguments to the Flutter SDK. For example:

dart run inno_build [inno-build-options] -- [flutter-build-windows-options]

With this approach, any changes in the Flutter SDK will be automatically adapted by the program, without need to changes this code and manually parse each argument.

Note: You can use rest property from ArgParser instance to capture options that are not explicitly listed.

@izzalDev izzalDev added the enhancement New feature or request label Aug 20, 2025
@izzalDev izzalDev assigned izzalDev and unassigned izzalDev Aug 20, 2025
@izzalDev izzalDev self-assigned this Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants