You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2015/03/17 14:56:58 UTC

[2/2] cordova-plugin-file git commit: Tweak build-extras.gradle to just read/write to main `assets/` instead of `build/`

Tweak build-extras.gradle to just read/write to main `assets/` instead of `build/`

Gave up on trying to figure out how to make it work correctly within
build/


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/6e919341
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/6e919341
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/6e919341

Branch: refs/heads/master
Commit: 6e9193418cfe91b74222bcc1c421ea1f4bba327a
Parents: 5b1afc2
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Mar 17 09:56:15 2015 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Mar 17 09:56:15 2015 -0400

----------------------------------------------------------------------
 src/android/build-extras.gradle | 44 ++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/6e919341/src/android/build-extras.gradle
----------------------------------------------------------------------
diff --git a/src/android/build-extras.gradle b/src/android/build-extras.gradle
index cf4ad92..86d91a6 100644
--- a/src/android/build-extras.gradle
+++ b/src/android/build-extras.gradle
@@ -17,34 +17,30 @@
        under the License.
  */
 ext.postBuildExtras = {
-    android.applicationVariants.all { variant ->
-        def variantName = variant.name.capitalize()
-        def processResourcesTask = tasks["process${variantName}Resources"]
-        def inAssetsDir = variant.mergeAssets.rawInputFolders.iterator().next()
-        def outAssetsDir = inAssetsDir
-        def outFile = new File(outAssetsDir, "cdvasset.manifest")
+    def inAssetsDir = file("assets")
+    def outAssetsDir = inAssetsDir
+    def outFile = new File(outAssetsDir, "cdvasset.manifest")
 
-        def newTask = task("cdvCreateAssetManifest$variantName") << {
-            println("Reading from ${inAssetsDir}")
-            println("Writing to ${outFile}")
+    def newTask = task("cdvCreateAssetManifest") << {
+        println("Reading from ${inAssetsDir}")
+        println("Writing to ${outFile}")
 
-            def contents = new HashMap()
-            contents[""] = inAssetsDir.list()
-            def tree = fileTree(dir: inAssetsDir)
-            tree.visit { fileDetails ->
-                if (fileDetails.isDirectory()) {
-                    contents[fileDetails.relativePath.toString()] = fileDetails.file.list()
-                }
+        def contents = new HashMap()
+        contents[""] = inAssetsDir.list()
+        def tree = fileTree(dir: inAssetsDir)
+        tree.visit { fileDetails ->
+            if (fileDetails.isDirectory()) {
+                contents[fileDetails.relativePath.toString()] = fileDetails.file.list()
             }
+        }
 
-            outAssetsDir.mkdirs()
-            outFile.withObjectOutputStream { oos ->
-                oos.writeObject(contents)
-            }
+        outAssetsDir.mkdirs()
+        outFile.withObjectOutputStream { oos ->
+            oos.writeObject(contents)
         }
-        newTask.dependsOn(tasks["prepare${variantName}Dependencies"])
-        newTask.inputs.dir inAssetsDir
-        newTask.outputs.file outFile
-        processResourcesTask.dependsOn(newTask)
     }
+    newTask.inputs.dir inAssetsDir
+    newTask.outputs.file outFile
+    def preBuildTask = tasks["preBuild"]
+    preBuildTask.dependsOn(newTask)
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org