[GRADLE-2880] Groovy console Created: 08/Sep/13  Updated: 24/Jan/17  Resolved: 24/Jan/17

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Task
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Won't Fix Votes: 2


 Description   

I would like to be able to interact with my code in a flexible way using Groovy console. This idea is similar to the rails console ([1]http://guides.rubyonrails.org/command...). By executing the console task, gradle would open the Groovy console already loaded with my runtime dependencies, including my own code.

Here is how I usually implement this on my own:

task(console, dependsOn: 'classes', type: JavaExec) {
main = 'groovy.ui.Console'
classpath = sourceSets.main.runtimeClasspath
}

----------------------------------------------------------------------------------------
[1] http://guides.rubyonrails.org/command_line.html#rails-console



 Comments   
Comment by Richard [ 02/Oct/13 ]

by default gradle tasks are run once per session so it's not straighforward to use it as a shell.
needs to reset the task state.

Comment by carlos souza [ 13/Feb/14 ]

I wrote a plugin that opens the Groovy Console and loads the dependencies and the source code on the console classpath. It works for Java and Groovy. It can be found here: https://github.com/carlosgsouza/gradle-console

I thought I could add this functionality to the Groovy plugin itself. However it would be difficult to use it as a shell since it will not update the classpath upon modifications of the source code after the console is open.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 24/Jan/17 ]

I don't think we'd tackle this anytime soon. It also seems to be a very specific use case. Please open an issue on GitHub if you are still interested.

Generated at Wed Jun 30 12:33:58 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.