Skip to content

Instantly share code, notes, and snippets.

@masztalski
Created April 11, 2018 10:33
Show Gist options
  • Save masztalski/89db6656a9b22e1f5e307030b19ae042 to your computer and use it in GitHub Desktop.
Save masztalski/89db6656a9b22e1f5e307030b19ae042 to your computer and use it in GitHub Desktop.
build.gradle.ftl
android {
defaultConfig {
vectorDrawables.useSupportLibrary = true
buildConfigField "java.lang.String", "BASE_URL", "\"https://MY_URL/\""
}
dexOptions {
jumboMode = true
javaMaxHeapSize "6g"
}
compileOptions {
encoding "windows-1250"
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dataBinding {
enabled = true
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
}gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xmaxerrs" << "500" // or whatever number you want
}
}ext {
supportLibrary = '26.1.0'
ormlite = '5.0'
animonStream = '1.1.7'
hotchemi = '2.4.0'
<#if rxjava>
rxJava = '2.1.0'
rxAndroid = '2.0.1'
rxBinding = '0.4.0'
</#if>
<#if retrofit>retrofit = '2.3.0'</#if>
dagger = '2.14.1'
<#if eventbus>eventBus = '3.0.0'</#if>
joda = '2.9.4'
stetho = '1.5.0'
constraintLayout = '1.0.2'
}dependencies {
implementation "com.android.support:design:$supportLibrary"
implementation "com.android.support:support-annotations:$supportLibrary"
implementation "com.android.support:recyclerview-v7:$supportLibrary"
//Dagger
implementation "com.google.dagger:dagger:$dagger"
annotationProcessor "com.google.dagger:dagger-compiler:$dagger"
<#if rxjava>
//RxJava
compile("io.reactivex.rxjava2:rxandroid:$rxAndroid", {
exclude group: 'io.reactivex.rxjava2:rxjava'
})
implementation "io.reactivex.rxjava2:rxjava:$rxJava"
implementation "com.jakewharton.rxbinding:rxbinding:$rxBinding"
</#if>
<#if retrofit>
//Retrofit
implementation "com.squareup.retrofit2:retrofit:$retrofit"
<#if gson>implementation "com.squareup.retrofit2:converter-gson:$retrofit"</#if>
<#if rxjava>implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit"</#if>
</#if>
//Stetho
implementation "com.facebook.stetho:stetho:$stetho"
implementation "com.facebook.stetho:stetho-okhttp3:$stetho"
//Ormlite
compile "com.j256.ormlite:ormlite-android:$ormlite"
//Java 8 Streams
implementation "com.annimon:stream:$animonStream"
//Permissions
implementation "com.github.hotchemi:permissionsdispatcher:$hotchemi"
annotationProcessor "com.github.hotchemi:permissionsdispatcher-processor:$hotchemi"
<#if eventbus>
//EventBus
implementation "org.greenrobot:eventbus:$eventBus"
</#if>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment