From 6ad5fcdac1b7286724bdb67bdfe6be49cb715b6f Mon Sep 17 00:00:00 2001 From: Mike Gouline Date: Thu, 30 May 2019 18:45:53 +1000 Subject: [PATCH] Cleanup before release --- CHANGELOG.md | 5 ++++ README.md | 2 -- build.gradle | 9 ++++---- gradle/wrapper/gradle-wrapper.properties | 4 ++-- kapsule-core/build.gradle | 2 +- .../space/traversal/kapsule/DelegateTest.kt | 18 ++++++++++----- .../space/traversal/kapsule/KapsuleTest.kt | 20 ++++++++++------ .../space/traversal/kapsule/KapsulesTest.kt | 5 ++-- samples/android/build.gradle | 23 ++++++++++--------- samples/simple/build.gradle | 2 +- 10 files changed, 52 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4323e93..4546148 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## Version 1.0 (2019-05-30) + +* Update dependency versions. +* Promote to stable release. + ## Version 0.3 (2017-08-10) * Support for transitive dependencies via `HasModules` interface and `transitive()` call on the root module. diff --git a/README.md b/README.md index 836eb86..ed50299 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ Minimalist dependency injection library for Kotlin. -**Note:** Kapsule is currently in pre-release stages of development. While every milestone build is well-tested and ready for use, breaking changes can be introduced without warning. Once version 1.0 is released, the changes will become more gradual. - Why create another dependency injection library? Here are the objectives pursued by Kapsule: * Simple features that most projects will have use for diff --git a/build.gradle b/build.gradle index a391146..a831393 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,9 @@ buildscript { ext { - kotlin_min_version = '1.0.7' - kotlin_max_version = '1.2.71' + kotlin_version = '1.3.31' junit_version = '4.12' - mockito_version = '2.7.19' + mockito_version = '2.28.2' } repositories { @@ -12,8 +11,8 @@ buildscript { } dependencies { - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0' - classpath 'org.jetbrains.dokka:dokka-gradle-plugin:0.9.17' + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' + classpath 'org.jetbrains.dokka:dokka-gradle-plugin:0.9.18' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a4c13a9..ee47271 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Feb 18 22:08:56 AEDT 2017 +#Thu May 30 18:05:31 AEST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip diff --git a/kapsule-core/build.gradle b/kapsule-core/build.gradle index 2ab830b..10868bb 100644 --- a/kapsule-core/build.gradle +++ b/kapsule-core/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = kotlin_max_version + ext.kotlin_version = kotlin_version dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" diff --git a/kapsule-core/src/test/kotlin/space/traversal/kapsule/DelegateTest.kt b/kapsule-core/src/test/kotlin/space/traversal/kapsule/DelegateTest.kt index 01b49f8..1da8442 100644 --- a/kapsule-core/src/test/kotlin/space/traversal/kapsule/DelegateTest.kt +++ b/kapsule-core/src/test/kotlin/space/traversal/kapsule/DelegateTest.kt @@ -20,7 +20,8 @@ import kotlin.reflect.KProperty */ class DelegateTest : TestCase() { - @Test fun testInitialize_required() { + @Test + fun testInitialize_required() { val delegate = Delegate.Required { value } assertEquals(null, delegate.value) @@ -31,7 +32,8 @@ class DelegateTest : TestCase() { } } - @Test fun testInitialize_optional() { + @Test + fun testInitialize_optional() { val delegate = Delegate.Optional { value } assertEquals(null, delegate.value) @@ -42,7 +44,8 @@ class DelegateTest : TestCase() { } } - @Test fun testGetValue_required() { + @Test + fun testGetValue_required() { val delegate = Delegate.Required { value } val prop = Mockito.mock(KProperty::class.java) @@ -58,7 +61,8 @@ class DelegateTest : TestCase() { assertEquals(expected, delegate.getValue(null, prop)) } - @Test fun testGetValue_optional() { + @Test + fun testGetValue_optional() { val delegate = Delegate.Optional { value } val prop = Mockito.mock(KProperty::class.java) @@ -69,7 +73,8 @@ class DelegateTest : TestCase() { assertEquals(expected, delegate.getValue(null, prop)) } - @Test fun testSetValue_required() { + @Test + fun testSetValue_required() { val delegate = Delegate.Required { value } val prop = Mockito.mock(KProperty::class.java) @@ -79,7 +84,8 @@ class DelegateTest : TestCase() { } } - @Test fun testSetValue_optional() { + @Test + fun testSetValue_optional() { val delegate = Delegate.Optional { value } val prop = Mockito.mock(KProperty::class.java) diff --git a/kapsule-core/src/test/kotlin/space/traversal/kapsule/KapsuleTest.kt b/kapsule-core/src/test/kotlin/space/traversal/kapsule/KapsuleTest.kt index bfb8c14..568af3d 100644 --- a/kapsule-core/src/test/kotlin/space/traversal/kapsule/KapsuleTest.kt +++ b/kapsule-core/src/test/kotlin/space/traversal/kapsule/KapsuleTest.kt @@ -20,14 +20,17 @@ import kotlin.reflect.KProperty */ class KapsuleTest : TestCase() { - @Test fun testRequired() { + @Suppress("USELESS_IS_CHECK") + @Test + fun testRequired() { val kap = Kapsule() assertTrue(kap.required { reqInt } is Delegate.Required) - assertTrue(kap { reqInt } is Delegate.Required) + assertTrue(kap { reqInt } is Delegate.Required) assertTrue(kap.optional { reqInt } is Delegate.Optional) } - @Test fun testDelegates() { + @Test + fun testDelegates() { val kap = Kapsule() for (i in 0..2) { val initializer: (MultiModule.() -> Int) = { reqInt } @@ -39,7 +42,8 @@ class KapsuleTest : TestCase() { assertEquals(3, kap.delegates.count()) } - @Test fun testInject() { + @Test + fun testInject() { val kap = Kapsule() val prop = Mockito.mock(KProperty::class.java) @@ -54,7 +58,8 @@ class KapsuleTest : TestCase() { } } - @Test fun testTarget_pre() { + @Test + fun testTarget_pre() { val target = Target() assertEquals(null, target.optString) @@ -67,7 +72,8 @@ class KapsuleTest : TestCase() { } } - @Test fun testTarget_multiple() { + @Test + fun testTarget_multiple() { val target = Target() listOf(MultiModule("test1", 3, "abc123"), @@ -82,7 +88,7 @@ class KapsuleTest : TestCase() { val kap = Kapsule() var optString by kap.optional { optString } - val reqInt by kap { reqInt } + val reqInt by kap { reqInt } fun inject(module: MultiModule) { kap.inject(module) diff --git a/kapsule-core/src/test/kotlin/space/traversal/kapsule/KapsulesTest.kt b/kapsule-core/src/test/kotlin/space/traversal/kapsule/KapsulesTest.kt index 1b0069f..8d6718e 100644 --- a/kapsule-core/src/test/kotlin/space/traversal/kapsule/KapsulesTest.kt +++ b/kapsule-core/src/test/kotlin/space/traversal/kapsule/KapsulesTest.kt @@ -12,7 +12,6 @@ package space.traversal.kapsule import junit.framework.TestCase import org.junit.Test -import org.omg.CORBA.Object /** * Test case for [Kapsules]. @@ -21,14 +20,14 @@ class KapsulesTest : TestCase() { @Test fun testFetch() { Kapsules.instances.clear() - val caller = object : Injects {} + val caller = object : Injects {} assertEquals(null, Kapsules.fetch(caller)) assertEquals(0, Kapsules.instances.size) } @Test fun testGet() { Kapsules.instances.clear() - val caller = object : Injects {} + val caller = object : Injects {} val kap = Kapsules.get(caller) assertEquals(kap, Kapsules.get(caller)) assertEquals(1, Kapsules.instances.size) diff --git a/samples/android/build.gradle b/samples/android/build.gradle index c708190..9c57884 100644 --- a/samples/android/build.gradle +++ b/samples/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = kotlin_max_version + ext.kotlin_version = kotlin_version repositories { google() @@ -7,7 +7,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.1.0' + classpath 'com.android.tools.build:gradle:3.4.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version" } @@ -18,12 +18,12 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 27 + compileSdkVersion 28 defaultConfig { applicationId "space.traversal.kapsule.demo" - minSdkVersion 21 - targetSdkVersion 27 + minSdkVersion 26 + targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -37,16 +37,17 @@ android { } repositories { + google() jcenter() } dependencies { - compile project(':kapsule-core') + implementation project(':kapsule-core') - compile 'com.android.support:appcompat-v7:25.3.1' - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation 'com.android.support:appcompat-v7:28.0.0' + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - testCompile 'junit:junit:4.12' - testCompile 'org.robolectric:robolectric:3.2.2' - testCompile 'org.mockito:mockito-core:1.10.19' + testImplementation 'junit:junit:4.12' + testImplementation 'org.robolectric:robolectric:3.2.2' + testImplementation 'org.mockito:mockito-core:1.10.19' } diff --git a/samples/simple/build.gradle b/samples/simple/build.gradle index ce53de8..c177b2e 100644 --- a/samples/simple/build.gradle +++ b/samples/simple/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = kotlin_max_version + ext.kotlin_version = kotlin_version dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"