com.android.builder.compiling
Class BuildConfigGenerator

java.lang.Object
  extended by com.android.builder.compiling.BuildConfigGenerator

public class BuildConfigGenerator
extends java.lang.Object

Class able to generate a BuildConfig class in an Android project. The BuildConfig class contains constants related to the build target.


Field Summary
static java.lang.String BUILD_CONFIG_NAME
           
 
Constructor Summary
BuildConfigGenerator(java.io.File genFolder, java.lang.String buildConfigPackageName)
          Creates a generator
 
Method Summary
 BuildConfigGenerator addField(java.lang.String type, java.lang.String name, java.lang.String value)
           
 BuildConfigGenerator addItems(java.util.Collection<java.lang.Object> items)
           
 void generate()
          Generates the BuildConfig class.
 java.io.File getBuildConfigFile()
           
 java.io.File getFolderPath()
          Returns a File representing where the BuildConfig class will be.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUILD_CONFIG_NAME

public static final java.lang.String BUILD_CONFIG_NAME
See Also:
Constant Field Values
Constructor Detail

BuildConfigGenerator

public BuildConfigGenerator(@NonNull
                            java.io.File genFolder,
                            @NonNull
                            java.lang.String buildConfigPackageName)
Creates a generator

Parameters:
genFolder - the gen folder of the project
buildConfigPackageName - the package in which to create the class.
Method Detail

addField

public BuildConfigGenerator addField(@NonNull
                                     java.lang.String type,
                                     @NonNull
                                     java.lang.String name,
                                     @NonNull
                                     java.lang.String value)

addItems

public BuildConfigGenerator addItems(@Nullable
                                     java.util.Collection<java.lang.Object> items)

getFolderPath

public java.io.File getFolderPath()
Returns a File representing where the BuildConfig class will be.


getBuildConfigFile

public java.io.File getBuildConfigFile()

generate

public void generate()
              throws java.io.IOException
Generates the BuildConfig class.

Throws:
java.io.IOException