title: Issues with Proguard using Gradle in a non-Android project
body: <p>I am trying to obfuscate the code of my Java project with Proguard. This project has been created on Intellij and is configured with Gradle 2.2.1. There is a proxy on the computer I work on so Intellij can not access the Internet.</p>
  
  <p>I tried for hours to find a simple example to obfuscate my code.</p>
  
  <p>I tried to do :</p>
  
  <pre><code>task proguardTask(type: proguard.gradle.ProGuardTask) { println "ha"}
  task proguardTask(type: proguard.gradle.ProGuardTask) &lt;&lt; { println "ha"}
  </code></pre>
  
  <p>and I got an exception every time : </p>
  
  <pre><code>FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':proguardTask'.
  &gt; Index: 0, Size: 0
  java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
          at proguard.ClassPath.get(ClassPath.java:77)
  </code></pre>
  
  <p>Here's my build.gradle file:</p>
  
  <pre><code>// Configuration des library java
  project.ext.LIBJava = [
          "project1",
  
          "project2", "project2",
          "project2_OS", "project2_UI",
          "project3",
          "project3_Windows"
  ]
  
  //----------------------------------------------------------------------------------------------------------
  
  ext.buildOnline = false
  ext.buildOnlineMapsforge = false
  ext.buildAndroid = false
  
  //----------------------------------------------------------------------------------------------------------
  
  apply plugin: 'idea'
  apply plugin: 'eclipse'
  apply plugin: 'java'
  
  buildscript {
      repositories {
          mavenLocal()
          mavenCentral()
          flatDir dirs: 'C:/Path/To/Proguard/proguard-5.1/lib'
      }
      dependencies {
          classpath ':proguard'
      }
  }
  
  def filterProjects(filter) { return subprojects.findAll { project -&gt; filter.contains(project.name) } }
  
  
  allprojects {
      group = 'org.libWin'
      version = '0.1.1'
  }
  
  // Configuration injection for all subprojects
  subprojects {
      repositories {
          mavenLocal()
          mavenCentral()
      }
  }
  
  //----------------------------------------------------------------------------------------------------------
  
  task proguardTask(type: proguard.gradle.ProGuardTask) {
      println "ha"
  }
  
  configure(filterProjects(project.LIBJava)) {
      apply plugin: 'java'
  
      dependencies {
          if (buildOnline) { // On-line
              testCompile group: 'junit', name: 'junit', version: 4.11           //  "$jUnitVersion"
          }
      }
  
      [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
  }
  </code></pre>
  
  <p>Does anyone know where the problem comes from ? How to obfuscate easily my code with Proguard using Gradle ?</p>
  
  <p>Thanks.</p>