title: Ant to Gradle conversion: Obfuscation and Jar
body: <p>I'm performing a migration of ant to gradle. I'm stuck on something rather fundamental, I think. I have an .xml script that performs the following actions:</p>
  
  <pre><code>&lt;target name="ANTtarget"&gt;
     &lt;proguard
       ...
       &lt;libraryjar dir="otherfiles/here" /&gt;
       &lt;outjar name="some.jar"/&gt;
       ...
     &lt;/proguard&gt;
  
     &lt;jar destfile="some.jar" update="yes" &gt;
         &lt;manifest&gt;
           &lt;attribute  name="Main-Class" value="some.package.here" /&gt;
         &lt;/manifest&gt;
         &lt;zipgroupfileset dir="otherfiles/here" includes="**/*.jar" /&gt;
     &lt;/jar&gt;
   &lt;/target&gt;
  </code></pre>
  
  <p>So, using proguard, the classes get obfuscated and then packaged. I'm able to complete an identical obfuscation, but I'm unable to complete the jar-ing. I suspect that it's due to there being no 'update="yes"' feature in gradle's jar task.</p>
  
  <p>Gradle code:</p>
  
  <pre><code>task GRADLEtask(type: proguard.gradle.ProGuardTask) {
     ...
     outjar: "some.jar"
     ...
  }
  </code></pre>
  
  <p>Is there any solution or workaround to the update jar? Maybe edit the manifest while I'm in proguard? (The idea here is that the task/target outputs are identical.)</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p><strong>Normal jar-type task works fine; was incorrectly referencing the "otherfiles/here" in the jar task.</strong></p>
  
  <p>CODE FOR REFERENCE:</p>
  
  <p>[you probably won't have the same problem 'cuz you smart.]</p>
  
  <pre><code>task JARitUP (type: Jar, dependsOn: 'GRADLEtask') {
      baseName = "some2"
  
      from zipTree('some.jar')
      //get all the library jars
      def MYjars =  fileTree(jarPlace).filter { it.name.endsWith('.jar') }.files.path
      MYjars.each { THISjar -&gt; from zipTree("$THISjar") }
  
      manifest {
          attributes 'Main-Class': 'some.package.here'
      }
  }
  </code></pre>