• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ldaley/gradle.tmbundle: A TextMate bundle for the Gradle build system

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

ldaley/gradle.tmbundle

开源软件地址(OpenSource Url):

https://github.com/ldaley/gradle.tmbundle

开源编程语言(OpenSource Language):

Ruby 100.0%

开源软件介绍(OpenSource Introduction):

Provides the ability to run Gradle commands from within TextMate.

To use this bundle, you MUST have the Gradle wrapper script (i.e. gradlew) installed at the root of the directory that you have open in TextMate.

Running commands

To run a Gradle command, with any file open, press ⌃⌘G (control + command + G) to bring up the Gradle task menu.

Gradle Commands

There is a predefined set of common tasks, and a “Run Command…” item that will prompt with a dialog where you can enter the arguments to be passed to gradlew.

prompt

output

Targeting

The command menu contains items with (module) and (project) suffixes. The module commands target the module of the currently selected file in the editor, while the project commands operate on the root project.

The current mechanism for finding the module for the open file relies on a *.gradle file being present in the module directory.

prompt

output

Project Structure

The default behaviour is to determine the module name by taking it's relative path from the project root and substituting the forward slashes with colons. So given the following project structure…

modules/module-a
modules/module-b

The bundle will use the following as the names for the modules…

modules:module-a
modules:module-b

However you may have your settings.gradle file configured to use a different convention. If so, you need to provide a “transformer” script that generates the right module names. You might want the names to be module-a and module-b (i.e. no modules prefix). Your settings.gradle would look like…

include 'module-a', 'module-b'

rootProject.children.each { project ->
    project.projectDir = new File(settingsDir, "modules/$fileBaseName")
}

See the Gradle User Guide section on settings.gradle for more on configuration of project structure.

So TextMate can correctly target the module you are asking it to, you need to create a script that takes the module path as input and writes its name as output. This script must be located at .textmate/transform-gradle-project-path in the root of the project. For our custom project structure outlined above, this file would look like…

#!/usr/bin/env ruby

path = STDIN.read
puts path.start_with? "modules:" ? path.sub /^modules:/, "" : path

We are using Ruby here, but it could be anything… it just needs to be an exectuable that takes the default assumed path (i.e. modules:module-a) as input and transforms it into the appropriate path (i.e. module-a).

The Previous Command

The “Run Previous Command” item will always re-run the most recently executed command, regardless of whether it was a project or module targeted command.

Running A Single Test

The “Test Selected File” command runs the command to run the open file in the editor as the single test…

prompt

prompt

Output Filtering Features

prompt

Compile Errors

The filename and line number of output as part of each compile error for Java and Groovy source is a link that will take you to the line of the file which the compile error.

prompt

Failed Tests

The output message for each individual test class failure is linked to the corresponding XML test report which will open in TextMate when clicked.

The output message pointing to the HTML test report on test failure is converted into a link that when clicked opens the test report in your browser.

prompt

Notifications

At the end of the command, a Growl notification will be raised with the result of the command.

prompt




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap