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?
Dan
0
5 comments
Hi,
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?
0
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.
0
Can you file a youtrack issue for this? If there are 3 people who need this, then it is enough ;)
0
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.
0
Avatar
Evgenii Schepotiev
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.
0

Please sign in to leave a comment.