From 0e4c086bd2c0999ef85bdaf8d5025e885ab435d3 Mon Sep 17 00:00:00 2001 From: MJ Date: Sun, 6 Aug 2017 17:36:22 +0200 Subject: [PATCH 01/11] Prepared for the next release. #98 --- CHANGELOG.md | 2 ++ version.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbc34332..08db8060 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +#### 1.9.6-SNAPSHOT + #### 1.9.6-b7 - **[UPDATE]** Updated to Kotlin 1.1.3-2. diff --git a/version.txt b/version.txt index 050ef77c..51c785cd 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.9.6-b7 +1.9.6-SNAPSHOT From a6be956236ca4e034fc03cea947453af91270538 Mon Sep 17 00:00:00 2001 From: MJ Date: Wed, 30 Aug 2017 13:37:38 +0200 Subject: [PATCH 02/11] Updated to Kotlin 1.1.4-3. #100 --- CHANGELOG.md | 3 +++ README.md | 2 +- async/README.md | 6 +++--- gradle.properties | 8 ++++---- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08db8060..b1ae13ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ #### 1.9.6-SNAPSHOT +- **[UPDATE]** Updated to Kotlin 1.1.4-3. +- **[UPDATE]** Updated to Kotlin Coroutines 0.18. + #### 1.9.6-b7 - **[UPDATE]** Updated to Kotlin 1.1.3-2. diff --git a/README.md b/README.md index 46ca523f..a4c9cdad 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Travis CI](https://travis-ci.org/libktx/ktx.svg?branch=master)](https://travis-ci.org/libktx/ktx) [![Maven Central](https://img.shields.io/maven-central/v/io.github.libktx/ktx-async.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.github.libktx%22) -[![Kotlin](https://img.shields.io/badge/kotlin-1.1.3--2-orange.svg)](http://kotlinlang.org/) +[![Kotlin](https://img.shields.io/badge/kotlin-1.1.4--3-orange.svg)](http://kotlinlang.org/) [![LibGDX](https://img.shields.io/badge/libgdx-1.9.6-red.svg)](https://libgdx.badlogicgames.com/) [![KTX](.github/ktx-logo.png "KTX")](http://libktx.github.io) diff --git a/async/README.md b/async/README.md index 66954ac9..ecac6425 100644 --- a/async/README.md +++ b/async/README.md @@ -1,4 +1,4 @@ -[![Kotlin](https://img.shields.io/badge/kotlin--coroutines-0.17-orange.svg)](http://kotlinlang.org/) +[![Kotlin](https://img.shields.io/badge/kotlin--coroutines-0.18-orange.svg)](http://kotlinlang.org/) # KTX: coroutines support and threading utilities @@ -116,7 +116,7 @@ class Application: ApplicationAdapter() { } ``` -**KTX** `AssetStorage`: +The same use case rewritten with **KTX** `AssetStorage`: ```Kotlin class Application: ApplicationAdapter() { @@ -145,7 +145,7 @@ class Application: ApplicationAdapter() { Feature | `AssetStorage` | `AssetManager` --- | --- | --- -*Asynchronous loading* | **Supported.** Asset loading is performed on a separate thread, while the main rendering thread is suspended (_not blocked_) and resumed once the asset is fully loaded | **Supported.** All assets are loaded on a separate thread and are available after the loading is finished. +*Asynchronous loading* | **Supported.** Asset loading is performed on a separate thread, while the action on main rendering thread is suspended (_not blocked_) and resumed once the asset is fully loaded. | **Supported.** All assets are loaded on a separate thread and are available after the loading is finished. *Synchronous loading* | **Limited.** A blocking coroutine can be launched to load assets eagerly, but it cannot block the rendering thread. | **Limited.** `finishLoading(String fileName)` method can be used to block the thread until the asset is loaded, but since it has no effect on loading order, all _other_ assets can be loaded before the requested one. *Error handling* | **Build-in language syntax.** Use a regular try-catch block within coroutine body to handle loading errors. Provides a clean way to separately handle exceptions thrown by different assets. | **Via listener.** One can register a global error handling listener that will be notified if a loading exception is thrown. *Loading order* | **Controlled by the user.** `AssetStorage` starts loading assets as soon as the `load` method is called, giving the user full control over the order of asset loading. | **Unpredictable.** If multiple assets are scheduled at once it is difficult to reason about loading order. `finishLoading` has no effect on loading order. diff --git a/gradle.properties b/gradle.properties index f474cda9..f579c546 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,17 +1,17 @@ libGroup=io.github.libktx gdxVersion=1.9.6 -kotlinVersion=1.1.3-2 -kotlinCoroutinesVersion=0.17 +kotlinVersion=1.1.4-3 +kotlinCoroutinesVersion=0.18 ashleyVersion=1.7.3 visUiVersion=1.3.0 -spekVersion=1.1.2 +spekVersion=1.1.3 kotlinTestVersion=2.0.5 kotlinMockitoVersion=1.5.0 assertjVersion=3.8.0 junitVersion=4.12 -junitPlatformVersion=1.0.0-RC2 +junitPlatformVersion=1.0.0-RC3 slf4jVersion=1.7.25 wireMockVersion=2.7.1 From 55a57927209f92ae1a046cbe7bf6922d43543fbd Mon Sep 17 00:00:00 2001 From: MJ Date: Wed, 30 Aug 2017 13:39:54 +0200 Subject: [PATCH 03/11] Updated to Gradle 4.1. #100 --- CHANGELOG.md | 1 + gradle/wrapper/gradle-wrapper.jar | Bin 54712 -> 54708 bytes gradle/wrapper/gradle-wrapper.properties | 3 +-- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1ae13ac..f9bc2430 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - **[UPDATE]** Updated to Kotlin 1.1.4-3. - **[UPDATE]** Updated to Kotlin Coroutines 0.18. +- **[UPDATE]** Updated to Gradle 4.1. #### 1.9.6-b7 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e0959e221f5b62fef79349017a8996133c9fcf71..7a3265ee94c0ab25cf079ac8ccdf87f41d455d42 100644 GIT binary patch delta 673 zcmYL{T}YEr9LC@CS2iPM?-E7dDatC-SEkOe=9HWi7A|cvi!7}mR_kk$kr%=)BqA>g zwTIC+k+YNsInN&s|1%lPmm+E8Eh%)}BF_bAu%@Q_3^@dEz<l3g#bM?1)#;Dy%C z*08Rfp_Kwr&n_$#^@k<$_J3tb8p5lYQ&ern_>2i&vk|sgm5ME*;j$Po#HGGU$o4ut zVzaems!Pipl+CHkkB+&cBs+!K)|La8vj8h|Dk*JgD;Jh|m0CK5^vxfpvMzy<`9q9g zTsTe!4=kSDxVNA(A0`(X>6r&_J$qqD%BYVhRPN=n5NEx+gf+&k=v55*itr`UOy_+Z zD@AfLs!*sG-+Ig8NXU4}<)fRpKDZOVqE@=yFHq}OaQd@KrU4Wmd>#aSeGwT?5UXcak+u^JQr9RKSG`{j%M7A*Dx9H<8Jl?#zYtUjVpqWOon)o1DZFX^1&JE}ZvX%Q delta 808 zcmYk4Ur5tY6vuz}C_lF~b*rZH*KDN-+iz%TSe6U5KQvm3pp`~s51JvBB_w1>NDoqp zF29szisXYYLLf{K3N*HpEvR3U2yu( zZkM9ZU!xh~@z%EH11R%bAP3Ue3`~I%wuU=$1{wn@?PXv=6Dpa4X>RM}xb2@kM$VKC zrNyP$6Ev*da2mXwJxFVrTTVAuPM^(j2VK@a*nYH!~F^LT!P7B?TMMUYrQCiv>JaoGL1xxDw$5mw<0v zdbEB}X{Vdp98|f@;s~}%!;Y;3OOmBOSVOK_QP2`RL$-P$=Yyvx`Ld9?p)xWy!O@h5 zMkRj>MobL_!cgt z?shJZy+#7>g+EC*DU|$kZc1 zb@Vi4_Mxz^3}Mc{Mir(5TWlorGaj_Vvsg-|0U_%K^rCI@VB)a;ycDo>FoSQP($bJ< zn?7vh{Zz7#2y0n(QS&IeMs4U_<`bPnT8vM0QWgz=ze}9xccjMZ>Bls5Gfwm_7~qX5 o%#TRy8V&d`;oFb86}>h7vH$;N{v77*C*f)p4_6%WNq;=}57z$?;{X5v diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 31e44b24..bf1b63c3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Sun Aug 06 15:14:43 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip From 020f77a576fd4d2d19ac8cc8e9e464e86e237bb6 Mon Sep 17 00:00:00 2001 From: MJ Date: Thu, 2 Nov 2017 19:41:57 +0100 Subject: [PATCH 04/11] Removed redundant checks. #108 --- .../src/test/kotlin/kts/actors/actionsTest.kt | 9 +------- .../src/test/kotlin/kts/actors/eventsTest.kt | 9 +------- app/src/test/kotlin/ktx/app/gameTest.kt | 20 +++++++---------- .../src/test/kotlin/ktx/assets/assetsTest.kt | 1 + .../kotlin/ktx/async/assets/assetsTest.kt | 1 + .../test/kotlin/ktx/collections/arraysTest.kt | 6 +---- .../test/kotlin/ktx/collections/listsTest.kt | 9 ++++---- .../test/kotlin/ktx/collections/mapsTest.kt | 22 +++++++++---------- .../test/kotlin/ktx/collections/setsTest.kt | 13 +++++------ .../test/kotlin/ktx/scene2d/factoryTest.kt | 5 ----- .../test/kotlin/ktx/scene2d/tooltipTest.kt | 10 --------- .../src/test/kotlin/ktx/scene2d/widgetTest.kt | 2 +- 12 files changed, 34 insertions(+), 73 deletions(-) diff --git a/actors/src/test/kotlin/kts/actors/actionsTest.kt b/actors/src/test/kotlin/kts/actors/actionsTest.kt index 1180343f..9883973b 100644 --- a/actors/src/test/kotlin/kts/actors/actionsTest.kt +++ b/actors/src/test/kotlin/kts/actors/actionsTest.kt @@ -2,9 +2,7 @@ package kts.actors import com.badlogic.gdx.scenes.scene2d.Action import com.badlogic.gdx.scenes.scene2d.Actor -import com.badlogic.gdx.scenes.scene2d.actions.ParallelAction import com.badlogic.gdx.scenes.scene2d.actions.RepeatAction -import com.badlogic.gdx.scenes.scene2d.actions.SequenceAction import ktx.actors.* import org.junit.Assert.* import org.junit.Test @@ -66,7 +64,6 @@ class ActionsTest { val sequence = firstAction.then(secondAction) // === firstAction then secondAction - assertTrue(sequence is SequenceAction) assertEquals(firstAction, sequence.actions[0]) assertEquals(secondAction, sequence.actions[1]) assertEquals(2, sequence.actions.size) @@ -81,7 +78,6 @@ class ActionsTest { // / Note that the second "then" is a different extension function - it prevents from creating multiple sequences. val sequence = firstAction then secondAction then thirdAction - assertTrue(sequence is SequenceAction) assertEquals(firstAction, sequence.actions[0]) assertEquals(secondAction, sequence.actions[1]) assertEquals(thirdAction, sequence.actions[2]) @@ -95,7 +91,6 @@ class ActionsTest { val parallel = firstAction.parallelTo(secondAction) // === firstAction parallelTo secondAction - assertTrue(parallel is ParallelAction) assertTrue(firstAction in parallel.actions) assertTrue(secondAction in parallel.actions) assertEquals(2, parallel.actions.size) @@ -110,7 +105,6 @@ class ActionsTest { // Note that the second "parallelTo" is a different extension function - it prevents from creating multiple parallels. val parallel = firstAction parallelTo secondAction parallelTo thirdAction - assertTrue(parallel is ParallelAction) assertTrue(firstAction in parallel.actions) assertTrue(secondAction in parallel.actions) assertTrue(thirdAction in parallel.actions) @@ -121,13 +115,12 @@ class ActionsTest { fun `should create actions repeating forever`() { val action = MockAction().repeatForever() - assertTrue(action is RepeatAction) assertEquals(RepeatAction.FOREVER, action.count) } /** Action testing utility. */ class MockAction : Action() { - var acted = false + private var acted = false override fun act(delta: Float): Boolean { acted = true return true diff --git a/actors/src/test/kotlin/kts/actors/eventsTest.kt b/actors/src/test/kotlin/kts/actors/eventsTest.kt index 396cffd7..5e8d5ece 100644 --- a/actors/src/test/kotlin/kts/actors/eventsTest.kt +++ b/actors/src/test/kotlin/kts/actors/eventsTest.kt @@ -4,9 +4,7 @@ import com.badlogic.gdx.Input.Keys import com.badlogic.gdx.scenes.scene2d.Actor import com.badlogic.gdx.scenes.scene2d.InputEvent import com.badlogic.gdx.scenes.scene2d.InputEvent.Type.* -import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent -import com.badlogic.gdx.scenes.scene2d.utils.ClickListener import com.badlogic.gdx.scenes.scene2d.utils.FocusListener.FocusEvent import com.badlogic.gdx.scenes.scene2d.utils.FocusListener.FocusEvent.Type.keyboard import com.badlogic.gdx.scenes.scene2d.utils.FocusListener.FocusEvent.Type.scroll @@ -28,7 +26,6 @@ class EventsTest { assertNotNull(listener) assertTrue(listener in actor.listeners) - assertTrue(listener is ChangeListener) actor.fire(ChangeEvent()) assertTrue(changed) } @@ -42,7 +39,6 @@ class EventsTest { assertNotNull(listener) assertTrue(listener in actor.listeners) - assertTrue(listener is ChangeListener) actor.fire(ChangeEvent()) assertTrue(changed) } @@ -55,7 +51,6 @@ class EventsTest { assertNotNull(listener) assertTrue(listener in actor.listeners) - assertTrue(listener is ClickListener) } @Test @@ -66,7 +61,6 @@ class EventsTest { assertNotNull(listener) assertTrue(listener in actor.listeners) - assertTrue(listener is ClickListener) } @Test @@ -77,7 +71,6 @@ class EventsTest { assertNotNull(listener) assertTrue(listener in actor.listeners) - assertTrue(listener is ClickListener) } @Test @@ -248,7 +241,7 @@ class EventsTest { assertTrue(focused) } - @Suppress("unused") + @Suppress("unused", "ClassName") class `should extend KtxInputListener with no methods overridden` : KtxInputListener() { // Guarantees all KtxInputListener methods are optional to implement. } diff --git a/app/src/test/kotlin/ktx/app/gameTest.kt b/app/src/test/kotlin/ktx/app/gameTest.kt index 6acbaed6..72ea99c1 100644 --- a/app/src/test/kotlin/ktx/app/gameTest.kt +++ b/app/src/test/kotlin/ktx/app/gameTest.kt @@ -1,8 +1,6 @@ package ktx.app -import com.badlogic.gdx.Application import com.badlogic.gdx.Gdx -import com.badlogic.gdx.Graphics import com.badlogic.gdx.Screen import com.badlogic.gdx.graphics.GL20 import com.badlogic.gdx.utils.GdxRuntimeException @@ -18,7 +16,7 @@ import org.junit.Test class KtxGameTest { @Before fun `set up OpenGL`() { - Gdx.gl20 = mock() + Gdx.gl20 = mock() Gdx.gl = Gdx.gl20 } @@ -26,7 +24,7 @@ class KtxGameTest { fun `should display firstScreen without registration`() { val screen = mock() val game = KtxGame(firstScreen = screen) - Gdx.graphics = mock { + Gdx.graphics = mock { on(it.width) doReturn 800 on(it.height) doReturn 600 } @@ -162,7 +160,7 @@ class KtxGameTest { val secondScreen = mock() val game = KtxGame(firstScreen) game.addScreen(secondScreen) - Gdx.graphics = mock { + Gdx.graphics = mock { on(it.width) doReturn 800 on(it.height) doReturn 600 } @@ -198,7 +196,7 @@ class KtxGameTest { @Test fun `should dispose of all registered Screen instances with error handling`() { - Gdx.app = mock() + Gdx.app = mock() val screen = mock() val ktxScreen = mock { on(it.dispose()) doThrow GdxRuntimeException("Expected.") @@ -229,13 +227,11 @@ class KtxGameTest { /** [Screen] implementation that tracks how many times it was rendered. */ open class MockScreen : KtxScreen { - var lastDelta = -1f - var rendered = false - var renderedTimes = 0 + private var rendered = false + private var renderedTimes = 0 override fun render(delta: Float) { rendered = true - lastDelta = delta renderedTimes++ } } @@ -249,10 +245,10 @@ class KtxScreenTest { fun `should provide mock-up screen instance`() { val screen = emptyScreen() - assertTrue(screen is Screen) + assertTrue(Screen::class.isInstance(screen)) } - @Suppress("unused") + @Suppress("unused", "ClassName") class `should implement KtxScreen with no methods overridden` : KtxScreen { // Guarantees all KtxScreen methods are optional to implement. } diff --git a/assets/src/test/kotlin/ktx/assets/assetsTest.kt b/assets/src/test/kotlin/ktx/assets/assetsTest.kt index 1acc5ba4..3c39a415 100644 --- a/assets/src/test/kotlin/ktx/assets/assetsTest.kt +++ b/assets/src/test/kotlin/ktx/assets/assetsTest.kt @@ -21,6 +21,7 @@ import org.junit.Test /** * Tests asset-related utilities and [AssetManager] extensions. */ +@Suppress("USELESS_IS_CHECK") // Explicitly checking loaded asset types. class AssetsTest { val assetManager: AssetManager = managerWithMockAssetLoader() diff --git a/async/src/test/kotlin/ktx/async/assets/assetsTest.kt b/async/src/test/kotlin/ktx/async/assets/assetsTest.kt index e241b68e..179800c2 100644 --- a/async/src/test/kotlin/ktx/async/assets/assetsTest.kt +++ b/async/src/test/kotlin/ktx/async/assets/assetsTest.kt @@ -42,6 +42,7 @@ import com.badlogic.gdx.utils.Array as GdxArray /** * Tests [AssetStorage]: coroutines-based asset manager. */ +@Suppress("USELESS_IS_CHECK") // Explicitly checking loaded asset types. class AssetStorageTest { @Test fun `should load text assets`() = `coroutine test`(concurrencyLevel = 1) { ktxAsync -> diff --git a/collections/src/test/kotlin/ktx/collections/arraysTest.kt b/collections/src/test/kotlin/ktx/collections/arraysTest.kt index dafedcbf..bb0725ec 100644 --- a/collections/src/test/kotlin/ktx/collections/arraysTest.kt +++ b/collections/src/test/kotlin/ktx/collections/arraysTest.kt @@ -13,7 +13,6 @@ class ArraysTest { val array = gdxArrayOf() assertNotNull(array) - assertTrue(array is GdxArray) assertEquals(0, array.size) } @@ -393,7 +392,6 @@ class ArraysTest { val result = array.map { it * 2 } - assertTrue(result is GdxArray) assertEquals(GdxArray.with(2, 4, 6), result) } @@ -403,7 +401,6 @@ class ArraysTest { val result = array.filter { it % 2 == 1 } - assertTrue(result is GdxArray) assertEquals(GdxArray.with(1, 3, 5), result) } @@ -413,7 +410,6 @@ class ArraysTest { val result = array.flatten() - assertTrue(result is GdxArray) assertEquals(GdxArray.with(1, 2, 3), result) } @@ -423,7 +419,6 @@ class ArraysTest { val result = array.flatMap { counter -> List(counter) { counter } } - assertTrue(result is GdxArray) assertEquals(GdxArray.with(1, 2, 2, 3, 3, 3), result) } @@ -502,6 +497,7 @@ class ArraysTest { } @Test + @Suppress("USELESS_IS_CHECK") // Description of the API. fun `should provide aliases for collections with conflicting names`() { assertTrue(GdxArray() is com.badlogic.gdx.utils.Array) assertTrue(GdxIntArray() is com.badlogic.gdx.utils.IntArray) diff --git a/collections/src/test/kotlin/ktx/collections/listsTest.kt b/collections/src/test/kotlin/ktx/collections/listsTest.kt index d786068c..01ee6238 100644 --- a/collections/src/test/kotlin/ktx/collections/listsTest.kt +++ b/collections/src/test/kotlin/ktx/collections/listsTest.kt @@ -12,6 +12,7 @@ class ListsTest { @Test fun shouldCreateNewLists() { val list = gdxListOf() + assertNotNull(list) assertEquals(0, list.size) assertTrue(list.isEmpty) @@ -20,6 +21,7 @@ class ListsTest { @Test fun shouldCreateNewListsWithElements() { val list = gdxListOf("1", "2", "3") + assertNotNull(list) assertEquals(3, list.size) assertTrue(list.isNotEmpty) @@ -30,6 +32,7 @@ class ListsTest { @Test fun shouldCreateNewListsFromArrays() { val list = arrayOf("1", "2", "3").toGdxList() + assertNotNull(list) assertEquals(3, list.size) assertTrue(list.isNotEmpty) @@ -40,6 +43,7 @@ class ListsTest { @Test fun shouldCreateNewListsFromIterables() { val list = sortedSetOf("1", "2", "3").toGdxList() + assertNotNull(list) assertEquals(3, list.size) assertTrue(list.isNotEmpty) @@ -49,6 +53,7 @@ class ListsTest { @Test fun `should provide alias for compatibility with other LibGDX collections`() { + @Suppress("USELESS_IS_CHECK") assertTrue(GdxList(NodePool) is PooledList) } } @@ -228,7 +233,6 @@ class PooledListTest { val list = gdxListOf(1, 2, 3) val result = list.map { it * 2 } - assertTrue(result is GdxList) assertEquals(3, result.size) assertEquals(2, result.first) assertEquals(6, result.last) @@ -239,7 +243,6 @@ class PooledListTest { val list = gdxListOf(1, 2, 3, 4, 5) val result = list.filter { it % 2 == 1 } - assertTrue(result is GdxList) assertEquals(3, result.size) assertEquals(1, result.first) assertEquals(5, result.last) @@ -250,7 +253,6 @@ class PooledListTest { val list = gdxListOf(GdxArray.with(1), listOf(), LinkedList(arrayListOf(2, 3))) val result = list.flatten() - assertTrue(result is GdxList) assertEquals(3, result.size) assertEquals(3, result.size) assertEquals(1, result.first) @@ -262,7 +264,6 @@ class PooledListTest { val list = gdxListOf(1, 2, 3) val result = list.flatMap { List(it) { "" } } - assertTrue(result is GdxList) assertEquals(6, result.size) } diff --git a/collections/src/test/kotlin/ktx/collections/mapsTest.kt b/collections/src/test/kotlin/ktx/collections/mapsTest.kt index f910ddc8..61578083 100644 --- a/collections/src/test/kotlin/ktx/collections/mapsTest.kt +++ b/collections/src/test/kotlin/ktx/collections/mapsTest.kt @@ -4,7 +4,7 @@ import com.badlogic.gdx.utils.* import com.badlogic.gdx.utils.Array import org.junit.Assert.* import org.junit.Test -import java.util.* +import java.util.LinkedList /** * Tests utilities for LibGDX custom HashMap equivalent - [ObjectMap]. @@ -13,30 +13,31 @@ class MapsTest { @Test fun shouldCreateMaps() { val map = gdxMapOf() + assertNotNull(map) - assertTrue(map is ObjectMap) assertEquals(0, map.size) } @Test fun shouldCreateMapsWithCustomInitialCapacity() { val map = gdxMapOf(initialCapacity = 32) + assertNotNull(map) - assertTrue(map is ObjectMap) assertEquals(0, map.size) } @Test fun shouldCreateMapsWithCustomLoadFactor() { val map = gdxMapOf(loadFactor = 0.4f) + assertNotNull(map) - assertTrue(map is ObjectMap) assertEquals(0, map.size) } @Test fun shouldCreateMapsFromKeyToValuePairs() { val map = gdxMapOf("key" to "value", "other" to "another") + assertEquals(2, map.size) assertTrue("key" in map) assertTrue("other" in map) @@ -197,8 +198,8 @@ class MapsTest { @Test fun shouldCreateIdentityMaps() { val map = gdxIdentityMapOf() + assertNotNull(map) - assertTrue(map is IdentityMap) assertEquals(0, map.size) } @@ -251,8 +252,8 @@ class MapsTest { @Test fun shouldSupportOptimizedPrimitiveIntIntMap() { val map = gdxIntIntMap() + assertNotNull(map) - assertTrue(map is IntIntMap) assertEquals(0, map.size) map[1] = 2 // Tests array bracket operator. assertEquals(2, map[1]) @@ -266,8 +267,8 @@ class MapsTest { @Test fun shouldSupportOptimizedPrimitiveIntFloatMap() { val map = gdxIntFloatMap() + assertNotNull(map) - assertTrue(map is IntFloatMap) assertEquals(0, map.size) map[1] = 2f // Tests array bracket operator. assertEquals(2f, map[1], 0.00001f) @@ -280,8 +281,8 @@ class MapsTest { @Test fun shouldSupportOptimizedIntMapWithPrimitiveIntKeys() { val map = gdxIntMap() + assertNotNull(map) - assertTrue(map is IntMap) assertEquals(0, map.size) map[1] = "2" // Tests array bracket operator. assertEquals("2", map[1]) @@ -292,6 +293,7 @@ class MapsTest { @Test fun `should provide alias for compatibility with other LibGDX collections`() { + @Suppress("USELESS_IS_CHECK") assertTrue(GdxMap() is ObjectMap) } @@ -384,7 +386,6 @@ class MapsTest { val map = gdxMapOf("One" to 1, "Two" to 2, "Three" to 3) val result = map.map { it.value * 2 } - assertTrue(result is GdxMap) assertEquals(gdxMapOf("One" to 2, "Two" to 4, "Three" to 6), result) } @@ -393,7 +394,6 @@ class MapsTest { val map = gdxMapOf("One" to 1, "Two" to 2, "Three" to 3, "Four" to 4, "Five" to 5) val result = map.filter { it.value % 2 == 1 } - assertTrue(result is GdxMap) assertEquals(gdxMapOf("One" to 1, "Three" to 3, "Five" to 5), result) } @@ -402,7 +402,6 @@ class MapsTest { val map = gdxMapOf(1 to GdxArray.with(1), 2 to listOf(), 3 to LinkedList(arrayListOf(2, 3))) val result = map.flatten() - assertTrue(result is GdxArray) assertEquals(3, result.size) assertEquals(GdxArray.with(1, 2, 3), result) } @@ -413,7 +412,6 @@ class MapsTest { val result = map.flatMap { (_, value) -> List(value!!) { value } } result.sort() - assertTrue(result is GdxArray) assertEquals(GdxArray.with(1, 2, 2, 3, 3, 3), result) } diff --git a/collections/src/test/kotlin/ktx/collections/setsTest.kt b/collections/src/test/kotlin/ktx/collections/setsTest.kt index 53bc3344..234ae577 100644 --- a/collections/src/test/kotlin/ktx/collections/setsTest.kt +++ b/collections/src/test/kotlin/ktx/collections/setsTest.kt @@ -3,7 +3,7 @@ package ktx.collections import com.badlogic.gdx.utils.ObjectSet import org.junit.Assert.* import org.junit.Test -import java.util.* +import java.util.LinkedList /** * Tests utilities for LibGDX custom HashSet equivalent - [ObjectSet]. @@ -12,24 +12,24 @@ class SetsTest { @Test fun shouldCreateSet() { val set = gdxSetOf() + assertNotNull(set) - assertTrue(set is ObjectSet) assertEquals(0, set.size) } @Test fun shouldCreateSetsWithCustomInitialCapacity() { val set = gdxSetOf(initialCapacity = 32) + assertNotNull(set) - assertTrue(set is ObjectSet) assertEquals(0, set.size) } @Test fun shouldCreateSetsWithCustomLoadFactor() { val set = gdxSetOf(loadFactor = 0.4f) + assertNotNull(set) - assertTrue(set is ObjectSet) assertEquals(0, set.size) } @@ -226,7 +226,6 @@ class SetsTest { val set = GdxSet.with(1, 2, 3) val result = set.map { it * 2 } - assertTrue(result is GdxSet) assertTrue(2 in result) assertTrue(4 in result) assertTrue(6 in result) @@ -237,7 +236,6 @@ class SetsTest { val set = GdxSet.with(1, 2, 3, 4, 5) val result = set.filter { it % 2 == 1 } - assertTrue(result is GdxSet) assertEquals(3, result.size) assertTrue(1 in result) assertTrue(3 in result) @@ -249,7 +247,6 @@ class SetsTest { val set = GdxSet.with(GdxArray.with(1, 2), listOf(), LinkedList(arrayListOf(2, 3))) val result = set.flatten() - assertTrue(result is GdxSet) assertEquals(3, result.size) assertTrue(1 in result) assertTrue(2 in result) @@ -261,7 +258,6 @@ class SetsTest { val set = GdxSet.with(1, 2, 3) val result = set.flatMap { count -> List(count) { it } } - assertTrue(result is GdxSet) assertEquals(3, result.size) assertTrue(0 in result) assertTrue(1 in result) @@ -306,6 +302,7 @@ class SetsTest { @Test fun `should provide alias for compatibility with other LibGDX collections`() { + @Suppress("USELESS_IS_CHECK") assertTrue(GdxSet() is ObjectSet) } } diff --git a/scene2d/src/test/kotlin/ktx/scene2d/factoryTest.kt b/scene2d/src/test/kotlin/ktx/scene2d/factoryTest.kt index 4773dc14..edfc87e9 100644 --- a/scene2d/src/test/kotlin/ktx/scene2d/factoryTest.kt +++ b/scene2d/src/test/kotlin/ktx/scene2d/factoryTest.kt @@ -162,7 +162,6 @@ class InlinedInitBlockActorFactoriesTest : NeedsLibGDX() { // In table-based groups, children blocks point to the new actor as 'this' and its cell as 'it'. label("Cell") { // Actors stored in cells: - assertTrue(it is Cell<*>) assertTrue(it.actor is Label) } } @@ -170,11 +169,9 @@ class InlinedInitBlockActorFactoriesTest : NeedsLibGDX() { // In trees, children blocks point to the new actor as 'this' and to its node as 'it'. label("Node") { // Actors stored in tree nodes: - assertTrue(it is Node) assertTrue(it.actor is Label) it { label("NestedNode") { - assertTrue(it is Node) assertTrue(it.actor is Label) assertEquals("NestedNode", (it.actor as Label).text.toString()) } @@ -273,7 +270,6 @@ class InlinedInitBlockActorFactoriesTest : NeedsLibGDX() { fun `should create List`() = test(widget = { listWidget> { color = Color.BLUE - assertTrue(it is Cell<*>) // Adding list items: -"one" -"two" @@ -305,7 +301,6 @@ class InlinedInitBlockActorFactoriesTest : NeedsLibGDX() { fun `should create SelectBox`() = test(widget = { selectBox> { color = Color.BLUE - assertTrue(it is Cell<*>) // Adding select box items: -"one" -"two" diff --git a/scene2d/src/test/kotlin/ktx/scene2d/tooltipTest.kt b/scene2d/src/test/kotlin/ktx/scene2d/tooltipTest.kt index d23d3fd7..d77c7d00 100644 --- a/scene2d/src/test/kotlin/ktx/scene2d/tooltipTest.kt +++ b/scene2d/src/test/kotlin/ktx/scene2d/tooltipTest.kt @@ -3,8 +3,6 @@ package ktx.scene2d import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.Actor import com.badlogic.gdx.scenes.scene2d.ui.Label -import com.badlogic.gdx.scenes.scene2d.ui.Table -import com.badlogic.gdx.scenes.scene2d.ui.TextTooltip import com.badlogic.gdx.scenes.scene2d.ui.Tooltip import org.junit.Assert.* import org.junit.Test @@ -29,10 +27,6 @@ class TooltipFactoriesTest : NeedsLibGDX() { val actor = Actor() val tooltip = actor.addTextTooltip("Test.") { - // TextTooltip should be available as lambda parameter: - assertTrue(it is TextTooltip) - // Lambda should be invoked directly on the TextTooltip child: - assertTrue(this is Label) // Changing Label color: color = Color.BLUE } @@ -48,10 +42,6 @@ class TooltipFactoriesTest : NeedsLibGDX() { val actor = Actor() val tooltip = actor.addTooltip { - // Tooltip should be available as lambda parameter: - assertTrue(it is Tooltip) - // Lambda should be invoked directly on the Tooltip child: - assertTrue(this is Table) // Changing Table color: color = Color.BLUE // Adding child to Table content: diff --git a/scene2d/src/test/kotlin/ktx/scene2d/widgetTest.kt b/scene2d/src/test/kotlin/ktx/scene2d/widgetTest.kt index 85071bab..7b6d0e2f 100644 --- a/scene2d/src/test/kotlin/ktx/scene2d/widgetTest.kt +++ b/scene2d/src/test/kotlin/ktx/scene2d/widgetTest.kt @@ -339,7 +339,7 @@ class KScrollPaneTest : NeedsLibGDX() { scrollPane.addActor(actor) - assertEquals(actor, scrollPane.widget) + assertEquals(actor, scrollPane.actor) assertTrue(actor in scrollPane.children) } From ba27144228f423403475bd7b16428e265bed7400 Mon Sep 17 00:00:00 2001 From: MJ Date: Thu, 2 Nov 2017 19:42:21 +0100 Subject: [PATCH 05/11] Ignored ChainShape tests, which is broken in LibGDX 1.9.7. #108 --- box2d/src/test/kotlin/ktx/box2d/bodiesTest.kt | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/box2d/src/test/kotlin/ktx/box2d/bodiesTest.kt b/box2d/src/test/kotlin/ktx/box2d/bodiesTest.kt index 6e4682e5..3b302e0e 100644 --- a/box2d/src/test/kotlin/ktx/box2d/bodiesTest.kt +++ b/box2d/src/test/kotlin/ktx/box2d/bodiesTest.kt @@ -5,6 +5,7 @@ import com.badlogic.gdx.math.Vector2 import com.badlogic.gdx.physics.box2d.* import com.nhaarman.mockito_kotlin.mock import org.junit.Assert.* +import org.junit.Ignore import org.junit.Test import com.badlogic.gdx.utils.Array as GdxArray @@ -36,7 +37,6 @@ class BodiesTest : Box2DTest() { val fixtureDef = bodyDefinition.circle(radius = 1f, position = Vector2(2f, 3f)) { density = 0.5f - assertTrue(it is CircleShape) } assertTrue(fixtureDef.shape is CircleShape) @@ -59,7 +59,6 @@ class BodiesTest : Box2DTest() { position = Vector2(1f, 1f), angle = 90f * MathUtils.degreesToRadians) { density = 0.5f - assertTrue(it is PolygonShape) } assertTrue(fixtureDef.shape is PolygonShape) @@ -76,7 +75,6 @@ class BodiesTest : Box2DTest() { val fixtureDef = bodyDefinition.polygon(vertices = floatArrayOf(1f, 1f, 2f, 2f, 1f, 2f)) { density = 0.5f - assertTrue(it is PolygonShape) } assertTrue(fixtureDef.shape is PolygonShape) @@ -94,7 +92,6 @@ class BodiesTest : Box2DTest() { val fixtureDef = bodyDefinition.polygon(vertices = *arrayOf(Vector2(1f, 1f), Vector2(2f, 2f), Vector2(1f, 2f))) { density = 0.5f - assertTrue(it is PolygonShape) } assertTrue(fixtureDef.shape is PolygonShape) @@ -107,12 +104,12 @@ class BodiesTest : Box2DTest() { } @Test + @Ignore("ChainShape is broken in LibGDX 1.9.7.") fun `should construct FixtureDef with a ChainShape`() { val bodyDefinition = BodyDefinition() - val fixtureDef = bodyDefinition.chain(vertices = floatArrayOf(1f, 1f, 2f, 2f, 1f, 2f)) { + val fixtureDef = bodyDefinition.chain(vertices = floatArrayOf(1f, 1f, 2f, 2f, 1f, 2f, 2f, 1f)) { density = 0.5f - assertTrue(it is ChainShape) } assertTrue(fixtureDef.shape is ChainShape) @@ -125,12 +122,12 @@ class BodiesTest : Box2DTest() { } @Test + @Ignore("ChainShape is broken in LibGDX 1.9.7.") fun `should construct FixtureDef with a ChainShape with Vector2 Points`() { val bodyDefinition = BodyDefinition() val fixtureDef = bodyDefinition.chain(vertices = *arrayOf(Vector2(1f, 1f), Vector2(2f, 2f), Vector2(1f, 2f))) { density = 0.5f - assertTrue(it is ChainShape) } assertTrue(fixtureDef.shape is ChainShape) @@ -143,12 +140,12 @@ class BodiesTest : Box2DTest() { } @Test + @Ignore("ChainShape is broken in LibGDX 1.9.7.") fun `should construct FixtureDef with a looped ChainShape`() { val bodyDefinition = BodyDefinition() val fixtureDef = bodyDefinition.loop(vertices = floatArrayOf(1f, 1f, 2f, 2f, 1f, 2f)) { density = 0.5f - assertTrue(it is ChainShape) } assertTrue(fixtureDef.shape is ChainShape) @@ -162,12 +159,12 @@ class BodiesTest : Box2DTest() { } @Test + @Ignore("ChainShape is broken in LibGDX 1.9.7.") fun `should construct FixtureDef with a looped ChainShape with Vector2 Points`() { val bodyDefinition = BodyDefinition() val fixtureDef = bodyDefinition.loop(vertices = *arrayOf(Vector2(1f, 1f), Vector2(2f, 2f), Vector2(1f, 2f))) { density = 0.5f - assertTrue(it is ChainShape) } assertTrue(fixtureDef.shape is ChainShape) @@ -186,7 +183,6 @@ class BodiesTest : Box2DTest() { val fixtureDef = bodyDefinition.edge(from = Vector2(1f, 1f), to = Vector2(2f, 2f)) { density = 0.5f - assertTrue(it is EdgeShape) } assertTrue(fixtureDef.shape is EdgeShape) @@ -203,7 +199,6 @@ class BodiesTest : Box2DTest() { val fixtureDef = bodyDefinition.edge(fromX = 1f, fromY = 2f, toX = 3f, toY = 4f) { density = 0.5f - assertTrue(it is EdgeShape) } assertTrue(fixtureDef.shape is EdgeShape) @@ -249,7 +244,6 @@ class BodiesTest : Box2DTest() { val fixture = body.circle(radius = 1f, position = Vector2(2f, 3f)) { density = 0.5f - assertTrue(it is CircleShape) } assertTrue(fixture.shape is CircleShape) @@ -273,7 +267,6 @@ class BodiesTest : Box2DTest() { position = Vector2(1f, 1f), angle = 90f * MathUtils.degreesToRadians) { density = 0.5f - assertTrue(it is PolygonShape) } assertTrue(fixture.shape is PolygonShape) @@ -291,7 +284,6 @@ class BodiesTest : Box2DTest() { val fixture = body.polygon(vertices = floatArrayOf(1f, 1f, 2f, 2f, 1f, 2f)) { density = 0.5f - assertTrue(it is PolygonShape) } assertTrue(fixture.shape is PolygonShape) @@ -309,7 +301,6 @@ class BodiesTest : Box2DTest() { val fixture = body.polygon(vertices = *arrayOf(Vector2(1f, 1f), Vector2(2f, 2f), Vector2(1f, 2f))) { density = 0.5f - assertTrue(it is PolygonShape) } assertTrue(fixture.shape is PolygonShape) @@ -323,12 +314,12 @@ class BodiesTest : Box2DTest() { } @Test + @Ignore("ChainShape is broken in LibGDX 1.9.7.") fun `should construct Fixture with a ChainShape`() { val body = createBody() val fixture = body.chain(vertices = floatArrayOf(1f, 1f, 2f, 2f, 1f, 2f)) { density = 0.5f - assertTrue(it is ChainShape) } assertTrue(fixture.shape is ChainShape) @@ -342,12 +333,12 @@ class BodiesTest : Box2DTest() { } @Test + @Ignore("ChainShape is broken in LibGDX 1.9.7.") fun `should construct Fixture with a ChainShape with Vector2 Points`() { val body = createBody() val fixture = body.chain(vertices = *arrayOf(Vector2(1f, 1f), Vector2(2f, 2f), Vector2(1f, 2f))) { density = 0.5f - assertTrue(it is ChainShape) } assertTrue(fixture.shape is ChainShape) @@ -361,12 +352,12 @@ class BodiesTest : Box2DTest() { } @Test + @Ignore("ChainShape is broken in LibGDX 1.9.7.") fun `should construct Fixture with a looped ChainShape`() { val body = createBody() val fixture = body.loop(vertices = floatArrayOf(1f, 1f, 2f, 2f, 1f, 2f)) { density = 0.5f - assertTrue(it is ChainShape) } assertTrue(fixture.shape is ChainShape) @@ -380,12 +371,12 @@ class BodiesTest : Box2DTest() { } @Test + @Ignore("ChainShape is broken in LibGDX 1.9.7.") fun `should construct Fixture with a looped ChainShape with Vector2 Points`() { val body = createBody() val fixture = body.loop(vertices = *arrayOf(Vector2(1f, 1f), Vector2(2f, 2f), Vector2(1f, 2f))) { density = 0.5f - assertTrue(it is ChainShape) } assertTrue(fixture.shape is ChainShape) @@ -404,7 +395,6 @@ class BodiesTest : Box2DTest() { val fixture = body.edge(from = Vector2(1f, 1f), to = Vector2(2f, 2f)) { density = 0.5f - assertTrue(it is EdgeShape) } assertTrue(fixture.shape is EdgeShape) @@ -422,7 +412,6 @@ class BodiesTest : Box2DTest() { val fixture = body.edge(fromX = 1f, fromY = 2f, toX = 3f, toY = 4f) { density = 0.5f - assertTrue(it is EdgeShape) } assertTrue(fixture.shape is EdgeShape) From fd84fcd8effb2aedbe911ad9d8ad13340f8270c7 Mon Sep 17 00:00:00 2001 From: MJ Date: Thu, 2 Nov 2017 19:42:45 +0100 Subject: [PATCH 06/11] Refactoring due to LibGDX 1.9.7 changes. #108 --- async/src/test/kotlin/ktx/async/utils.kt | 28 ++++++++++++------- scene2d/src/main/kotlin/ktx/scene2d/widget.kt | 4 +-- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/async/src/test/kotlin/ktx/async/utils.kt b/async/src/test/kotlin/ktx/async/utils.kt index f8f9cf3c..f8c05bc1 100644 --- a/async/src/test/kotlin/ktx/async/utils.kt +++ b/async/src/test/kotlin/ktx/async/utils.kt @@ -50,6 +50,8 @@ fun `with timer`( scheduler.schedule(task, (delay * 1000f).toLong(), MILLISECONDS) }, test: (Timer) -> Unit) { + // Tries to replace the default Timer instance used by LibGDX by our mock-up implementation. LibGDX is a pain to mock. + val timerClass = Timer::class.java val timer = mock { on(it.scheduleTask(any(), any())) doAnswer { it.getArgument(0).apply { @@ -57,17 +59,23 @@ fun `with timer`( } } } - Timer::class.java.getDeclaredField("instance").let { - it.isAccessible = true - it.set(null, timer) + timerClass.getDeclaredMethod("thread").apply { + isAccessible = true + invoke(null) } + val threadField = timerClass.getDeclaredField("thread").apply { + isAccessible = true + } + val thread = threadField.get(null) + val threadClass = thread.javaClass + val timerField = threadClass.getDeclaredField("instance").apply { + isAccessible = true + } + timerField.set(thread, timer) try { test(timer) } finally { - Timer::class.java.getDeclaredField("instance").let { - it.isAccessible = true - it.set(null, null) - } + timerField.set(thread, null) } } @@ -104,7 +112,7 @@ fun `coroutine test`( try { KtxAsync.coroutine(it) testStatuses[coroutine] = TestStatus.FINISHED - } catch(exception: Throwable) { + } catch (exception: Throwable) { error.set(exception) testStatuses[coroutine] = TestStatus.FAILED } @@ -165,9 +173,9 @@ fun `cancelled coroutine test`( try { KtxAsync.coroutine(it) testStatus.set(TestStatus.FINISHED) - } catch(exception: CancellationException) { + } catch (exception: CancellationException) { cancellationExceptionThrown = true - } catch(exception: Throwable) { + } catch (exception: Throwable) { error.set(exception) testStatus.set(TestStatus.FAILED) } diff --git a/scene2d/src/main/kotlin/ktx/scene2d/widget.kt b/scene2d/src/main/kotlin/ktx/scene2d/widget.kt index 6fdacd64..2b729562 100644 --- a/scene2d/src/main/kotlin/ktx/scene2d/widget.kt +++ b/scene2d/src/main/kotlin/ktx/scene2d/widget.kt @@ -360,8 +360,8 @@ class KNode(actor: Actor) : Node(actor), KTree { @Scene2dDsl class KScrollPane(skin: Skin, style: String) : ScrollPane(null, skin, style), KGroup { override fun addActor(actor: Actor?) { - if (this.widget != null) throw IllegalStateException("ScrollPane may store only a single child.") - this.widget = actor + this.actor == null || throw IllegalStateException("ScrollPane may store only a single child.") + this.actor = actor } } From 69ad7e2590a637e28a3b21df4d0818e076422a37 Mon Sep 17 00:00:00 2001 From: MJ Date: Thu, 2 Nov 2017 19:43:06 +0100 Subject: [PATCH 07/11] Updated LibGDX to 1.9.7. #108 --- README.md | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e5c1861b..0170d189 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [![Travis CI](https://travis-ci.org/libktx/ktx.svg?branch=master)](https://travis-ci.org/libktx/ktx) [![Maven Central](https://img.shields.io/maven-central/v/io.github.libktx/ktx-async.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.github.libktx%22) [![Kotlin](https://img.shields.io/badge/kotlin-1.1.4--3-orange.svg)](http://kotlinlang.org/) -[![LibGDX](https://img.shields.io/badge/libgdx-1.9.6-red.svg)](https://libgdx.badlogicgames.com/) +[![LibGDX](https://img.shields.io/badge/libgdx-1.9.7-red.svg)](https://libgdx.badlogicgames.com/) [![KTX](.github/ktx-logo.png "KTX")](http://libktx.github.io) diff --git a/gradle.properties b/gradle.properties index f579c546..b9228106 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ libGroup=io.github.libktx -gdxVersion=1.9.6 +gdxVersion=1.9.7 kotlinVersion=1.1.4-3 kotlinCoroutinesVersion=0.18 From 2cdfd79efb51e7dbfea2f6c1576859dfe6361c65 Mon Sep 17 00:00:00 2001 From: MJ Date: Thu, 2 Nov 2017 19:47:53 +0100 Subject: [PATCH 08/11] Updated Gradle 4.3. #108 --- CHANGELOG.md | 7 +++++-- gradle/wrapper/gradle-wrapper.jar | Bin 54708 -> 54727 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9bc2430..dbe1fbb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,11 @@ -#### 1.9.6-SNAPSHOT +#### 1.9.7-SNAPSHOT +- **[UPDATE]** Updated LibGDX to 1.9.7. - **[UPDATE]** Updated to Kotlin 1.1.4-3. - **[UPDATE]** Updated to Kotlin Coroutines 0.18. -- **[UPDATE]** Updated to Gradle 4.1. +- **[UPDATE]** Updated to Gradle 4.3. +- **[BUG]** (`ktx-box2d`) `ChainShape` does not work correctly in LibGDX 1.9.7, and hence is not supported in KTX. +This might break existing applications. #### 1.9.6-b7 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7a3265ee94c0ab25cf079ac8ccdf87f41d455d42..27768f1bbac3ce2d055b20d521f12da78d331e8e 100644 GIT binary patch delta 1862 zcmYL}X*ApU7sd%es1cMBJ1wE5C~B>eseK4Wi`3Ru>;|>fGOwt)+?vCH7sL zps~ijmN9g(r5(Fb{4;sc|2^k>&T~Ka-shh4eQ_HIEd2zQ^qZ{q?_`xTbR5`rgZ>F( zW=eHf9)BrCEtxIHRXh-$ z`!s%Xy2Bs7jv6$V@GMU-&0F6~!j9}&?O_{EaaHe$?l~56{Dpc1z4m3=?~!ZzXJ`92 znXa!cz?vVn)9^$i+7=$o^vOx&4_m*%P7bx6&PsQek= zPHkJ2f1;YrUsmO(>3WeIPpceCDp4f1spXAfwn2@YB}P)HymCwb%uUw9=4!LRKKOOG z<}AlNaW}7{`m;p_1#g5VJKmqzflr4B~$+xm<^cG%>OgH)0H6=T-dNlt*xT~Xq zCwTzkpjssQ=Gq8Xq*)ixQ(fh6x!ELjSflFO>eVQG>dY*P#7z+0Z+KU9xYlyDJEvgk zy8aMX0_*L+odaFEU9amHtla61a=>~zXUg5>Xi(CEKBpELIX$bb19t`we8k1Qcod__ zLZ}=Z>(Mf;u@l?2su{4@U3oN6ICP#;+#+&!r@GvKRW# zV}=N)MwA`ml9fh)@%U!I4(2E*T+7RDt4hL-&oumc3KNpL03+0peP_d*>4 zJi{64GkZlszOt3DB2FWOKVQ*H@eY@efPeA#%}C}^k4i|JqvAJJO35@iM~s>aNqlSS z8|2nht(95v%H!74xLcpR_0~nUR>i_>5qvDyzTe;8D5aUFcph=O_#7Ga(ITzOHqxzz zmIddCq>Oce#gS)TgOUPF6~!la1`%y(&rVWc3YzAp zTfa*E^KD+66IxmXY+11RUBPsdBI@9rYC^u+y4B^^eUlBHRddya>}u7uc3h@2h<0|A zr>&xL$@SYFn@`>GpU__4s069?HU^km&ZDy_0K5~Dpfk@Z%aJytRE?91+g4Ds(-d_pD5l11a!*y7Q|YUV z5jGAxYbf>lTa>TvK9^zqAa!1O_e*j2?esNRMNpjD%AF+m& z^_n-Bj6D!iIqR4k1Wdc0fZ3DMDgrnVF*1JrZqoXO4y%q+qWe1$S>q}ZmFTP$%lWDd zs<;lDaQRc4)_#a%2!`0ljSLAYXqyRm7ZQ|3V14mwoXD5f*-?Uvh{4+82t}{+uy!Fj zwj>4hQ}JoQGI!=U(+!7|@zb{1BSasYoxRC7Jsgm#Z>-vxu)i#Yr_oTDcYovsN0mm&rT&eBehu{F z=NVh@T-eOL=4Q+Nm&zHH6(#J(-`=w6E)iOLJ8~|`03H7HNtaQs$59x>BQSL>uNS;1 z4fg(c$={IoY(o!m)ima@=GRxDRH8XD&|LODbt z(xBewb+MipperIQa=&YKk>}(9!KHuWm(%;+MfY{n7e#^gG3nN5{~*&eQ-l&+T_7Uv z=bkx5?TP5{UwKAz`(@7edPT~u)begQUv;+rj^$6yQpSsBfAG;b^nSS3oBddy`3b}+ zu#ls<0J5IYyo6rzv9VBm$kjW4I!zI1A>|LEz0A8{d~&+Jki+Sk4`3VMfEGu{tkD`@ z>qeThumVNHu=?hZP)klWCZst#2YTQv9=J)iVqEz8Wbyz94nx}K zTwv^A#X~PJ{Rjx2QPjZ;(zhvqRtp%mJcYb;KLwC>F(Vb7Fad>^0I?--05_okl4%5f znv@1C8`&6!2OUtZAAU?H0QaN=h`9&g?9l~qLr|b$62?3Qj839K6(pdJBn8+{K}G)i aJ%0KSFZ~Jqf0(Y0f%vJbY&PWo;Qs(ksB^sl delta 1775 zcmVbznQ*=)eqSh4iL) z%q4IG^9kIZyW|G$FlzBc!5uEXJV6a7QTLjlmGAC2`gi z4@*W##(NTEtK{gGS(eZ>en-8l<|>YEt?>PK%Lk~Hwe0DTb0tR?kq|;+z8sTi@Bn$77Q(yH}u@7wX~#~g>l`~ zCf&$x644Re)SZ(OQt1GUF-No21w$Jin2`_}wF;Uj8Bb1BmKHR7TD%j$t-NZ?sJ1Tl zo-%5AX|?J7egRxiu2aXd88zZ8>g>Xv7h|k{uc41iLQj2gw!j0>ERPl)%&ys1)FEEf zoXJ%JZAcG!};HwQ|K^W?MpU&s21ypa}+a(s!M+qv^1(HK9xr)@j4A?gg>7rw2G5Tm4sm zR|rTi8Ct+3zB*xALBeJ?xA4R%)L*F0*ig8`YnrlTx`8Z$Pe;@L!t(h()uP)9_F=z&f=}?Nf&)VO44;eb7xXb-YeL^(A1}3A3ep&0 z;pc029d%z~RKZvHTERCWcHfICRfl|X;f|JfTvE)e;&xxmSUP(jnV!3Pjy(!r1rlPq zcWJTEb-fQd{J0e^!Wu8LH zJVV>uQ?x%pB=a-YJwddlk+Um*h)K9|a0ML_9%37XxWw~`iOesE46Zk>Kx{{XCiGn^$m{_=pNeFa)^L zP8=ojW0V!HRn2ifuU9FZpqFY^IqrnbIsxsmYmjq`D3tr$pj9X9yZ}{yCnMCohLfI? zYg`2gIg=HYcve%g!R-x(lv7U0nyw0ZxbBr2c(~;ST#A=|n zK%hfBo(o{^@B&FV-PFnYW=;;f_?kI6gHg}PpI*Y+Gjy`)UE{1?_j4#&u`Xl7EZ5|7 zq_fM|_#NWe?!IMgn$0GEH;Z?|DCr8x9?v%Q5WS7Iy{^eJw$uQgASJ<8#@NIz?t0mW zT`bUkc4Ckj9$}uZ5$0L`UB)?FCwb;@k-tJO1LOZ!Y3@<7R%$P=VO&TiA08o(p_c*cDm1*b3BIDJ}^=>x7b z9bLKcu-53IqU9O9u!_tMF};O2khDIFaT`vz^4s z2niy3$y$;H005bjaLr``nRSz4&m)ui%`pOnc9UVxBa=|hL;@RnlVQ&zlTgkDlfKS3 z0uOzYVb3Fz8qY-mQ$lVQ&zllad@0uzjrVb3FzWsDn>e$Xlc6_1la(kYW| zj~0{Q(h!sR&>8{=l9NHwDU)E55R-t?5R+cf8UhxTlR?rclWvs}li<=2lf=;)0uz^$ zLDDai57ICK_L-AG(rE(FoReYCBa_e4I|3)4lVQ&zlP}Xq0%f9;Vb3Cyo6|4?5Veyb z)FPAb(=Y+(lOWVt0`9+)9l$)39@P+&$J81E!oidA!8?;4)hYp%lS$Pw1WK#$ZIgf1 R76Imymenf;Kg0k4003uUWfcGb diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bf1b63c3..590f0e81 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip From bdd82231424350833d86d69ba37a102087250f00 Mon Sep 17 00:00:00 2001 From: MJ Date: Thu, 2 Nov 2017 19:53:47 +0100 Subject: [PATCH 09/11] Updated to Kotlin 1.1.51 and Kotlin Coroutines 0.19.3. #104 --- CHANGELOG.md | 4 ++-- README.md | 2 +- async/README.md | 2 +- gradle.properties | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbe1fbb5..8d6a66ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ #### 1.9.7-SNAPSHOT - **[UPDATE]** Updated LibGDX to 1.9.7. -- **[UPDATE]** Updated to Kotlin 1.1.4-3. -- **[UPDATE]** Updated to Kotlin Coroutines 0.18. +- **[UPDATE]** Updated to Kotlin 1.1.51. +- **[UPDATE]** Updated to Kotlin Coroutines 0.19.3. - **[UPDATE]** Updated to Gradle 4.3. - **[BUG]** (`ktx-box2d`) `ChainShape` does not work correctly in LibGDX 1.9.7, and hence is not supported in KTX. This might break existing applications. diff --git a/README.md b/README.md index 0170d189..d6f19272 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Travis CI](https://travis-ci.org/libktx/ktx.svg?branch=master)](https://travis-ci.org/libktx/ktx) [![Maven Central](https://img.shields.io/maven-central/v/io.github.libktx/ktx-async.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.github.libktx%22) -[![Kotlin](https://img.shields.io/badge/kotlin-1.1.4--3-orange.svg)](http://kotlinlang.org/) +[![Kotlin](https://img.shields.io/badge/kotlin-1.1.51-orange.svg)](http://kotlinlang.org/) [![LibGDX](https://img.shields.io/badge/libgdx-1.9.7-red.svg)](https://libgdx.badlogicgames.com/) [![KTX](.github/ktx-logo.png "KTX")](http://libktx.github.io) diff --git a/async/README.md b/async/README.md index ecac6425..4bb5df26 100644 --- a/async/README.md +++ b/async/README.md @@ -1,4 +1,4 @@ -[![Kotlin](https://img.shields.io/badge/kotlin--coroutines-0.18-orange.svg)](http://kotlinlang.org/) +[![Kotlin](https://img.shields.io/badge/kotlin--coroutines-0.19.3-orange.svg)](http://kotlinlang.org/) # KTX: coroutines support and threading utilities diff --git a/gradle.properties b/gradle.properties index b9228106..1def070b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ libGroup=io.github.libktx gdxVersion=1.9.7 -kotlinVersion=1.1.4-3 -kotlinCoroutinesVersion=0.18 +kotlinVersion=1.1.51 +kotlinCoroutinesVersion=0.19.3 ashleyVersion=1.7.3 visUiVersion=1.3.0 From 9ed6df94c36453577a024e00bfc37885e12c5ffa Mon Sep 17 00:00:00 2001 From: MJ Date: Thu, 2 Nov 2017 20:04:13 +0100 Subject: [PATCH 10/11] Changed version to 1.9.7-b1. #110 --- CHANGELOG.md | 2 +- version.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d6a66ec..f200881f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -#### 1.9.7-SNAPSHOT +#### 1.9.7-b1 - **[UPDATE]** Updated LibGDX to 1.9.7. - **[UPDATE]** Updated to Kotlin 1.1.51. diff --git a/version.txt b/version.txt index 51c785cd..4bb6b26e 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.9.6-SNAPSHOT +1.9.7-b1 From cb1ac07321933ccedc179950c7bb3f8dd8b86d5f Mon Sep 17 00:00:00 2001 From: MJ Date: Thu, 2 Nov 2017 20:07:11 +0100 Subject: [PATCH 11/11] Reverted ChainShape test settings. #108 --- box2d/src/test/kotlin/ktx/box2d/bodiesTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/box2d/src/test/kotlin/ktx/box2d/bodiesTest.kt b/box2d/src/test/kotlin/ktx/box2d/bodiesTest.kt index 3b302e0e..3185ea35 100644 --- a/box2d/src/test/kotlin/ktx/box2d/bodiesTest.kt +++ b/box2d/src/test/kotlin/ktx/box2d/bodiesTest.kt @@ -108,7 +108,7 @@ class BodiesTest : Box2DTest() { fun `should construct FixtureDef with a ChainShape`() { val bodyDefinition = BodyDefinition() - val fixtureDef = bodyDefinition.chain(vertices = floatArrayOf(1f, 1f, 2f, 2f, 1f, 2f, 2f, 1f)) { + val fixtureDef = bodyDefinition.chain(vertices = floatArrayOf(1f, 1f, 2f, 2f, 1f, 2f)) { density = 0.5f }