Last active
          October 7, 2017 05:45 
        
      - 
      
- 
        Save bendisposto/7835d20760a765a60b9d to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | apply plugin: 'java' | |
| sourceSets.main.java.srcDir('.') | |
| sourceSets.main.output.classesDir('bin') | |
| repositories { mavenCentral(); } | |
| def java(String x) { | |
| def arguments = x.split(" ") | |
| def t = arguments.tail() as List | |
| new ByteArrayOutputStream().withStream { os -> | |
| javaexec { | |
| main = arguments.head() | |
| classpath = sourceSets.main.runtimeClasspath | |
| args = t | |
| standardOutput = os | |
| } | |
| os.toString(); | |
| } | |
| } | |
| ext { | |
| java = this.&java | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment