0

The situation is such that I have some files that are in different repository than my Android app. I would like to add some of those assets to my apk's assets folder during the build by providing a build script with paths to those files. Also I would not want my repository to be modified.

Is it possible to do that with Ant?

paulius_l
  • 4,983
  • 8
  • 36
  • 42
  • Do you want to checkout them from repository? – Eugen Martynov Aug 29 '12 at 16:50
  • Yes. They may either be already checked out or to be checked out during the build, doesn't matter. The main point is that they are in different repository and I can't add them all, so I need just a subset of the assets to put into the apk during the build. – paulius_l Aug 29 '12 at 20:14
  • 1
    Sounds simple. Just use `copy` task from ant. – Eugen Martynov Aug 29 '12 at 20:47
  • I don't see how that is the solution. If I copy the files to assets directory, then my app's repository will be modified. Build procedure should not modify a repository. – paulius_l Aug 30 '12 at 06:16
  • Until you call something like add/commit your repository is still unchanged – Eugen Martynov Aug 30 '12 at 07:36

1 Answers1

1

if I understood correctly you don't want to modify folders content that is part of commited structure. So I see two variants do far:

  1. Use build folder where you will copy code, assets, resources config files, etc. And remove/clean this folder after build. Sometimes it useful when you have several app versions like brands.
  2. apk is zip so you could update it with assets (please review this). But be careful if you're updating already signed apk
Community
  • 1
  • 1
Eugen Martynov
  • 19,888
  • 10
  • 61
  • 114
  • Yes, this is what I want. I am trying to hook up to Ant's -post-compile target to copy the assets and -post-package target to clean them up. However, as I have noticed, Eclipse does not build according to normal Android rules, or it ignores the setup of my build.xml. Maybe you happen to know how can I modify Eclipse's build, too? – paulius_l Aug 30 '12 at 08:14