简体   繁体   English

添加带有快捷方式的按钮,或仅在Eclipse中用于蚂蚁任务的快捷方式

[英]adding buttons with shortcuts, or shortcuts only for ant tasks in Eclipse

I am working on a project which has an Ant script for all lifecycle phases. 我正在一个项目中执行所有生命周期阶段的Ant脚本。 The project, divided in small projects, is meant to be developed with Eclipse. 该项目分为小项目,旨在使用Eclipse开发。 The common version is the Indigo One. 通用版本是Indigo One。

Basically I am interested on putting a series of buttons with a shortcut each, or at least a shortcut only, to execute some of the main tasks. 基本上,我感兴趣的是放置一系列按钮,每个按钮都有一个快捷方式,或者至少只有一个快捷方式,以执行一些主要任务。 The relevant tasks are: 相关任务是:

  • fast build: this involves only the front end classes and jsps, I have solved this easily in the builders panel by adding an Ant build which call the task, for later review with the buttons issue, because there's no shortcut for the "Project->Build Project" 快速构建:仅涉及前端类和jsps,我已经在构建器面板中轻松解决了这一问题,方法是添加一个调用该任务的Ant构建,以供稍后查看按钮问题,因为“ Project->建立项目”
  • full build: occasionally I need to launch a task for a complete build, which is taking quite some time in respect to a simple build 完整版本:有时我需要启动一个完整版本的任务,相对于简单版本而言,这需要花费很多时间
  • deploy: this task simply packs the war file and deploy to a local jboss location, at the moment I am launching the jboss server manually via shell script, but I was thinking for a convenient way to have it launched by Eclipse if not already started deploy:此任务只是打包war文件并部署到本地jboss位置,此刻,我正在通过外壳脚本手动启动jboss服务器,但是我正在考虑一种简便的方法,以使Eclipse(如果尚未启动)启动它

thanks 谢谢

You can add a couple of "ant build" launch configurations to run your ant script(s) with specified ant targets and configuration. 您可以添加几个“ ant build”启动配置,以使用指定的ant目标和配置运行您的ant脚本。

Run>External Tool...>External Tools Configurations... and then select "ant build" and press "New launch configuration". 运行>外部工具...>外部工具配置...,然后选择“ ant build”并按“新启动配置”。 On "Main" tab specify buildfile and directory on "Target" select targets you want to run on "Properties" add additional properties or specify property file. 在“主要”选项卡上的“目标”上指定构建文件和目录,选择要在“属性”上运行的目标,添加其他属性或指定属性文件。

It would be also a good idea to give each of launch configurations a descriptive name. 给每个启动配置一个描述性名称也是一个好主意。

Later you can add your defined configuration to favorites for convenience and use them from External Tools (down arrow) on the toolbar (See: Run>External Tool...>Organize Favorites...) 稍后,您可以将定义的配置添加到收藏夹中以方便使用,并从工具栏上的“外部工具”(向下箭头)中使用它们(请参阅:“运行”>“外部工具...”>“组织收藏夹...”)

You can use the Ant view, which is integrated into Eclipse. 您可以使用集成到Eclipse中的Ant视图。 Press Ctrl+3 (cmd+3 on mac I think) and type Ant, and then open the view. 按Ctrl + 3(我认为在Mac上为cmd + 3)并键入Ant,然后打开视图。 Click on "Add buildfile" and add the relevant build file. 单击“添加构建文件”并添加相关的构建文件。 It'll then have the ant tasks listed in the view which you can just run from there. 然后它将在视图中列出蚂蚁任务,您可以从那里开始运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM