title: Setup Gradle to run Java executable in Android Studio
body: <p>So here's the deal: I'm using ORMLite for Android, which uses annotations for it's mapping in Android. As you know, annotations are slow in Android, and the makers of ORMLite have realized this, so they added the ability to run a java executable to generate a resource file that bypasses the need to check annotations at runtime in the android app. It looks something like this: </p>
  
  <pre><code>public class DatabaseConfigUtil extends OrmLiteConfigUtil {
    private static final Class&lt;?&gt;[] classes = new Class[] {
      SimpleData.class,
    };
    public static void main(String[] args) throws Exception {
      writeConfigFile("ormlite_config.txt", classes);
    }
  }
  </code></pre>
  
  <p>I need a way to run this java executable every once in a while. To sum this up: <strong>I need a way to run a java executable in Android Studio. It can be via Gradle, another run configuration, part of a JUnit test, I don't really care. I just need the ability to run this from AndroidStudio.</strong></p>
  
  <p>This is my current Gradle Script:</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:0.5.+'
      }
  }
  apply plugin: 'android'
  
  repositories {
      mavenCentral()
  }
  
  android {
      compileSdkVersion 17
      buildToolsVersion "17.0.0"
  
      defaultConfig {
          minSdkVersion 7
          targetSdkVersion 18
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: '*.jar')
      compile project(':AndroidLibrary')
  
      compile 'com.j256.ormlite:ormlite-android:4.47'
  }
  </code></pre>