Last active
October 25, 2018 04:53
-
-
Save ryugoo/8e216361c519b5995cf5 to your computer and use it in GitHub Desktop.
My build.gradle Boilerplate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
google() | |
jcenter() | |
mavenCentral() | |
} | |
} | |
repositories { | |
google() | |
jcenter() | |
mavenCentral() | |
} | |
apply plugin: 'com.android.application' | |
apply plugin: 'kotlin-android' | |
apply plugin: 'kotlin-kapt' | |
// Version | |
def versionMajor = 1 | |
def versionMinor = 0 | |
def versionPatch = 0 | |
// Package | |
def packageName = "" // input here | |
android { | |
compileSdkVersion 28 | |
defaultConfig { | |
applicationId packageName | |
minSdkVersion 19 | |
targetSdkVersion 28 | |
versionCode versionMajor * 100 + versionMinor * 10 + versionPatch | |
versionName "$versionMajor.$versionMinor.$versionPatch" | |
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | |
vectorDrawables.useSupportLibrary = true | |
} | |
buildTypes { | |
release { | |
shrinkResources true | |
debuggable false | |
jniDebuggable false | |
minifyEnabled true | |
zipAlignEnabled true | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
} | |
debug { | |
applicationIdSuffix '.debug' | |
versionNameSuffix '-dev' | |
shrinkResources false | |
debuggable true | |
jniDebuggable true | |
zipAlignEnabled true | |
minifyEnabled false | |
} | |
} | |
packagingOptions { | |
exclude 'META-INF/NOTICE.txt' | |
exclude 'META-INF/LICENSE.txt' | |
exclude 'META-INF/DEPENDENCIES' | |
exclude 'META-INF/NOTICE' | |
exclude 'META-INF/LICENSE' | |
exclude 'META-INF/services/javax.annotation.processing.Processor' | |
} | |
dataBinding { | |
enabled = true | |
} | |
} | |
// Library version | |
ext { | |
support_lib_version = '28.0.0' | |
constraint_layout_version = '1.1.3' | |
} | |
dependencies { | |
implementation fileTree(dir: 'libs', include: ['*.jar']) | |
testImplementation 'junit:junit:4.12' | |
androidTestImplementation 'com.android.support.test:runner:1.0.2' | |
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', { | |
exclude group: 'com.android.support', module: 'support-annotations' | |
exclude group: 'com.google.code.findbugs', module: 'jsr305' | |
}) | |
implementation "com.android.support:support-annotations:$support_lib_version" | |
implementation "com.android.support:support-v4:$support_lib_version" | |
implementation "com.android.support:appcompat-v7:$support_lib_version" | |
implementation "com.android.support:recyclerview-v7:$support_lib_version" | |
implementation "com.android.support:cardview-v7:$support_lib_version" | |
implementation "com.android.support:gridlayout-v7:$support_lib_version" | |
implementation "com.android.support:preference-v7:$support_lib_version" | |
implementation "com.android.support:preference-v14:$support_lib_version" | |
implementation "com.android.support:design:$support_lib_version" | |
implementation "com.android.support:customtabs:$support_lib_version" | |
implementation "com.android.support.constraint:constraint-layout:$constraint_layout_version" | |
// Kotlin | |
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
ext.gradle_version = '3.2.1' | |
ext.kotlin_version = '1.2.71' | |
repositories { | |
google() | |
jcenter() | |
mavenCentral() | |
} | |
dependencies { | |
classpath "com.android.tools.build:gradle:$gradle_version" | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | |
} | |
} | |
allprojects { | |
repositories { | |
google() | |
jcenter() | |
mavenCentral() | |
} | |
} | |
task clean(type: Delete) { | |
delete rootProject.buildDir | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Library version | |
ext { | |
support_lib_version = '28.0.0' | |
constraint_layout_version = '1.1.3' | |
// Rx | |
rxjava_version = '2.2.3' | |
rxbinding_version = '2.2.0' | |
rxandroid_version = '2.1.0' | |
rxkotlin_version = '2.3.0' | |
// Annotation Processing | |
permission_dispatcher_version = '3.3.1' | |
dagger_version = '2.17' | |
onactivityresult_version = '0.7.0' | |
// Backport | |
threeten_version = '1.1.0' | |
// Logging | |
timber_version = '4.7.1' | |
// Kotlin Coroutines | |
kotlin_coroutines_version = '0.30.2' | |
} | |
dependencies { | |
implementation fileTree(dir: 'libs', include: ['*.jar']) | |
testImplementation 'junit:junit:4.12' | |
androidTestImplementation 'com.android.support.test:runner:1.0.2' | |
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', { | |
exclude group: 'com.android.support', module: 'support-annotations' | |
exclude group: 'com.google.code.findbugs', module: 'jsr305' | |
}) | |
implementation "com.android.support:support-annotations:$support_lib_version" | |
implementation "com.android.support:support-v4:$support_lib_version" | |
implementation "com.android.support:appcompat-v7:$support_lib_version" | |
implementation "com.android.support:recyclerview-v7:$support_lib_version" | |
implementation "com.android.support:cardview-v7:$support_lib_version" | |
implementation "com.android.support:gridlayout-v7:$support_lib_version" | |
implementation "com.android.support:preference-v7:$support_lib_version" | |
implementation "com.android.support:preference-v14:$support_lib_version" | |
implementation "com.android.support:design:$support_lib_version" | |
implementation "com.android.support:customtabs:$support_lib_version" | |
implementation "com.android.support.constraint:constraint-layout:$constraint_layout_version" | |
// Kotlin | |
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | |
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" | |
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version" | |
// DI | |
implementation "com.google.dagger:dagger:$dagger_version" | |
kapt "com.google.dagger:dagger-compiler:$dagger_version" | |
compileOnly 'javax.annotation:jsr250-api:1.0' | |
// Square | |
implementation "com.jakewharton.timber:timber:$timber_version" | |
// Rx | |
implementation "io.reactivex.rxjava2:rxjava:$rxjava_version" | |
implementation "io.reactivex.rxjava2:rxandroid:$rxandroid_version" | |
implementation "io.reactivex.rxjava2:rxkotlin:$rxkotlin_version" | |
implementation "com.jakewharton.rxbinding2:rxbinding:$rxbinding_version" | |
implementation "com.jakewharton.rxbinding2:rxbinding-support-v4:$rxbinding_version" | |
implementation "com.jakewharton.rxbinding2:rxbinding-appcompat-v7:$rxbinding_version" | |
// Backport | |
implementation "com.jakewharton.threetenabp:threetenabp:$threeten_version" | |
// Permission | |
implementation("com.github.hotchemi:permissionsdispatcher:$permission_dispatcher_version", { | |
exclude module: "support-v13" | |
}) | |
kapt "com.github.hotchemi:permissionsdispatcher-processor:$permission_dispatcher_version" | |
// OnActivityResult | |
implementation "com.vanniktech:onactivityresult:$onactivityresult_version" | |
kapt "com.vanniktech:onactivityresult-compiler:$onactivityresult_version" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gradle | |
org.gradle.daemon=true | |
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | |
org.gradle.caching=true | |
# Kotlin | |
kotlin.incremental=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./gradlew wrapper --gradle-version 4.10.1 --distribution-type all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment