lime icon indicating copy to clipboard operation
lime copied to clipboard

Added "-listen" flag to AIR build params

Open Borman2000 opened this issue 3 years ago • 1 comments

Build AIR app with -listen flag instead of -connect to debug AIR app on device over the usb (default port 7936)

Borman2000 avatar Aug 30 '21 18:08 Borman2000

The first and third commits look fine at a glance, but 9f4f124 isn't a great way to do this.

  • All projects have to keep track of assetsFolders, even though only AIR projects need it.
  • Since you're passing a whole directory, AIR will ignore any asset filters (include/exclude) from project.xml.
  • AIR doesn't know how to process Haxe templates, so any of those are present it may break the build.

I do see the reasoning here. Windows has a hard limit on command line length, and their suggestions to work around it amount to "pass less data" and "store your data in a file for the program to read." Passing less data isn't a great option (as described above), so it would be nice to use the second option. But of course AIR doesn't support it.

How about this for a solution?

  1. Collect the assets individually (instead of using assetsFolders).
  2. Create a temporary folder. Call it targetDirectory + "/assets" or something.
  3. Copy all non-embedded assets to this folder, one by one. So instead of files.push(asset.targetPath), you run AssetHelper.copyAsset(asset, targetDirectory + "/assets").
  4. Now that the temporary folder has the correct assets, pass it to AIR: files.push(targetDirectory + "/assets").

player-03 avatar Nov 18 '21 00:11 player-03