// https://github.com/JCAndKSolutions/android-unit-test def getVersionCode = { -> try { def stdout = new ByteArrayOutputStream() exec { commandLine 'git', 'rev-list', '--first-parent', '--count', 'master' standardOutput = stdout } return Integer.parseInt(stdout.toString().trim()) } catch (ignored) { return -1; } } def getVersionName = { -> try { def stdout = new ByteArrayOutputStream() exec { commandLine 'git', 'describe', '--tags', '--dirty' standardOutput = stdout } return stdout.toString().trim() } catch (ignored) { return null; } } buildscript { repositories { mavenCentral() maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'io.fabric.tools:gradle:1.14.4' classpath 'me.tatarka:gradle-retrolambda:2.5.0' } } apply plugin: 'com.android.application' apply plugin: 'io.fabric' apply plugin: 'me.tatarka.retrolambda' repositories { maven { url 'https://maven.fabric.io/public' } } android { compileSdkVersion 19 buildToolsVersion "19.1.0" defaultConfig { applicationId 'io.trygvis.soilmoisture' minSdkVersion 19 targetSdkVersion 19 versionCode getVersionCode() versionName getVersionName() return println("versionCode=$versionCode, versionName=$versionName"); } signingConfigs { release { storeFile file(RELEASE_STORE_FILE) storePassword RELEASE_STORE_PASSWORD keyAlias RELEASE_KEY_ALIAS keyPassword RELEASE_KEY_PASSWORD } } buildTypes { release { minifyEnabled false signingConfig signingConfigs.release } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } lintOptions { // The linter errors out with an NPE. checkReleaseBuilds false abortOnError false } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile('com.crashlytics.sdk.android:crashlytics:2.1.0@aar') { transitive = true; } compile project(':bt') compile 'org.sqldroid:sqldroid:1.0.3' compile 'org.flywaydb:flyway-core:3.1' } /* apply plugin: 'android-unit-test' dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile('com.crashlytics.sdk.android:crashlytics:2.1.0@aar') { transitive = true; } compile 'org.sqldroid:sqldroid:1.0.3' compile 'org.flywaydb:flyway-core:3.1' testCompile 'junit:junit:4.11' testCompile 'org.robolectric:robolectric:2.4' testCompile 'org.easytesting:fest-assert:1.4' } */