Search code examples
haxeflashdevelopopenflhaxeflixel

How to run Post-Build Command Line on only 1 target?


After building, FlashDevelop will run this in Project > Properties > Build > Post-Build Command Line:

"$(ProjectDir)\debug-android.bat"

The bat file will install my game on my phone. It's supposed to run only on Android target. But it also runs on Flash target. So how to disable it on Flash target?


Solution

  • You could pass the TargetBuild variable to your .bat file:

    $(ProjectDir)\debug-android.bat $(TargetBuild)

    Then simply exit early if the argument value is not android:

    if not %1 == android goto :eof
    
    echo Running on android
    

    Check Project -> Properties -> Build -> Builder... for all available variables and their current value.