Modules directory
Monkey Forums/Monkey Programming/Modules directory
| ||
Monkey has been around for over a year now, and we still can't customise the location of modules. I have Diddy in its own repository location (not in monkey/modules) and it's annoying to have to copy it over every time I make a change. I end up working in the Diddy directory so I don't have to. Either have it as a config value in the trans ini file, or a precompiler directive in your source. Edit: config.txt version here: http://puu.sh/Hw5H (trans.monkey) http://puu.sh/HwgG (trans_winnt.zip) |
| ||
Definitely a +1 for this! Another helpful option would be able to have multiple module locations! That way the official and user modules can be kept separate! |
| ||
Definitely should be supported already. Yes, keep the modules folder for the standard libs. But give us a way to specify another location. |
| ||
+1. and agree with Skn3, Definitely a must. |
| ||
Agree on this. |
| ||
me too :) |
| ||
+1 me too |
| ||
Hmm... it appears there is a -modpath command line option in Trans that does this, but you need to supply the entire module path, which is generated with this: [monkeycode]ENV_MODPATH=".;"+ExtractDir( srcpath )+";"+RealPath( ExtractDir( AppPath )+"/../modules" )[/monkeycode] Not exactly an easy thing to append to on the command line. Rather than break existing functionality, I've added a -modpathappend option which adds extra directories to the module path (semicolon separated). I haven't looked at Ted yet, but from what I can see, neither Monk nor Jungle have a place to add command line parameters to trans. At the moment, the only solution is to compile by command line. F:\Monkey\monkey\bin>trans_winnt.exe -target=html5 test.monkey TRANS monkey compiler V1.34 Parsing... F:/Dev/Repositories/Monkey/monkey/bin/test.monkey<1> : Error : Module 'diddy' not found. F:\Monkey\monkey\bin>trans_winnt.exe -target=html5 -modpathappend="F:\Dev\Repositories\Diddy\src" test.monkey TRANS monkey compiler V1.34 Parsing... Semanting... Translating... Building... trans.monkey: http://puu.sh/GIs1 Sorry, you'll have to build it yourselves. I only have MinGW set up so it complains if the DLL files aren't also in the bin directory. |
| ||
Cool! Just another idea, could we use the "config.(os).txt" by adding a mod path in there? |
| ||
Actually I was about to add (but I ducked off to the shower), that it should really be in the config.txt. Alternatively, you can provide the entire environment path to -modpath, but you need to provide the full path to the modules directory and it's specific for each source file.-modpath=".;test;F:\Monkey\modules" |
| ||
If you use Windows 7 or vista you can do as I do: Use mklink.exe to create a directory (sym)link to your development module folder. example: My module work folders are located in d:\development\monkey\wdw I use this command in the module dir of monkey: mklink /D wdw d:\development\monkey\wdw this will let monkey see a wdw folder in its monkey folder which points to my d:\development\monkey\wdw folder. |
| ||
I've updated trans.monkey to support a MODULE_PATH variable in config.txt. See the first post for a link to the modified source. Essentially, put this in your config.txt and compile as per normal. [monkeycode]MODULE_PATH="D:\Some\Other\Module\Path"[/monkeycode] It will append it to the default module path. |
| ||
Very nice... only 4 lines of (new) code... Mark can please add this officially?? |
| ||
Bump for the next version of Monkey please :) |
| ||
This has been added to Monkey-ext: http://www.monkeycoder.co.nz/Community/posts.php?topic=3387 |