request: allow modules to copy external libs over?

Monkey Forums/Monkey Programming/request: allow modules to copy external libs over?

Skn3(Posted 2012) [#1]
Hey,

I wrote the starts of an actually useful module ( http://monkeycoder.co.nz/Community/posts.php?topic=2397 ) yesterday. I noticed the issue before when experimenting with other modules, but hadn't really bothered me until now. Basically, when you need to import external sources into your monkey project it is a bit messy for the module designer and then the module user!

The trouble is that monkey dumps all of your "import <filename>" into your main source file. Would it be possible to get a new feature to avoid this or assist it? The ideal option would be to maintain the individual source imports as an import statement instead of manipulating the code but of course this is tricky across platforms.

The other option is to use a glue file and then have that store the lines of code that import the external files. This is perfectly acceptable, but there is no way to tell the compiler to copy over additional files into the users project?

It is fine if you are just writing the import lines directly into the output of the targets template, but with a module you don't have that luxury, you need to do something so users don't have to fiddle around and possibly end up getting frustrated! (not everyone can work this stuff out)

How about something along the lines of:
build "my_directory/lib123.as"

This would copy the file along when the project is built? We can currently do it for images by importing the image, so it would be really helpful for modules writers to allow this for additional files...

Maybe even:
Import "filename" copy


...or some kind of module.data folder that facilitates this?


I had to wrap some of the https://github.com/mikechambers/as3corelib libraries which was fairly easy in the end, but it did involve making modifications to the actual library code. I had to strip out the actionscript package definitions and tweaking the class declarations to avoid monkeys final output messing with what the compiler expects...

[edit]Thinking about it I may have posted a similar thread to this before?.. hmmmm... well anyway, the issue still stands[/edit]