Wish Conditonal compilation condition #IF Not(Obfuscated)

Chris2

Well-Known Member
Licensed User
Longtime User
Forgive me if this can already be done somehow but...

When testing server/client apps in B4J I run both apps through the IDE at the same time on the same machine. We are limited to running only one app in DEBUG at a time but I want to see the Log() entries that I have in the IDEs of both apps. I don't really want those Log() entries to be in the code of the final compiled release though.

If there was a compilation condition that could be used like:
B4X:
#If Not(obfuscated)
Log($"Shown in Debug & Release but not Release(obfustaced)"$)
#End if
then I would see Log() entries when testing within the IDE in both DEBUG & RELEASE mode, but the Log() would not be present in the final release for which I always compile under Release(obfuscated).

I hope that makes sense!

[I guess this an alternative to the wish of being able to run multiple apps in Debug at the same time on the same machine]

EDIT: I just found that @tchart has already wished for this - https://www.b4x.com/android/forum/threads/compiler-directive-release_obfuscated.139352/
My apologies for the duplication. I don't think that it's been impemented yet though.
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
There is already a built-in OBFUSCATED symbol:

1786250733340.png


Your code should work.
 

Chris2

Well-Known Member
Licensed User
Longtime User
Hmm, I'm not sure how I missed that.
Although it works as expected for the enclosed code, the greying out of text in the IDE doesn't appear to work as normal:
With #If OBFUSCATED, the code is always greyed out no matter which compile mode is selected. And the converse is true with #If Not(OBFUSCATED)

I wouldn't expect the Log() to be greyed out here when Release(obfuscated) us selected:
1786347601568.png
1786347613884.png
1786347627710.png


And with #If Not(OBFUSCATED), I'd expect the code to be grey only under Release(obfuscated):
1786347714592.png
1786347728112.png
1786347746307.png
 

Attachments

  • 1786347482504.png
    1786347482504.png
    4.9 KB · Views: 43

Chris2

Well-Known Member
Licensed User
Longtime User
So I didn't spot that the thing I was wishing for already exists, and then I didn't read the info from when it was added - let's call it an off day :rolleyes:
 
Top