Skip to content

[asset_transformers] Provide the current target platform in the asset transformer #159323

@navaronbracke

Description

@navaronbracke

Use case

Developers wanting to transform assets, based on the current target platform (i.e. flutter build web -> web; flutter build apk -> android), currently cannot infer the target platform during the asset transformation.

Proposal

I propose that the target platform of the flutter build invocation is provided as either an argument, or in Platform.environment. I initially tried checking what is inside Platform.environment and the FLUTTER_BUILD_MODE seems to be there already?

Then I think the easiest thing to do is to also add something like FLUTTER_BUILD_TARGET_PLATFORM to Platform.environment or the args that are passed to the asset transformer, whichever makes more sense / is cleaner from a tool perspective.

Context: I was initially exploring if I could work around the absence of #141371 using an asset transformer

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: assetsPackaging, accessing, or using assetsa: buildBuilding flutter applications with the toolc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy