0

I have a project which is going to be share with different clients. The only thing which will be changed on the project is the res/ ( some images with same name , the string , styles and colors )

I don't want to create another project with the same things , what I want to do is that I provide res/ in different directories , e.g ABC/res , EFG/res , JKL/ res ( Where all res will be same by name)

So What I want to do is to put name of client (any where in project) and when I compile, it should get res of its relevant directory. e.g If I put name of client EFG , then it should get and show res for client EFG/res and add that to build)

Please send me links , or some working example. Thanks in advance

Muhammad Nabeel Arif
  • 19,140
  • 8
  • 51
  • 70
Arslan Anwar
  • 18,746
  • 19
  • 76
  • 105
  • While I "+1" the question, as I would benefit from such functionality myself, unfortunately, I don't think it's possible, at least with the eclipse build environment. If you use command-line/ant, then you can do this with your ant script. – Aleks G Apr 03 '12 at 08:14
  • Can you please share some link , or example that use ant script for multiple res depending on some values – Arslan Anwar Apr 03 '12 at 08:17
  • I don't have one myself, but the idea is to have multiple ant scripts to build the same project - one per resource set - and in the beginning of each script you would copy the corresponding resources into the expected location - then do the build as usual. – Aleks G Apr 03 '12 at 08:19
  • Thanks for your time but can you please suggest. Then is thats not good to replace the whole res folder from my project for which client we need to make build? Which one is batter and why? – Arslan Anwar Apr 03 '12 at 08:22
  • The default build life cycle of Eclipse ADT plugin is pretty inflexible, You need adopt build tools like Ant or Maven to dominate build process, if use Maven, it is quite easy, example case study [here](http://stackoverflow.com/questions/9699485/skinning-android-app-with-maven-build-profiles) and [here](http://stackoverflow.com/questions/9371698/speeding-up-the-android-build-process/9372333#9372333). – yorkw Apr 03 '12 at 08:24

1 Answers1

1

You should use something like this in you ant build.xml in section

<copy todir="${preprocessed.absolute.dir}">
            <fileset dir="${orginal.source.dir}">
                <include name="**/*.aidl" />
            </fileset>
            <fileset dir="${common.absolute.dir}">
                <include name="**/*.aidl" />
            </fileset>
            <fileset dir="${android.absolute.dir}">
                <include name="**/*.aidl" />
            </fileset>
            <fileset dir="${tts.absolute.dir}">
                <include name="**/*.aidl" />
            </fileset>
</copy>

But only change folders according to some string flag (your customers' names for example)
for more details see http://ant.apache.org/manual/Tasks/copy.html

Alex Klimashevsky
  • 2,457
  • 3
  • 26
  • 58