Skip to content

Instantly share code, notes, and snippets.

View nrohmen's full-sized avatar

Nur Rohman nrohmen

View GitHub Profile
import kotlin.system.measureTimeMillis
fun main(args : Array<String>){
val time = measureTimeMillis{
val fibo = generateSequence(1 to 1) {
it.second to it.first + it.second
}.map{ it.second }
println(fibo.take(10000).joinToString())
}
implementation(Dependencies.Kotlin.kotlin_std)
implementation(Dependencies.SupportLibs.appcompat)
implementation(Dependencies.SupportLibs.constraint_layout)
private const val kotlinVersion = "1.3.31"
private const val androidGradleVersion = "3.4.0"
//support libs
private const val appcompatVersion = "1.0.0"
private const val constraintLayoutVersion = "1.1.3"
//test libs
private const val junitVersion = "4.12"
private const val runnerVersion = "1.1.0"
plugins {
`kotlin-dsl`
}
repositories {
jcenter()
}
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.31")
implementation("com.android.support:appcompat-v7:28.0.0")
implementation("com.android.support.constraint:constraint-layout:1.1.3")
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")
}
@nrohmen
nrohmen / build.gradle.kts
Created May 15, 2019 08:14
playing kotlin dsl
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.21")
implementation("com.android.support:appcompat-v7:28.0.0")
implementation("com.android.support.constraint:constraint-layout:1.1.3")
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")
}
@nrohmen
nrohmen / build.gradle.kts
Created May 15, 2019 08:12
playing kotlin dsl
android {
compileSdkVersion(28)
defaultConfig {
applicationId = "com.nrohmen.kotlinandroidcleanarchitecture"
minSdkVersion(19)
targetSdkVersion(28)
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
}
@nrohmen
nrohmen / build.gradle.kts
Created May 15, 2019 08:11
playing kotlin dsl
//from:
apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply plugin: "kotlin-android-extensions"
//to:
plugins{
id("com.android.application")
kotlin("android")
kotlin("android.extensions")
@nrohmen
nrohmen / settings.gradle.kts
Created May 15, 2019 08:05
playing kotlin dsl
// before
include ':app'
// after
include(":app")
@nrohmen
nrohmen / gradle-wrapper.properties
Created May 15, 2019 07:53
Playing Gradle Script
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-all.zip