Ant to Gradle Migration-执行任务

Ant to Gradle Migration- exec task

下面的任务将一些 class 文件添加到我的 build.xml 中生成的 jar 中,并生成输出为 jar。

谁能帮我把下面的整个任务转换成 gradle 任务。我正在将 ant 任务转换为 gradle,但我被困在这里。

<target name="generate-was-deployment" depends="init">
<exec executable="${websphere.home}/bin/ejbdeploy.bat" dir="build">
<arg file="${build}/${component.name}.jar"/>
<arg path="${ENV.TEMP}/deploy"/>
<arg file="${build}/${component.name}-deployed.jar"/>
<arg value="-cp"/>
<arg value="&quot;${deploy.classpath}&quot;"/>
<arg value="-keep"/>
</exec>
<delete file="${build}/${component.name}.jar"/>
<move file="${build}/${component.name}-deployed.jar" tofile="${build}/${component.name}.jar"/>
</target>
task generateWasDeployment {
   doLast {
      exec {
         workingDir 'build' 
         commandLine(['cmd', '/c', "${websphereHome}/bin/ejbdeploy.bat"]) 
         args file("$build/${component.name}.jar") 
         args ... 
         args ... 
      } 
      delete "$build/${componentName}.jar" 
      file("$build/${componentName}-deployed.jar").renameTo(file("$build/${componentName}.jar")) 
   } 
}