Skip to content

Commit

Permalink
Update tooling (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gediminas Zukas authored Jul 1, 2021
1 parent 2b2510c commit 0dd49a3
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 17 deletions.
5 changes: 2 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:${Versions.ANDROID_GRADLE_PLUGIN}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.KOTLIN}")
classpath("com.github.dcendents:android-maven-gradle-plugin:${Versions.ANDROID_MAVEN}")
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven(url = "https://jitpack.io")
}
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ plugins {
}

repositories {
jcenter()
mavenCentral()
}
21 changes: 13 additions & 8 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
object Versions {
const val APP_COMPAT = "1.1.0"
const val KOTLIN = "1.4.10"
const val COROUTINES = "1.4.2"
const val ANDROID_GRADLE_PLUGIN = "4.0.1"
const val KOTLIN = "1.5.10"
const val COROUTINES = "1.5.0"
const val ANDROID_GRADLE_PLUGIN = "4.2.1"
const val JUNIT = "4.13"
const val ROBOLECTRIC = "4.3"
const val MOCKITO = "3.1.0"
const val MOCKITO_KOTILN = "2.2.0"
const val MOCKITO = "3.11.2"
const val MOCKITO_KOTILN = "3.2.0"
const val CORE_KTX = "1.2.0"
const val FRAGMENT_KTX = "1.2.4"
const val ANDROID_MAVEN = "2.1"
const val DETEKT_RUNTIME = "1.8.0"
const val DETEKT_RUNTIME = "1.17.1"
const val LIFECYCLE = "2.2.0"

const val COMPILE_SDK_VERSION = 29
const val MIN_SDK_VERSION = 21

private const val MAJOR = 0
private const val MINOR = 4
private const val PATCH = 0

const val VERSION_NAME: String = "$MAJOR.$MINOR.$PATCH"
}

object Libs {
Expand All @@ -25,7 +30,7 @@ object Libs {
const val JUNIT = "junit:junit:${Versions.JUNIT}"
const val ROBOLECTRIC = "org.robolectric:robolectric:${Versions.ROBOLECTRIC}"
const val MOCKITO = "org.mockito:mockito-core:${Versions.MOCKITO}"
const val MOCKITO_KOTLIN = "com.nhaarman.mockitokotlin2:mockito-kotlin:${Versions.MOCKITO_KOTILN}"
const val MOCKITO_KOTLIN = "org.mockito.kotlin:mockito-kotlin:${Versions.MOCKITO_KOTILN}"
const val CORE_KTX = "androidx.core:core-ktx:${Versions.CORE_KTX}"
const val KOTLIN_TESTS = "org.jetbrains.kotlin:kotlin-test:${Versions.KOTLIN}"
const val FRAGMENT_KTX = "androidx.fragment:fragment-ktx:${Versions.FRAGMENT_KTX}"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-all.zip
20 changes: 18 additions & 2 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import Versions.VERSION_NAME

plugins {
id("com.android.library")
id("com.github.dcendents.android-maven")
id("maven-publish")
kotlin("android")
kotlin("android.extensions")
}

group = "com.github.vinted"

android {
compileSdkVersion(Versions.COMPILE_SDK_VERSION)

Expand All @@ -15,7 +19,19 @@ android {
buildTypes {
kotlinOptions {
freeCompilerArgs = listOf("-Xopt-in=kotlin.contracts.ExperimentalContracts")
}
}
}

afterEvaluate {
publishing {
publications {
create<MavenPublication>("release") {
groupId = "$group"
artifactId = "coper"
version = VERSION_NAME
from(components["release"])
}
}
}
}
Expand All @@ -29,7 +45,7 @@ tasks {

val javaDoc by creating(Javadoc::class) {
isFailOnError = false
source = main.java.sourceFiles
source = main.java.getSourceFiles()
classpath += project.files(android.bootClasspath.joinToString(File.pathSeparator))
}

Expand Down
6 changes: 4 additions & 2 deletions library/src/test/java/com/vinted/coper/CoperImplTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import com.nhaarman.mockitokotlin2.*
import com.vinted.coper.CoperImpl.Companion.FRAGMENT_TAG
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.first
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.eq
import org.mockito.Mockito.*
import org.mockito.kotlin.anyArray
import org.mockito.kotlin.anyOrNull
import org.mockito.kotlin.whenever
import org.robolectric.Robolectric
import org.robolectric.RobolectricTestRunner
import org.robolectric.Shadows.shadowOf
Expand Down

0 comments on commit 0dd49a3

Please sign in to comment.