Eclipse: On Save execute a program

后端 未结 2 1631
傲寒
傲寒 2020-12-15 05:33

I have recently come across the LESS Leaner CSS a template engine for CSS based on ruby. The idea sounded neat, but in practice we need to compile the program to get CSS. Th

2条回答
  •  盖世英雄少女心
    2020-12-15 06:05

    While the Builders are a good solution, keep in mind they only work when a build is issued - either using auto-build or using a manual build which is invoked, well, manually. If you are looking for something that will operate after a save, regardless of the auto-build state you will need to write a plugin which listens to resource changes in Eclipse.

    You do that by creating a workspace change listener and installing it like that:

    ResourcesPlugin.getWorkspace().addResourceChangeListener(
    ..., IResourceChangeEvent.POST_CHANGE);
    

    I'm sure you can take it from here :-)

提交回复
热议问题