Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

target kotlin 1.5.0 #70

Merged
merged 4 commits into from
May 20, 2021
Merged

Conversation

sphrak
Copy link
Contributor

@sphrak sphrak commented May 1, 2021

No description provided.

@dev-weiqi dev-weiqi marked this pull request as ready for review May 4, 2021 02:08
Copy link
Collaborator

@dev-weiqi dev-weiqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good To Me 🤩

"get${this.substringAfterLast(':').capitalize(Locale.ROOT)}"
else -> "get${this.capitalize(Locale.ROOT)}"
"get${this.substringAfterLast(':')
.replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString() }}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, and how about we wrap the following line into a function or extension? Since it was used in this file frequently?

replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.ROOT) else it.toString() }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ivanisidrowu should be fixed in latest commits let me know what you think.

btw how can I test this locally? I see no publishToMavenLocal in ./gradlew tasks 🤔

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, we don't have the Gradle task.
However, you can test them by running the local and instrumental tests via the project.

Tests should be found under these directories:
KtRssReader/android/src/androidTest
KtRssReader/android/src/test
KtRssReader/processorTest/src/androidTest
KtRssReader/processorTest/src/test

Click the button in the editor to run the tests.

Screen Shot 2021-05-07 at 7 06 12 PM

Copy link
Owner

@ivanisidrowu ivanisidrowu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks for updating the Kotlin version! :)

@sphrak sphrak requested a review from ivanisidrowu May 6, 2021 17:41
@sphrak sphrak changed the title prepare for kotlin 1.5.0-RC target kotlin 1.5.0 May 6, 2021
@@ -28,5 +29,5 @@ class KtRssReaderConfig {
var flushCache: Boolean = false

@ExperimentalTime
var expiredTimeMillis: Long = 1.days.toLongMilliseconds()
var expiredTimeMillis: Long = Duration.days(1).inWholeMilliseconds
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its from here the initially reported issue comes from #69 (comment)

@sphrak
Copy link
Contributor Author

sphrak commented May 6, 2021

I ran ./gradlew clean check but it fails with a similiar but now in turbine library:

Seems like we will have to wait till turbine is built against kotlin 1.5.0 and coroutines 1.5.0. Coroutines is not yet released and is still in RC.

java.lang.NoSuchMethodError: app.cash.turbine.FlowTurbineKt.test-9vOVOX0$default(Lkotlinx/coroutines/flow/Flow;JLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
	at tw.ktrssreader.KtRssReaderLocalTest$FlowReadTest$Get remote channel successfully$1$1.invokeSuspend(KtRssReaderLocalTest.kt:231)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at tw.ktrssreader.KtRssReaderLocalTest$FlowReadTest$Get remote channel successfully$1.invoke(KtRssReaderLocalTest.kt:228)
	at tw.ktrssreader.KtRssReaderLocalTest$FlowReadTest$Get remote channel successfully$1.invoke(KtRssReaderLocalTest.kt:227)
	at tw.ktrssreader.KtRssReaderLocalTest$ReaderTestBase.mockGetRemoteChannelSuccessfully(KtRssReaderLocalTest.kt:67)
	at tw.ktrssreader.KtRssReaderLocalTest$FlowReadTest.Get remote channel successfully(KtRssReaderLocalTest.kt:227)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:27)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:119)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
	at java.lang.Thread.run(Thread.java:748)
	```

@ivanisidrowu
Copy link
Owner

ivanisidrowu commented May 7, 2021

@sphrak

Interesting, it seems they have the same issue.
cashapp/turbine#36

I think maybe we can wait until they release the new version. Then, we can merge this PR.

@sphrak
Copy link
Contributor Author

sphrak commented May 15, 2021

@ivanisidrowu its out -- I bumped coroutines, turbine and room while at it.

But still I don't know if this solves the issue I originally mentioned as I cannot test this in my own app.

I think it would be a good idea to add the ./gradlew publishToMavenLocal task via https://docs.gradle.org/current/userguide/publishing_maven.html or https://www.jetbrains.com/help/space/publish-artifacts-from-a-gradle-project.html#publish-maven-artifacts-using-the-gradle-command-line-tool -- that way one can modify the code -- publish it locally and consume it in any other app to test it out before releasing 👍

@ivanisidrowu
Copy link
Owner

Hi @sphrak, sounds good, I will open a task to do it as an enhancement.

In the mean time, I think you might be able to test it with JitPack.
JitPack can build GitHub projects with branches or commits.
I triggered a build for you: https://jitpack.io/com/github/sphrak/KtRssReader/target-kotlin-1.5.0-37c2e4f89d-1/build.log
It's under the project you forked.

So you can just include these libs to test in your own app:

com.github.sphrak.KtRssReader:annotation:target-kotlin-1.5.0-37c2e4f89d-1
com.github.sphrak.KtRssReader:processor:target-kotlin-1.5.0-37c2e4f89d-1
com.github.sphrak.KtRssReader:kotlin:target-kotlin-1.5.0-37c2e4f89d-1
com.github.sphrak.KtRssReader:android:target-kotlin-1.5.0-37c2e4f89d-1

If you would like to test it by yourself, you can go to: https://jitpack.io/#sphrak/KtRssReader/target-kotlin-1.5.0-SNAPSHOT

Hope it helps.
Thanks!

Copy link
Owner

@ivanisidrowu ivanisidrowu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, it's ready to merge.

@ivanisidrowu ivanisidrowu merged commit e423d98 into ivanisidrowu:master May 20, 2021
@sphrak
Copy link
Contributor Author

sphrak commented May 21, 2021

@ivanisidrowu thank you very much 😺 I just tested the snapshot you published and I can no longer see the crash so I think you can release a stable version 👍 it works™

@ivanisidrowu
Copy link
Owner

@sphrak No problem! It's always great to see people are using our lib. :) I will release v2.1.2 today. If you have suggestions in the future, don't hesitate to let us know. Happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants