Compiler Directive to Set Assets Directory

Monkey Forums/Monkey Programming/Compiler Directive to Set Assets Directory

c.k.(Posted 2011) [#1]
Just an idea... I thought about this because I'm doing lots of branching for testing and...

Could we have a directive whereby we can specify the *.data folder to go along with the source file? This would make it easier to do testing or version tracking or code branches, as follows:

' in file main.monkey
AssetsDirectory( "main.data" ) ' not really needed because default is main.data, as it is now

' in file main_test.monkey, main_v1.monkey, main_v2.monkey, etc...
' these files are in the same directory as main.monkey above
AssetsDirectory( "main.data" ) ' and I want them to use the same assets as the main.monkey source

Yes, I could just keep making a copy of the assets directory and rename it, but come on! :)

Or how do people do it now?


degac(Posted 2011) [#2]
+1
This is very handy.
I have changed the IDE to create on-the-fly (if the source contains 'Function Main') the proper *.data, but with testing I have a folder full of .data and .build folders... a mess!

In general more control from the source code (maybe via compiler directive) should be a simple solution