You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2017/05/17 12:44:04 UTC

[jira] [Comment Edited] (GROOVY-8192) Make it possible to run groovy shell from the source tree

    [ https://issues.apache.org/jira/browse/GROOVY-8192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16013931#comment-16013931 ] 

Paul King edited comment on GROOVY-8192 at 5/17/17 12:43 PM:
-------------------------------------------------------------

Do you want to try adding the following into (say) {{assemble.gradle}} and see if it works for you:
{code}
task groovy(type: JavaExec, dependsOn:jarAll) {
    // next three lines only for master/GROOVY_2_6_X
    if (rootProject.hasProperty('useAntlr4')) {
        jvmArgs += ["-Dgroovy.antlr4=true", "-Dgroovy.extract.doc.comment=true"]
    }
    doLast {
        if (!rootProject.hasProperty('groovyArgs')) {
            throw new GradleException("required property 'groovyArgs' not set")
        }
    }

    main = 'groovy.ui.GroovyMain'
    classpath = sourceSets.main.runtimeClasspath + jarAll.outputs.files
    args rootProject.findProperty('groovyArgs') ?: []
}
{code}
And try calling with something like:
{code}
./gradlew groovy -PgroovyArgs="-e println new Date()"
{code}
If that works for you we can polish and make it into a PR. Otherwise feel free to tweak as needed and make a PR yourself.


was (Author: paulk):
Do you want to try adding the following into (say) {{assemble.gradle}} and see if it works for you:
{code}
task groovy(type: JavaExec, dependsOn:jarAll) {
    // next three lines only for master/GROOVY_2_6_X
    if (rootProject.hasProperty('useAntlr4')) {
        jvmArgs += ["-Dgroovy.antlr4=true", "-Dgroovy.extract.doc.comment=true"]
    }
    doLast {
        if (!rootProject.hasProperty('groovyArgs')) {
            throw new GradleException("required property 'groovyArgs' not set")
        }
    }

    main = 'groovy.ui.GroovyMain'
    classpath = sourceSets.main.runtimeClasspath + jarAll.outputs.files
    args rootProject.findProperty('groovyArgs') ?: []
}
{code}
And try calling with something like:
{code}
./gradlew groovy -PgroovyArgs="-e println new Date()"
{code}

> Make it possible to run groovy shell from the source tree
> ---------------------------------------------------------
>
>                 Key: GROOVY-8192
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8192
>             Project: Groovy
>          Issue Type: Wish
>            Reporter: Jochen Kemnade
>
> I'd like to be able to run a groovy shell from the git checkout (i.e. {{./gradlew run}}) without having to create and install a distBin.
> This could probably done via the Gradle application plugin (https://docs.gradle.org/current/userguide/application_plugin.html).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)