MODPATH as a preprocessor?

Monkey Forums/Monkey Programming/MODPATH as a preprocessor?

therevills(Posted 2015) [#1]
Any chance of getting MODPATH as a preprocessor?


ImmutableOctet(SKNG)(Posted 2015) [#2]
You mean like this?



therevills(Posted 2015) [#3]
More like this:
#MODPATH+="d:\projects\monkey\modules\"


So we dont need to alter the trans config file.


ImmutableOctet(SKNG)(Posted 2015) [#4]
Oh, that's what you mean. That's not really a good idea, considering the paths need to be global.

EDIT: Also, 'MODPATH' (As I posted) is already used for the module's name in normal source code.


therevills(Posted 2015) [#5]
I've got numerous project with different modules and having the ability to specify the MODPATH in code would make it so much easier than it is now!


Samah(Posted 2015) [#6]
Being able to dynamically change the module path seems like a really bad idea, tbh. I can think of situations where modules would break each others import paths.
Why would you need a potentially different MODPATH for every source file? I don't see how it's any harder to just go change one config file.


therevills(Posted 2015) [#7]
I'm not saying do it in every source file, just the main one for the project.

And it's not just one config file... its a new config file every time we get a new MonkeyX release

Also, for example, if we decouple the XML module from Diddy, but Diddy still needs the XML module we could add the MODPATH append to a relative path with Diddy's source.


Samah(Posted 2015) [#8]
@therevills: I'm not saying do it in every source file, just the main one for the project.

But the functionality would still be there to put it in every source file, which is another point of failure.

@therevills: And it's not just one config file... its a new config file every time we get a new MonkeyX release

It's still one file. I just copy paste the old one. Alternatively you could use the module path command-line feature in Jungle.

@therevills: Also, for example, if we decouple the XML module from Diddy, but Diddy still needs the XML module we could add the MODPATH append to a relative path with Diddy's source.

If we decouple the XML module from Diddy, it becomes an external dependency and thus up to the developer to manage.


therevills(Posted 2015) [#9]
But the functionality would still be there to put it in every source file, which is another point of failure.

Same with all the other preprocessors....

It's still one file. I just copy paste the old one. Alternatively you could use the module path command-line feature in Jungle.

You actually have to merge or you may lose new config settings Mark has added, its a PITA.

If we decouple the XML module from Diddy, it becomes an external dependency and thus up to the developer to manage.

Well since we havent got a build system such as Maven for Monkey, I think it could really help.


Samah(Posted 2015) [#10]
@therevills: Well since we havent got a build system such as Maven for Monkey, I think it could really help.

Then we need one. :P
Give me an official place to store modules and I'll write a Gradle plugin.