Gradle Autocomplete for Powershell

Overview

Gradle Autocomplete for Powershell

The autocompletion works by creating a .tasks file in the project folder at the first time it is executed.
Following executions will use this file to determine the matching task.
If you need to refresh the task list simply delete the .tasks file

Usage

  1. Download the gradleAutoComplete.jar and gradleAutoComplete.bat
  2. Add the containing folder to the PATH Environment variable
  3. Set ExecutionPolicy in Powershell to RemoteSigned:
    1. Run Powershell as Administrator
    2. Run Set-ExecutionPolicy RemoteSigned
  4. Add the following snippet to your $PROFILE in the Powershell (notepad.exe $PROFILE)
# The code that will perform the auto-completion
$scriptBlock = {
    # The parameters passed into the script block by the
    #  Register-ArgumentCompleter command
    param(
            $commandName, $parameterName, $wordToComplete,
            $commandAst, $fakeBoundParameters
    )

    # The list of values that the typed text is compared to
    $values = ''
    if (Test-Path './gradlew.bat' -PathType leaf){
        if(Test-Path './.tasks' -PathType leaf){
            $values = Get-Content -Path './.tasks'
        }else{
            $pwd= pwd
            try{
                $values = gradleAutoComplete $pwd
            }catch{
                Write-Host "An error occurred:"
                Write-Host $_
            }
            Out-File -FilePath './.tasks' -InputObject $values -Encoding ASCII
        }
    }
    $valuesSplit=$values.Split([Environment]::NewLine)


    foreach ($val in $values) {
        # What has been typed matches the value from the list
        if ($val -like "$wordToComplete*") {
            # Print the value
            $val
        }
    }
}

# Register our function and auto-completion code with the command
Register-ArgumentCompleter -CommandName gradlew -ParameterName Param -ScriptBlock $scriptBlock
  1. Run . $PROFILE to reload your configuration
  2. Now you can navigate into your gradle folder and type gradlew taskNa to trigger the autocompletion (if you have a lot of tasks it could take some time at the first trigger)
You might also like...
Gradle plugin to deploy Android Snapshot Versions
Gradle plugin to deploy Android Snapshot Versions

Android Snapshot Publisher is a Gradle plugin to prepare and distribute Android Snapshot versions to multiple distribution sources in a simple and com

Android + Kotlin + Github Actions + ktlint + Detekt + Gradle Kotlin DSL + buildSrc = ❤️

kotlin-android-template 🤖 A simple Github template that lets you create an Android/Kotlin project and be up and running in a few seconds. This templa

💫 A Gradle Plugin to generate your networking code from Swagger

Swagger Gradle Codegen A Gradle plugin to generate networking code from a Swagger spec file. This plugin wraps swagger-codegen, and exposes a configur

A gradle plugin for getting java lambda support in java 6, 7 and android

Gradle Retrolambda Plugin This plugin will automatically build your java or android project with retrolambda, giving you lambda goodness on java 6 or

GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.

Gradle Play Publisher Gradle Play Publisher is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and

A Gradle plugin to report the number of method references in your APK on every build.
A Gradle plugin to report the number of method references in your APK on every build.

Dexcount Gradle Plugin A Gradle plugin to report the number of method references in your APK, AAR, or java module. This helps you keep tabs on the gro

 Gradle plugin which downloads and manages your Android SDK.
Gradle plugin which downloads and manages your Android SDK.

DEPRECATED This plugin is deprecated and is no longer being developed. Tools and dependencies are automatically downloaded using version 2.2.0 of the

A Gradle plugin to support the Groovy language for building Android apps

Groovy language support for Android Deprecated: This plugin has been deprecated in favor of Kotlin which has the full support of JetBrains and Google.

Add a different ribbon to each of your Android app variants using this gradle plugin. Of course, configure it as you will

Easylauncher gradle plugin for Android Modify the launcher icon of each of your app-variants using simple gradle rules. Add ribbons of any color, over

A Gradle Plugin that removes unused resources in Android projects.
A Gradle Plugin that removes unused resources in Android projects.

#Lint Cleaner Plugin Removes unused resources reported by Android lint including strings, colors and dimensions. Depracated As of Android Studio 2.0+

[Deprecated] Android Studio IDE support for Android gradle unit tests. Prepared for Robolectric.
[Deprecated] Android Studio IDE support for Android gradle unit tests. Prepared for Robolectric.

#[Deprecated] Google has finally released a proper solution for unit testing. Therefore this plugin will no longer be activlty maintained. android-stu

Gradle plugin for Google Protocol Buffers

Gradle Protobuf Plugin Author: Andrew Kroh Download: See maven central License: Apache License, Version 2.0 Requirements: Java 1.5+ Google Protocol Bu

Force clear delaying & no longer needed Gradle tasks.
Force clear delaying & no longer needed Gradle tasks.

gradle-cleaner-intellij-plugin Force clear delaying & no longer needed Gradle tasks. Description Plugin for Intellij IDEA which performs simple comman

Gradle plugin that creates FindBugs reports for android projects
Gradle plugin that creates FindBugs reports for android projects

findbugs-android A Gradle plugin that creates FindBugs tasks for each variant of android application or library project Project site: https://findbugs

A tool to install components of the Android SDK into a Maven repository or repository manager to use with the Android Maven Plugin, Gradle and other tools.

Maven Android SDK Deployer Original author including numerous fixes and changes: Manfred Moser [email protected] at simpligility technologies i

Android Gradle Starter

Android Gradle Studio A sample android starter project to demonstrate the integration of the following tools: Automation: Gradle Testing: Android Test

A tool to install components of the Android SDK into a Maven repository or repository manager to use with the Android Maven Plugin, Gradle and other tools.

Maven Android SDK Deployer Original author including numerous fixes and changes: Manfred Moser [email protected] at simpligility technologies i

Gradle plugin which validates the licenses of your dependency graph match what you expect

Licensee 📜 👀 A Gradle plugin which validates the licenses of your dependency graph match what you expect, or it fails your build! Jump to: Introduct

Owner
null
This repository contains a simple script that lets you kill gradle and kotlin daemons.

AndroidDaemonKiller This repository contains a simple script that lets you kill gradle and kotlin daemons. After updating gradle or kotlin or checking

Paul Woitaschek 25 Dec 3, 2022
BTW-gradle is a development environment for the Better Than Wolves mod

BTW-gradle BTW-gradle is a development environment for the Better Than Wolves mod Quick Start Download the example Change settings.gradle and build.gr

Better Than Wolves Community 2 Feb 24, 2022
A simple library that can connect your autocomplete edittext to Google places api

Google Places AutoComplete EditText A simple library that can connect your autocomplete edittext to Google's places api Supporting Places AutoComplete

Mukesh Solanki 71 Dec 28, 2022
Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Central, Corporate staging/snapshot servers and local Maven repositories).

GradleMavenPush Helper to upload Gradle Android Artifacts, Gradle Java Artifacts and Gradle Kotlin Artifacts to Maven repositories (JCenter, Maven Cen

 Vorlonsoft LLC 21 Oct 3, 2022
Gradle Replace In Place (GRIP): a gradle plugin to update your documentation or any file with a simple gradle task

GRIP (Gradle Replace In-Place) A gradle tool to update some values in your (documentation) files by running a task. (inspired by Knit) Directives Inse

Grégory Lureau 2 Oct 18, 2022
gradle-android-scala-plugin adds scala language support to official gradle android plugin

gradle-android-scala-plugin gradle-android-scala-plugin adds scala language support to official gradle android plugin. See also sample projects at htt

saturday06 345 Dec 10, 2022
Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes

Gradle Plugin to automatically upgrade your gradle project dependencies and send a GitHub pull request with the changes

Dipien 142 Dec 29, 2022
Gradle plugin to ease Kotlin IR plugin development and usage in multimodule gradle projects

Gradle plugin to ease Kotlin IR plugin development and usage in multimodule gradle projects. Former: kotlin-ir-plugin-adapter-gradle

null 2 Mar 8, 2022
Ownership-gradle-plugin - Gradle code ownership verification plugin

Gradle code ownership verification plugin A gradle plugin that will verify owner

null 4 Dec 15, 2022
A Gradle plugin that generates plugin.yml for Bukkit/BungeeCord/Nukkit plugins based on the Gradle project

plugin-yml is a simple Gradle plugin that generates the plugin.yml plugin description file for Bukkit plugins, bungee.yml for Bungee plugins or nukkit.yml for Nukkit plugins based on the Gradle project. Various properties are set automatically (e.g. project name, version or description) and additional properties can be added using a simple DSL.

Plexus 0 Apr 10, 2022