Last active
March 31, 2019 00:44
-
-
Save alwarren/9ded314abdffd9ba90cf7f5e11a6e9b0 to your computer and use it in GitHub Desktop.
Android Kotin DSL
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
plugins { | |
id("com.android.application") | |
kotlin("android") | |
kotlin("android.extensions") | |
kotlin("kapt") | |
} | |
android { | |
compileSdkVersion(Versions.compileSdk) | |
defaultConfig { | |
applicationId = Versions.applicationId | |
minSdkVersion(Versions.minSdk) | |
targetSdkVersion(Versions.targetSdk) | |
versionCode = Versions.versionCode | |
versionName = Versions.versionName | |
testInstrumentationRunner = Versions.instrumentationRunner | |
} | |
buildTypes { | |
getByName("release") { | |
isMinifyEnabled = false | |
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") | |
} | |
} | |
} | |
dependencies { | |
implementation(Deps.kotlinStdlibJdk7) | |
implementation(Deps.appcompat) | |
implementation(Deps.kotlinCore) | |
implementation(Deps.constraintlayout) | |
testImplementation(Deps.junit4) | |
androidTestImplementation(Deps.testRunner) | |
androidTestImplementation(Deps.espressoCore) | |
} |
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
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
repositories { | |
google() | |
jcenter() | |
} | |
dependencies { | |
classpath(Deps.gradleAndroid) | |
classpath(Deps.gradleKotlin) | |
// NOTE: Do not place your application dependencies here; they belong | |
// in the individual module build.gradle files | |
} | |
} | |
allprojects { | |
repositories { | |
google() | |
jcenter() | |
} | |
} | |
tasks.register("clean", Delete::class) { | |
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
plugins { | |
`kotlin-dsl` | |
} | |
repositories { | |
jcenter() | |
} |
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
@Suppress("unused") | |
object Deps { | |
const val gradleAndroid = "com.android.tools.build:gradle:${Versions.gradleAndroid}" | |
const val gradleKotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}" | |
const val kotlinStdlibJdk7 = "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${Versions.kotlin}" | |
const val kotlinStdlibJdk8 = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlin}" | |
const val kotlinCore = "androidx.core:core-ktx:${Versions.kotlinCore}" | |
const val appcompat = "androidx.appcompat:appcompat:${Versions.appcompat}" | |
const val constraintlayout = "androidx.constraintlayout:constraintlayout:${Versions.constraintlayout}" | |
const val junit4 = "junit:junit:${Versions.junit4}" | |
const val testRunner = "androidx.test:runner:${Versions.testRunner}" | |
const val espressoCore = "androidx.test.espresso:espresso-core:${Versions.espressoCore}" | |
} | |
@Suppress("unused") | |
object Versions { | |
// Sdk and tools | |
const val compileSdk = 28 | |
const val minSdk = 19 | |
const val targetSdk = 28 | |
const val applicationId = "com.ntxdroid.kotlindsl" | |
const val versionCode = 1 | |
const val versionName = "1.0" | |
// Gradle | |
const val gradleAndroid = "3.3.0" | |
// Android | |
const val appcompat = "1.0.0-beta01" | |
const val constraintlayout = "1.1.2" | |
// Kotlin | |
const val kotlin = "1.3.21" | |
const val kotlinCore = "1.1.0-alpha05" | |
// Testing | |
const val junit4 = "4.12" | |
const val testRunner = "1.1.0-alpha4" | |
const val espressoCore = "3.1.0-alpha4" | |
const val instrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | |
} |
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
// intentionally left empty |
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
#Sat Mar 30 12:50:25 CDT 2019 | |
distributionBase=GRADLE_USER_HOME | |
distributionPath=wrapper/dists | |
zipStoreBase=GRADLE_USER_HOME | |
zipStorePath=wrapper/dists | |
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip |
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
include(":app") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment