[resolved] Release build (or remove trace)

I’ll apologise right off the bat for what is a very basic questions:

I’m trying to build a HTML5 ‘release’ build - I don’t really care about the minification so much as removing all the trace calls…

The problem is (and it’s been noted in other threads) that the html5 release build fails…

So, is there a way to remove trace calls (without doing it manually?)

(Or, if there’s a fix to the html5 release build, I’d be happy to try that.)

You can compile with --no-traces to achieve this.

Thanks very much, that definitely does it.

I would ideally like to be able to build from atom without the traces (although, this isn’t essential, as I can do it from the command line.)

the line in the .hxproj is

<!-- Executed before build --> <preBuildCommand>"$(CompilerPath)/haxelib" run lime build "$(OutputFile)" $(TargetBuild) -$(BuildConfig) -Dfdb --no-traces</preBuildCommand>

I’ve added in the “no traces” but this doesn’t work - have I missed something obvious?

You can also try openfl build html5 -final

thanks, @singmajesty, I tried -final, but this build failed (there’s a thread or two) about reflection causing this. I did read a bit more that maybe turning off DCE may allow it to build…

I’m unable to achieve any of these from altering the hxproj tho…

I worked it out.

You don’t add the no traces to the hxproj, it needs adding to the project.xml like this:

<haxeflag name="--no-traces" />

I would recommend adding if="debug" so you get traces in debug, at least, but that should work :slight_smile:

Adding if="debug" would do the opposite of what you want. Use one of these instead.

<haxeflag name="--no-traces" unless="debug" />
<haxeflag name="--no-traces" if="release" />

I meant if release, but I’m tired and my fingers typed the wrong word :slight_smile:

Thanks, although I’m not sure how I specify between debug & release builds in atom.io

I know that in FlashDevelop you get the options in a drop down…

Is this another flag in the xml, or something in the hxproj ??

> lime test flash -debug
> lime test windows -release
> lime test neko -final

If you omit the build type, it defaults to -release. It doesn’t look like there’s a way to specify this in project.xml, and I’m pretty sure Atom ignores the .hxproj file.

You should be able to define a new hotkey for running Lime with the -debug flag. Otherwise, I think the best you can do is open the settings and manually insert or delete “-debug.”