Skip to content

Instantly share code, notes, and snippets.

@ljanzik
Last active December 19, 2015 04:18
Show Gist options
  • Save ljanzik/5896121 to your computer and use it in GitHub Desktop.
Save ljanzik/5896121 to your computer and use it in GitHub Desktop.
BuildConfig Constants
public final class BuildConfig {
public final static boolean DEBUG = true;
public final static String BACKEND_URL = "http://dev.thoughtsonmobile.com";
}
public final class BuildConfig {
public final static boolean DEBUG = true;
public final static String BACKEND_URL = "http://thoughtsonmobile.com";
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
[..]
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>3.6.1-SNAPSHOT</version>
<extensions>true</extensions>
<configuration>
<buildConfigConstants>
<constant>
<name>BACKEND_URL</name>
<type>java.lang.String</type>
<value>http://dev.thoughtsonmobile.com</value>
</constant>
</buildConfigConstants>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>production</id>
<build>
<plugins>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<buildConfigConstants>
<constant>
<name>BACKEND_URL</name>
<type>java.lang.String</type>
<value>http://thoughtsonmobile.com</value>
</constant>
</buildConfigConstants>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
<buildConfigConstants>
<constant>
<name>CONFIGURATION_ENUM</name>
<type>my.package.MyEnum</type>
<value>my.package.MyEnum.CONFIG</value>
</constant>
</buildConfigConstants>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment