Fork me on GitHub
#cursive
<
2021-07-17
>
Yang Xu07:07:55

Does anyone have faced problem below with running deftest? 2021-07-17 15:29:56,100 [ 605392] ERROR - intellij.openapi.progress.Task - class cursive.runner.ClojureTestConfiguration$getRunProfileState$state$1 cannot be cast to class com.intellij.execution.configurations.RunConfigurationBase (cursive.runner.ClojureTestConfiguration$getRunProfileState$state$1 is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @38d3d3b0; com.intellij.execution.configurations.RunConfigurationBase is in unnamed module of loader com.intellij.util.lang.PathClassLoader @146ba0ac) java.lang.ClassCastException: class cursive.runner.ClojureTestConfiguration$getRunProfileState$state$1 cannot be cast to class com.intellij.execution.configurations.RunConfigurationBase (cursive.runner.ClojureTestConfiguration$getRunProfileState$state$1 is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @38d3d3b0; com.intellij.execution.configurations.RunConfigurationBase is in unnamed module of loader com.intellij.util.lang.PathClassLoader @146ba0ac) at cursive.testing$create_test_script.invokeStatic(testing.clj:18) at cursive.testing$create_test_script.invoke(testing.clj:18) at clojure.lang.Var.invoke(Var.java:393) at cursive.api.DelayedFn.invoke(DelayedFn.java:41) at cursive.runner.ClojureTestConfiguration$getRunProfileState$state$1.createDeferredParameters(ClojureTestRunner.kt:193) at cursive.runner.DeferredCommandLineState.cacheDeferredParameters(Deferred.kt:72) at cursive.runner.AbstractDeferredRunner$execute$1.run(Deferred.kt:104) at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:998) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:497) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:228) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:228) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665) at java.base/java.lang.Thread.run(Thread.java:829) 2021-07-17 15:29:56,100 [ 605392] ERROR - intellij.openapi.progress.Task - IntelliJ IDEA 2021.1.3 Build #IU-211.7628.21 2021-07-17 15:29:56,100 [ 605392] ERROR - intellij.openapi.progress.Task - JDK: 11.0.11; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o. 2021-07-17 15:29:56,100 [ 605392] ERROR - intellij.openapi.progress.Task - OS: Mac OS X 2021-07-17 15:29:56,101 [ 605393] ERROR - intellij.openapi.progress.Task - Plugin to blame: Cursive version: 1.10.2-2021.1 2021-07-17 15:30:26,862 [ 636154] INFO - .deployment.AsyncDevicesGetter - adb not found

Eddie19:07:51

I know tools.build is new, but I’m curious if anyone who has been playing with it has a workaround for “File build.clj is not under a source root” when including a build.clj file in the project root (and thus not specified as being on the classpath by the deps.edn).

cfleming21:07:02

Hmm, I can’t think of a good one, sorry. I’m going to look at tools.build soon though.

rutledgepaulv02:07:03

i made a builds directory and put my build.clj in there and used extra-paths in my deps.edn alias to include builds on the classpath for that alias. builds are still excluded in the actual jar since the jar task in the build.clj file only considers the src dir. example: https://github.com/RutledgePaulV/ring-compression/blob/master/deps.edn#L5-L9

rutledgepaulv02:07:23

(note that the originally stated problem is not only an issue for cursive, you also cannot invoke it from the CLI unless deps.edn includes a source path that contains the build.clj file)

Eddie19:07:30

@U5RCSJ6BB As far as I can tell with the projects I have been migrating, tools.build will look for a build.clj file in the root of the project even if the project root isn't explicitly declared as being on the class path in the deps.edn. I don't think the project root is put on the classpath by default (otherwise why would we need to add any source directories, right?). Also, I can't find any mention that the build file has to be on the classpath to run tools.build with -T. I believe the flow is actually the opposite. Tools.build will construct the basis for the classpaths required for compilation/assembly by reading your deps.edn. I'm still learning about this new tool, so I could be wrong.

rutledgepaulv20:07:50

i could definitely be wrong too 🙂 only played with it for a few minutes