All Projects → gradle → Gradle Completion

gradle / Gradle Completion

Licence: mit
Gradle tab completion for bash and zsh

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Gradle Completion

Kotlin Frontend Plugin
Gradle Kotlin (http://kotlinlang.org) plugin for frontend development
Stars: ✭ 578 (-22.73%)
Mutual labels:  gradle
Hibeaver
HiBeaver is a gradle plugin for java byte code manipulation and AOP design by modifying project byte code during build of the package, or modifying byte code within Jar independently.
Stars: ✭ 617 (-17.51%)
Mutual labels:  gradle
Fs Blog
个人博客,Spring Boot 开山之作,采用 Spring Boot + MyBatis,前端 Bootstrap + LayUI,支持程序员非常青睐的轻量化的 Markdown 编辑器 Editor.md,支持标签分类检索
Stars: ✭ 700 (-6.42%)
Mutual labels:  gradle
Adblockfast
Adblock Fast is a new, faster ad blocker for Android, iOS, Chrome, and Opera.
Stars: ✭ 582 (-22.19%)
Mutual labels:  gradle
Charlatano
Proves JVM cheats are viable on native games, and demonstrates the longevity against anti-cheat signature detection systems
Stars: ✭ 599 (-19.92%)
Mutual labels:  gradle
Gradle Docker
A Gradle plugin to build Docker images from the build script.
Stars: ✭ 639 (-14.57%)
Mutual labels:  gradle
Gradlekotlinconverter
Convert from Groovy to Kotlin DSL for Gradle, focused on Android.
Stars: ✭ 559 (-25.27%)
Mutual labels:  gradle
Ktlint Gradle
A ktlint gradle plugin
Stars: ✭ 713 (-4.68%)
Mutual labels:  gradle
Applozic Android Sdk
Android Real Time Chat & Messaging SDK
Stars: ✭ 611 (-18.32%)
Mutual labels:  gradle
Deep Clean
When Gradle or the IDE let you down, just --nuke all them caches
Stars: ✭ 689 (-7.89%)
Mutual labels:  gradle
Java Sdk
🥇 Java SDK to use the IBM Watson services.
Stars: ✭ 587 (-21.52%)
Mutual labels:  gradle
Spock Example
Spock example specifications along with ready-to-go Gradle and Maven builds
Stars: ✭ 595 (-20.45%)
Mutual labels:  gradle
Minecraftdev
Plugin for IntelliJ IDEA that gives special support for Minecraft modding projects.
Stars: ✭ 645 (-13.77%)
Mutual labels:  gradle
Xaop
🔥A lightweight AOP(Android) application framework. Includes the most practical AOP applications.(一个轻量级的AOP(Android)应用框架。囊括了最实用的AOP应用)
Stars: ✭ 579 (-22.59%)
Mutual labels:  gradle
Gogradle
A Gradle Plugin Providing Full Support for Go
Stars: ✭ 712 (-4.81%)
Mutual labels:  gradle
Learning Resources
"Technology Gold mine" to collect and share materials/resources
Stars: ✭ 573 (-23.4%)
Mutual labels:  gradle
Bottomdialogs
An Android library that shows a customizable Material-based bottom sheet. API 11+ required.
Stars: ✭ 624 (-16.58%)
Mutual labels:  gradle
Stringfog
一款自动对字节码中的字符串进行加密Android插件工具
Stars: ✭ 733 (-2.01%)
Mutual labels:  gradle
Walle
Android Signature V2 Scheme签名下的新一代渠道包打包神器
Stars: ✭ 6,283 (+739.97%)
Mutual labels:  gradle
Ok Gradle
IntelliJ/Android Studio plugin for searching artifacts ids of popular Java libraries.
Stars: ✭ 664 (-11.23%)
Mutual labels:  gradle

gradle-completion

Bash and Zsh completion support for Gradle.

This provides fast tab completion for:

  • Gradle tasks for the current project and sub-projects
  • Gradle CLI switches (e.g. --parallel)
  • Common Gradle properties (e.g. -Dorg.gradle.debug)

It also handles custom default build files, so rootProject.buildFileName = 'build.gradle.kts' is supported.

See instructions for bash or for zsh, then consider optional additional configuration.

Here's a demo for the gradle project itself: Completion demo

Installation for Zsh 5.0+

Install via Homebrew

brew install gradle-completion

# Ensure /usr/local/share/zsh/site-functions is on $fpath. You should get a result from the following
echo $fpath | grep "/usr/local/share/zsh/site-functions"

Install as oh-my-zsh plugin

Download and place the plugin and completion script into your oh-my-zsh plugins directory.

git clone git://github.com/gradle/gradle-completion ~/.oh-my-zsh/plugins/gradle-completion

Add gradle-completion to the plugins array in your '.zshrc' file.

plugins+=(gradle-completion)

Install manually

Download and place _gradle on your $fpath. I recommend $HOME/.zsh/gradle-completion:

git clone git://github.com/gradle/gradle-completion ~/.zsh/gradle-completion

Add the following do your '.zshrc' file:

echo "\nfpath=($HOME/.zsh/gradle-completion \$fpath)" >> ~/.zshrc

Start a new terminal session. You may need to disable the gradle plugin for oh-my-zsh.

(Optional) Manual Completion Cache Initialization

Completion cache initialization happens the first time you invoke completion, and usually takes a few seconds, depending on the size of your project. You can manually initialize the cache and avoid interrupting your development mojo by running:

cd path/to/your-project
source ~/.zsh/gradle-completion/_gradle 1>&2 2>/dev/null; __gradle-completion-init

Installation for Bash 3.2+

Install via Homebrew

brew install gradle-completion

# Source completion scripts from bash-completion in your bash profile
echo '[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"' >> ~/.bash_profile

# Load changes to bash profile
source ~/.bash_profile

Install manually

Download and place gradle-completion.bash in your bash_completion.d folder, usually /etc/bash_completion.d, /usr/local/etc/bash_completion.d, or $HOME/bash_completion.d:

mkdir $HOME/bash_completion.d
curl -LA gradle-completion https://edub.me/gradle-completion-bash -o $HOME/bash_completion.d/gradle-completion.bash

NOTE: Ensure bash-completion 1.2+ is installed using your favorite package manager or by following the bash-completion installation instructions.

Add the following to your .bash_profile (macOS) or .bashrc (Linux) file:

source $HOME/bash_completion.d/gradle-completion.bash

Start a new terminal session.

(Optional) Manual Completion Cache Initialization

Completion cache initialization happens the first time you invoke completion, and usually takes a few seconds, depending on the size of your project. You can manually initialize the cache and avoid interrupting your development mojo by running:

cd path/to/your-project
__gradle-completion-init

Additional Configuration

Excluding build scripts from UP-TO-DATE check

Tab completion checks known build scripts to see if they've been changed and refreshes the task cache if so. You can exclude build scripts from this check (and speed up completion) by specifying:

# Default is `"/(build|integTest|out)/"`
export GRADLE_COMPLETION_EXCLUDE_PATTERN="/(build|integTest|samples|smokeTest|testFixtures|templates|out|features)/"
# Essentially turn off checking for changed scripts
export GRADLE_COMPLETION_EXCLUDE_PATTERN="gradle"

Completion cache

One can manually (re)generate the completion cache by invoking __gradle-completion-init after the completion script has been sourced. This graciously avoids an unexpected cache build when invoking completion.

The build script cache is invalidated if any *.gradle or *.gradle.kts files change. However, these completion scripts do not search for new build scripts every time completion is invoked, because that would make completion ~20x slower (unless you have so really good ideas on this).

By default, the build script cache is invalidated every 3 weeks (30240 minutes). You can configure this value by exporting a new value for $GRADLE_CACHE_TTL_MINUTES:

export GRADLE_CACHE_TTL_MINUTES=$(expr 1440 \* number_of_days_you_want)

Implicit Tasks

Gradle allows you to access tasks of subprojects from the project root implicitly. For example, given these tasks:

:foo
:help
:bar:baz

You can execute gradle baz from the project root and it will execute :bar:baz.

gradle-completion will not tab complete these tasks by default because it adds a significant number of completion options, which may not be what you want and negatively impacts completion speed.

To allow completion of implicit tasks, set $GRADLE_COMPLETION_UNQUALIFIED_TASKS=true:

export GRADLE_COMPLETION_UNQUALIFIED_TASKS="true"

You may need to invalidate the cache using the cache config above or by executing touch build.gradle.

Troubleshooting

If zsh completion isn't working, first try checking your $fpath with echo $fpath.

zsh completion using ./gradlew may not work on Linux if you don't have . on your $PATH, so I recommend adding it in your ~/.zshrc file:

export PATH=".:$PATH"

HEADS UP: If you get an error 'parse error near `]]"', please upgrade zsh. zsh 5.0.5 has a bug in script parsing that is fixed as of zsh 5.0.8. See issues #4 and #7 for more details.

If zsh completion reports "Generating Gradle task cache..." every time, the zsh completion cache may be disabled. Enable it by adding the following to your ~/.zshrc file:

zstyle ':completion:*' use-cache on

Contributing

See the contributing guide.

Acknowledgements

Bash completion is inspired by Nolan Lawson's Gradle tab completion for bash.

Zsh completion is an improved version of zsh's built-in Gradle completion.

Current improvements over built-in support:

  • Subproject tasks are completed
  • Gradle CLI options are current as of Gradle 6.4
  • Common Gradle properties are completed
  • Handles default build file as specified in settings.gradle
  • ~20x faster completion speed for medium to large projects
  • Completion cache updates in the background after first invocation
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].