New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work even if "--no-daemon" argument is specified #8

Closed
sunnyone opened this Issue Aug 4, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@sunnyone

sunnyone commented Aug 4, 2015

Just executing "./gradlew shell -q" says "Do not run with gradle daemon (use --no-daemon)", but the same message appears with "--no-daemon" argument. It seems that "--no-daemon" succeeded to prevent from running a gradle daemon according to the "jps" result, but groovysh-plugin failed to detect it.

build.gradle

apply plugin: 'java'
apply plugin: 'com.github.tkruse.groovysh'

buildscript {
  repositories {
      jcenter()
  }

  dependencies {
      classpath 'com.tkruse.gradle:gradle-groovysh-plugin:1.0.5'
  }
}

repositories {
    jcenter()
}

dependencies {
}

gradle.properties

org.gradle.daemon=true

Command line output

$ ./gradlew --no-daemon shell -q
This is a gradle Application Shell.
You can import your application classes and act on them.
Do not run with gradle daemon (use --no-daemon).

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':shell'.
> Do not run with gradle daemon (use --no-daemon).

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
$ jps
3376 Jps
$ ./gradlew -v

------------------------------------------------------------
Gradle 2.3
------------------------------------------------------------

Build time:   2015-02-16 05:09:33 UTC
Build number: none
Revision:     586be72bf6e3df1ee7676d1f2a3afd9157341274

Groovy:       2.3.9
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0_45 (Oracle Corporation 25.45-b02)
OS:           Linux 3.13.0-61-generic amd64
@tkruse

This comment has been minimized.

Show comment
Hide comment
@tkruse

tkruse Aug 4, 2015

Owner

True, I can reproduce this. Thanks for reporting.

Currently I use the gradle Tooling API:

DAEMON_PROP = 'org.gradle.daemon'
project.hasProperty(DAEMON_PROP) && project.property(DAEMON_PROP) == 'true

So it seems the property stay true even when using --no-daemon. I must research some more, maybe I have to also check the arguments do not include --no-daemon.

Owner

tkruse commented Aug 4, 2015

True, I can reproduce this. Thanks for reporting.

Currently I use the gradle Tooling API:

DAEMON_PROP = 'org.gradle.daemon'
project.hasProperty(DAEMON_PROP) && project.property(DAEMON_PROP) == 'true

So it seems the property stay true even when using --no-daemon. I must research some more, maybe I have to also check the arguments do not include --no-daemon.

@tkruse

This comment has been minimized.

Show comment
Hide comment
@sunnyone

This comment has been minimized.

Show comment
Hide comment
@sunnyone

sunnyone Aug 19, 2015

What's happen when a daemon is running? If runing a code on a daemon causes an almost harmless effect (like just an exception is thrown), it may be convenient that raising the effect intentionally and checking/recoverying it.

sunnyone commented Aug 19, 2015

What's happen when a daemon is running? If runing a code on a daemon causes an almost harmless effect (like just an exception is thrown), it may be convenient that raising the effect intentionally and checking/recoverying it.

@tkruse

This comment has been minimized.

Show comment
Hide comment
@tkruse

tkruse Aug 19, 2015

Owner

No, sadly, when the daemon is running, keyboard input is not working anymore. So nothing works.

Owner

tkruse commented Aug 19, 2015

No, sadly, when the daemon is running, keyboard input is not working anymore. So nothing works.

@tkruse

This comment has been minimized.

Show comment
Hide comment
@tkruse

tkruse Aug 22, 2015

Owner

Ok, I release 1.0.7 without blocking. Basically my check also does not work when user calls --damon. So you should be able to use with --no-daemon.

Owner

tkruse commented Aug 22, 2015

Ok, I release 1.0.7 without blocking. Basically my check also does not work when user calls --damon. So you should be able to use with --no-daemon.

@sunnyone

This comment has been minimized.

Show comment
Hide comment
@sunnyone

sunnyone Aug 26, 2015

1.0.7 works (with a warning message) on my environment. Thanks.

$ ./gradlew -q --no-daemon shell
This is a gradle Application Shell.
You can import your application classes and act on them.
!!!!! WARNING: Do not run with gradle daemon, this may disable keyboard input.  (use --no-daemon). !!!!!!!!!
Groovy Shell (2.4.4, JVM: 1.8.0_60)
Type ':help' or ':h' for help.
-------------------------------------------------------------------------------
groovy:000> println("Hello, World")
Hello, World
===> null
groovy:000> 

sunnyone commented Aug 26, 2015

1.0.7 works (with a warning message) on my environment. Thanks.

$ ./gradlew -q --no-daemon shell
This is a gradle Application Shell.
You can import your application classes and act on them.
!!!!! WARNING: Do not run with gradle daemon, this may disable keyboard input.  (use --no-daemon). !!!!!!!!!
Groovy Shell (2.4.4, JVM: 1.8.0_60)
Type ':help' or ':h' for help.
-------------------------------------------------------------------------------
groovy:000> println("Hello, World")
Hello, World
===> null
groovy:000> 

@tkruse tkruse closed this Aug 26, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment