Coder Social home page Coder Social logo

grefresher's Introduction

GRefresher

Build Status Release Snapshot License

Gradle plugin inspired by sbt-revolver. It provides re-run task which improves development turnaround by recompiling and restarting program in single click.

Key features:

  • Recompile and restart by single keypress
  • Recompile and restart on source changes

Requirements


Gradle 1.12+ (tested on 1.12, but may be supported by earlier versions), Java 1.7+

Getting Started


To get started you should add following snippet to your build.gradle

Release:
buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'ru.shadam.grefresher:grefresher:0.2'
    }
}
Snapshot:
buildscript {
    repositories {
        // .. your preferred repos: mavenCentral() or jcenter() or some else (at least one is required for plugin's dependencies)
        maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
    }

    dependencies {
        classpath 'ru.shadam.grefresher:grefresher:0.3-SNAPSHOT'
    }
}

apply plugin: 'ru.shadam.grefresher'

Configuration


GRefresher provides grefresher extension to configure task

grefresher {
    debug = (true | false) /* Enables debug */
    debugSuspend = (true | false) /* Specifies if application waits for debugger on start */
    debugPort = Integer /* Specifies port for listening to debugger */

    mainClassName = String /* Main class name of your app goes here */
    jvmArgs = [] /* list of jvm args to provide to JVM which will run your app */
    systemProperties = [:] /* map of systemProperties. Each entry expands to following jvm arg: -D${key}=${value} */

    scanInterval = Integer /* Source scanning period. 0 or null to disable scanning */
}

Copyright and License


This project is licensed under MIT license

grefresher's People

Contributors

saladinkzn avatar

Stargazers

Andrey Hihlovskiy avatar Kostromin Igor avatar

Watchers

Kostromin Igor avatar James Cloos avatar  avatar

Forkers

mordonez-me

grefresher's Issues

java.lang.ArrayStoreException for jvmArgs or systemProperties

When running with re-run and jvmArgs or systemProperties are specified.

def configFile = "foo.conf"
jvmArgs = ["-Dconfig.file=${configFile}"]
// or
systemProperties = ["config.file": configFile]

I get this error:

Press 'q' or 'Q' to stop application or any other key to restart
Exception in thread "Thread-11" java.lang.ArrayStoreException
	at java.util.ArrayList.toArray(ArrayList.java:408)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1007)
	at java_lang_ProcessBuilder$start$1.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
	at ru.shadam.grefresher.GRefresherTask$_startProcess_closure4.doCall(GRefresherTask.groovy:109)
	at ru.shadam.grefresher.GRefresherTask$_startProcess_closure4.doCall(GRefresherTask.groovy)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
	at groovy.lang.Closure.call(Closure.java:426)
	at groovy.lang.Closure.call(Closure.java:420)
	at groovy.lang.Closure.run(Closure.java:507)
	at java.lang.Thread.run(Thread.java:745)

System info:


------------------------------------------------------------
Gradle 2.11
------------------------------------------------------------

Build time:   2016-02-08 07:59:16 UTC
Build number: none
Revision:     584db1c7c90bdd1de1d1c4c51271c665bfcba978

Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0_77 (Oracle Corporation 25.77-b03)
OS:           Mac OS X 10.11.6 x86_64

The main class doesn't get started

When I run via plain run it's fine, with re-run the app doesn't get started at all. Output from ./gradlew -info :myProject:re-run:

:myProject:re-run
Executing task ':myProject:re-run' (up-to-date check took 0.001 secs) due to:
  Task has not declared any outputs.
mainClassName: com.myproject.Main
Press 'q' or 'Q' to stop application or any other key to restart
Logging initialized @24953ms
> Building 90% > :myProject:re-run

Gradle 2.11.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.