Domanda

I need to maintain some duplication into my Android App (in Android Studio) by having some resources in "res/values-iw/" and copy the exact content of that folder to a folder named "res/values-he/". The reason is explained here.

I saw that gradle has a copy function but I have no idea with what task it would be better to wire it (and I guess as doFirst)?

Also, is it possible to not have that copied folder in my original res folder as I don't really need to see it all the time beside the original one, for instance in /build/ folder for build time? That way the copied folder will always be an up-to-date copy of the original "/res/values-iw" folder.

Thanks in advance, Alex

È stato utile?

Soluzione

Instead of copying, you might want to set up symlinks instead. The symlinks should hopefully be preserved in source control, and it's better than having the build system muck around with duplicating source files. For large resources, though, like drawables, consider using aliases which should hopefully prevent duplication that will bloat your APK.

Altri suggerimenti

Instead of copying, would alias resources be better? http://developer.android.com/guide/topics/resources/providing-resources.html#AliasResources

They let you create references to a single resource in different contexts instead of copying them around. It should save space in your binary, too, which would be a big plus.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top