title: How can I use buildConfigField in Java and Gradle Project
body: <p>I am from Android background. I am creating a skill for Alexa using Java, Kotlin and Gradle. For some reason I wanted to declare a constant in grade buildConfigField like we do in android and access the field from generated BuildConfig.fieldName.</p>
  
  <p>I tried this but BuildConfig never generated.</p>
  
  <pre><code>buildConfig {
      buildConfigField 'String', 'HOME', 'TEST_HOME'
  }
  </code></pre>
  
  <p>build.gradle(Complete file)</p>
  
  <pre><code>apply plugin: 'java'
  apply plugin: 'kotlin'
  
  version = '1.0'
  
  compileJava {
      targetCompatibility = JavaVersion.VERSION_1_8
      sourceCompatibility = JavaVersion.VERSION_1_8
  }
  
  buildConfig {
      buildConfigField 'String', 'HOME', 'TEST_HOME'
  }
  
  
  jar {
      buildConfigField "String", "MY_CLOUD_API", '"http://12.3.456.789:123"'
      manifest {
          attributes 'Implementation-Title': 'Gradle Quickstart',
                     'Implementation-Version': version
      }
  }
  
  repositories {
      jcenter()
      mavenCentral()
  }
  
  sourceSets {
      main {
          java {
              srcDirs 'src'
          }
          resources {
              srcDirs 'src/resources'
          }
      }
  }
  
  dependencies {
      compile 'com.amazon.alexa:alexa-skills-kit:1.5.0'
      compile 'com.amazonaws:aws-lambda-java-core:1.0.0'
      compile 'com.amazonaws:aws-java-sdk-dynamodb:1.9.40'
      compile 'com.amazonaws:aws-lambda-java-log4j:1.0.0'
  
      compile 'log4j:log4j:1.2.17'
      compile 'org.apache.commons:commons-lang3:3.3.2'
      compile 'org.apache.directory.studio:org.apache.commons.io:2.4'
      compile 'org.eclipse.jetty:jetty-server:9.0.6.v20130930'
      compile 'org.eclipse.jetty:jetty-servlet:9.0.6.v20130930'
      compile 'org.slf4j:slf4j-api:1.7.10'
      compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
  }
  
  task fatJar(type: Jar) {
      baseName = project.name + '-fat'
      from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
      with jar
  }
  
  build.dependsOn fatJar
  buildscript {
      ext.kotlin_version = '1.2.21'
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
      }
  }
  compileKotlin {
      kotlinOptions {
          jvmTarget = "1.8"
      }
  }
  </code></pre>