Skip to content

Instantly share code, notes, and snippets.

meonlol

Block or report user

Report or block meonlol

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@meonlol
meonlol / RunCommandBuilder.groovy
Last active May 7, 2019
execute command in groovy.
View RunCommandBuilder.groovy
package de.esolutions.gradle.plugin
import java.util.concurrent.TimeUnit
/** Running a command should be a simple "command".execute() in groovy, but reading
* output and making the command time-out at the same time, is somehow buggy and the
* process won't quit if it hangs.
* Thanks: https://stackoverflow.com/a/33265110/3968618
* */
@meonlol
meonlol / gradle_robolectric_commandline_output_formatting.groovy
Last active Aug 29, 2015
Gradle Robolectric commandline output formatting
View gradle_robolectric_commandline_output_formatting.groovy
//Add this to build.gradle
robolectric {
// Output and format the test results for vim-grand
afterTest { descriptor, result ->
//This part prints the class name with short result notation
def resultChar = ''
switch (result.resultType) {
case TestResult.ResultType.SUCCESS:
resultChar = '+'
break
@meonlol
meonlol / shell_gradle_class_specifier.groovy
Last active Aug 29, 2015
Robolectric test specification from the commandline:
View shell_gradle_class_specifier.groovy
// Add test classes on the command line. Examples:
// gradle test -Dclasses=SomeClassTest // runs test/java/com/bla/SomeClassTest.java
// gradle test -Dclasses=*ActivityTest // runs all classes who's name ends in ActivityTest.java
// gradle test || gradle test -DClasses=all // both notations include all classes
def suppliedClasses = System.getProperty('classes', 'all')
if (suppliedClasses == 'all') {
println "target: all"
include '**/*Test.class'
} else {
def targetClass = '**/'+suppliedClasses +'.class'
You can’t perform that action at this time.