构建工件后如何运行脚本 [英] How to run a script after building an artifact

查看:81
本文介绍了构建工件后如何运行脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Idea做一个小的LeJOS项目.一切都很好,只是我希望在编译工件后将准备好的罐子直接投射到我的EV3砖上.我有一个准备好的脚本,现在我从命令行手动启动它.但是,嘿!这是21世纪!如何在构建工件后立即让Idea自动运行脚本?甚至更好-我如何在其中添加一个简洁的图标来完成所有操作:1)编译2)运行我的脚本?

I'm doing a small LeJOS project using Idea. Everything is fine, except I would like the ready jar to be beamed straight to my EV3 brick after compilation of the artifact. I have a ready script for that, I launch it from command line manually now. But, hey! This is 21st century! How do I make Idea run my script automatically right after my artifact is built? Even better - how do I add a neat icon to that would do it all: 1) compile 2) run my script?

推荐答案

将脚本配置为外部工具文件>设置>工具>外部工具",然后从编辑>宏>开始宏记录"中记录并保存宏",其中包含先构建项目,然后调用外部工具.

Configure your script as a external tool "File > Settings > Tools > External Tools", then record and save the macro from "Edit > Macros > Start macro Recording" containing first building the project then invoking your external tool.

从现在开始,您只需要在编辑>宏"中播放此宏(一个操作可以同时调用构建和梁).

From now on you'll have just to play this macro from "Edit > Macros " (one action to call both build and beam).

甚至,您可以将此宏作为图标添加到工具栏(右键单击工具栏>自定义菜单和工具栏",从主工具栏"中选择一个操作,调用添加后"并选择您的宏).

Even more, you can add this macro as an icon to the toolbar (right click on the toolbar > Customize Menus and Toolbars, select an action from the "Main Toolbar", call "Add After" and choose your macro).

这篇关于构建工件后如何运行脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆