title: How to remove slash in task name in Gradle
body: <p>I am trying to run an old Android project, but have errors in the build.gradle (:app) file. </p>
  
  <pre><code>ndk_projects.each { File file -&gt;
  
  //noinspection GroovyAssignabilityCheck
   task "copy $file" (dependsOn: "build $file", type:Copy) {
       from "$buildDir/tmplibs"
       into "$buildDir/libs"
   }
  
  
  //noinspection GroovyAssignabilityCheck
   task "build $file" (dependsOn: ["copy $OpenNI2_path",  "copy $OpenCL_path"], type:Exec) {
       workingDir file
       commandLine "${ndkDir}/ndk-build",
               "NDK_PROJECT_PATH=${buildDir}/intermediates/ndk"  ,
               "NDK_APPLICATION_MK=${file.absolutePath}/jni/Application.mk" ,
               "APP_BUILD_SCRIPT=${file.absolutePath}/jni/Android.mk",
               "NDK_LIBS_OUT=${buildDir}/tmplibs"
               environment NDK_MODULE_PATH: ndk_projects[0].absolutePath + "/jni" + ":" + OpenCL_path + "/obj/local/"
   }
  
  }
  </code></pre>
  
  <p>The error says <code>task name must not contain any of the following characters: [/, \, :, &lt;, &gt;, ", ?, *, |].</code>. As it uses the file path as the task name, so I should change that. A simple fix can be to remove all the slashes in the pathes and use that as a task name. But, I have zero knowledge about Gradle syntax. Can someone tell me how to do that? Thanks. </p>