user1334767
user1334767

Reputation: 587

Conditionally excluding java files from build/apk

I would like to create a limited version of my Android app, excluding about a dozen class files from the final APK. Of course, I can just move them to a different folder, or use "Build Path > Exclude". I am wondering if there were a more elegant way of achieving this, via a single flag somewhere in the project. Any ideas?

Upvotes: 1

Views: 1032

Answers (1)

ashoke
ashoke

Reputation: 6461

One of the ways is to use build flavors in the new gradle based build system. It is an elegant solution and recommended by Android developer site . With Build Flavors, you can share common set of files between two versions of the same app, and customize it as needed. For additional details on how to do this please see this SO question.

You can use gradle build with eclipse too, please see this and this.

Upvotes: 1

Related Questions