-
-
Notifications
You must be signed in to change notification settings - Fork 38
Gradle build automation utility
Zeioth edited this page May 7, 2024
·
19 revisions
When compiler.nvim detects one of the files gradlew
, build.gradle.kts
, or build.gradle
file in the current working directory (by priority of detection), Telescope will be populated with all its task
entries.
Create a kotlin build.gradle.kts
file in your working directory and copy/paste this:
// Example of a task
tasks.register("hello_world") {
doLast {
println("Hello, World!")
}
}
// Example of a custom task to run all tasks
tasks.register("build_all") {
dependsOn("hello_world")
}
Or this instead, if you are using a groovy build.gradle
file:
// Example of a task
task hello_world {
doLast {
println 'Hello, World!'
}
}
// Example of a custom task to run all tasks
task build_all {
dependsOn hello_world
}
When you open the compiler you will see the option to run it
And this is the result
In the same way you can run hello world, you can execute any command necessary to build your program.
(optionally) You can define the next globals
global | defaut value |
---|---|
GRADLE_BUILD_TYPE |
"" |
Example:
let g:GRADLE_BUILD_TYPE='release'
Globals persist between Neovim sessions.
- I can't see the tasks added by gradle plugins: We only parse the tasks defined in your gradle file, as specified above. We don't currently parse plugin tasks automatically. See #40.