Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8832971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:39:57+00:00 2026-06-14T08:39:57+00:00

I have an ant build setup for my Android project, and I’ve been reading

  • 0

I have an ant build setup for my Android project, and I’ve been reading guides and tutorials all over stackoverflow and online, but cannot seem to understand how to make this work. Basically in my code I have a variable, “isDebugVersion” (which will print out logs, and a few other things). When I build with ant, I want that variable in my code to be set to “false”. I’m looking around and I cannot find the custom_rules.xml examples even though it’s listed in the build.xml file.

So the variable is in com.example.application.Globals, and it’s listed as isDebugVersion. Can someone please give me an example for how to manipulate this variable using an ant build script?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:39:58+00:00Added an answer on June 14, 2026 at 8:39 am

    You can a file named custom_rules.xml to the root folder of your project.
    Inside define any property you want.

    Note that what you are trying to achieve could be simpler using BuildConfig.DEBUG. This file is in the gen folder of your project, close to R.java. It is generated during the build and the constant DEBUG will be set to false during debug builds and to true in release.

    So if you type ant release, you will get false. With eclipse or ant debug, you will get true.

    You could also learn how to use RoboGuice, it has an interesting logging solution.

    You can use this constant for all purposes like changing the google map api key from debug to release key. For an example, follow this thread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an ANT build process that builds all of our android projects at
I have a project that contains xml files. I also have an Ant build
I have a bunch of ant projects that build plug-ins that all conform to
I have a Java project that I build using an Ant script. I am
I have an ANT build that I need to setup so on deployment of
I'm new to automating builds using Ant. I have a bunch of Android project
I am trying to build my Android project with Ant. Whenever I use Eclipse
I have just setup my first project using apache ant with ivy as dependency
I use eclipse sometimes to build my android project(Using ADT 19). If i have
I have a project under python and have a setup.py script that build my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.