指定和崇高的文本2 ant目标之间切换 [英] Specify and switch between ant targets in sublime text 2

查看:143
本文介绍了指定和崇高的文本2 ant目标之间切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用文本崇高2 I'm连同蚂蚁构建系统。 CTRL + B工作完全正常使用默认的目标启动构建。但是我的问题是,有没有定义不同的Ant构建目标,并有一个机制很容易​​它们之间切换的方式?

I´m using Sublime Text 2 together with the ant build system. CTRL+B works perfectly fine to start the build with the default target. However my question is, is there a ways to define different ant build targets and have a mechanism to switch between them easily?

我想过创造更多的自定义生成每个目标的命令 - 例如像干净。它的工作原理,而是因为你必须去工具>生成系统>蚂蚁(清洁),按CTRL + B之后,是不是在我眼里最好的办法。

I thought about creating additional custom build commands for each target - for example like "clean". It works, but that is not the best approach in my eyes because you have to go to "Tools > Build System > Ant (clean)" and hit CTRL+B afterwards.

推荐答案

保存此构建文件作为软件包/用户文件夹* .sublime-build文件

Save this build file as *.sublime-build file in the Packages/User folder

{
    "selector": "source.java",
    "cmd": ["ant"],

    "variants": [

        { "cmd": ["solve_world_hunger"],
          "name": "Solve World Hunger"
        },

        { "cmd": ["ant", "clean"],
          "name": "Run"
        }
    ]
}


  • 默认目标将建立在 CTRL + B

  • 变种阵列名为运行将在 CTRL +运行移CMD + b

  • 的变种阵列中的CMD可以通过命令面板通过搜索名称运行。即按 CTRL + SHIFT + P 键,键入解决世界饥饿来运行解决世界饥饿命令。

    • Default target will build on ctrl+b
    • The cmd named Run in the variants array will run on ctrl+shift+b
    • Any cmd in the variants array can be run via the command palette by searching for name. i.e. hit ctrl+shift+p and type Solve World Hunger to run the solve world hunger command.
    • 这篇关于指定和崇高的文本2 ant目标之间切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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