How to workaround autoomitting fiiles/folders star

2019-01-19 04:59发布

问题:

I want to deploy PhoneGap app on the Android simulator provided with eclipse. I decided to use Dojo Toolkit which heavily relies on the " _ " convention (starting a file/folder with " _ " means this is a private/internal module).

Basically the problem is that while deploying the app, every file/folder starting with "_" is omitted. This completely messes things up, Dojo toolkit as exptected fails to work.

Is there a way to fix this?

回答1:

First go star this issue so Google will fix the bug eventually. If you are running on Mac or Linux there is a patched aapt that fixes the bug here. Other than that your only choice is to do a build of Dojo so that it is only in one file.



回答2:

From the previous answer I ended making changes on ant.properties which is located at root of project with this:

aapt.ignore.assets=!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~

Here, I overwrote aapt.ignore.assets property defined on sdk-android directory. It works



回答3:

aaptOptions{
    ignoreAssetsPattern  '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}

add the above lines in the application build.gradle file inside android block for android app



回答4:

A work around is to use dojo.js from the CDN

<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.9.0/dojo/dojo.js"></script>

Also, I started looking for a minify app or service, which could create a single file from all the required dojo files, but did not find one easily.