How can i copy a File after Crtl-F9 ?

Dear Mps-Experts,

i have to copy a json - configuration file into the class_gen / source_gen directory after MPS has done the built. How can i automate that? Is it necessary to run a shell script externally. I thought about using a post-processing script - but that is not the place to copy files i guess.

Any hint?
Comment actions Permalink
I'm also interested in this feature. I need to copy some stuff, too. (e.g. CSS file for html-documentation) etc.

Some ideas anyone?
Comment actions Permalink
Me too :)

What you could do is build your project via Ant and add the corresponding <copy>-Tasks to the script...

It would be nice, if one could just use the build language for such purposes, e.g. by providing the possibility to reference a target for pre or post processing.
Comment actions Permalink
Can you file a youtrack issue for this? If there are 3 people who need this, then it is enough ;)
Comment actions Permalink
MPS 2.0 has limited supported for copying "binary" files to the output directory.

Steps to take in order to use this functionality.

  • Create a rootable concept in your language, say JSONResource, implementing Resource concept interface from j.m.plugin language. The editor should simply allow for editing the "path" field.

[> JSON " { path } " <]

  • In your model create an instance of this concept and specify path to the file you would like to be copied. You can use macros in the path, which you must define yourself.

JSON " ${JSON_HOME}/file.json "

That's all. Next time your model is built, the file should be copied to the output directory.
Evgenii Schepotiev
Comment actions Permalink
Hi! In YouTrack team we had external sources with resources. On compile MPS (MPS 1.5) moves all resources from there to classes_gen folder.

Please sign in to leave a comment.