FYI, patches attached to the ticket. This was a pretty shotgun approach of just putting everything in one commit, but I can break it apart if needed. The main thing at this point would be to identify whether the change to a PowerShell module approach is problematic or not. https://dev.clojure.org/jira/browse/TDEPS-67
I'll take a look at the issue @seancorfield posted now, and see if there are any other updates that need to be made from comparing the linux script.
An update has been pushed out to master on my ClojureTools repo and a new patch provided on the ticket. Will probably have some time this weekend to do some additional testing.
Just for a laugh, I tried to run one of our test suites from work via the PS version... and it passed! So that's using CLJ_CONFIG
, and a mixture of artifacts from Maven, Clojars, and GitHub. Very nice @ajoberstar!
And then I started REBL from PS, with a Socket REPL open, and from WSL was able to rlwrap telnet 127.0.0.1 50505
and happily submit forms and values to REBL over my socket connection 🙂
So that tests local deps as well (both REBL as a local JAR and our dev
subproject as a relative local path). I'll continue to bash on it a bit more but that looks very promising.
nice! I am swamped today but hopefully I can look at it tomorrow
I don't know what "The main thing at this point would be to identify whether the change to a PowerShell module approach is problematic or not." means so hard for me to assess.
what are the tradeoffs?
I don't know much about PowerShell modules, but I assume one issue is that you need to Import-Module ClojureTools
prior to using clj
?
Also it's installed in a slightly unusual (to me) place: C:\Users\tim\Documents\WindowsPowerShell\Modules
. Presumably that could be handled by an installer though.
...and I assume this would only be available in PowerShell, not cmd.exe
(which I think is fine, personally, but other people may have different opinions)
I'm also not sure if there are implications on IDE integration, like if clojure
is a PowerShell module I'm not certain whether IntelliJ on Windows can invoke it in the same way that it might invoke a clojure.bat
file.
@timgilbert The install location "depends". On my laptop, it was in one place. On my desktop, it was another. Also, I needed to change the default security setting on my desktop in order to run the import, but not on my laptop. Good question about Windows programs that want to shell out to run clojure
!
From a quick perusal of StackOverflow, it looks like an editor could invoke powershell.exe args
, possibly one could do something like powershell.exe Import-Module ClojureTools && clojure -A:foo ...
(or whatever the PS syntax is for that)
might be worth getting input from @cfleming
@timgilbert The install location just needs to be anywhere on your module path. The Documents one is the standard per-user directory. There are locations under Program Files for system wide install. If it's in the module path, no Import-Module is needed
But yeah, the main drawback is use from command prompt has the extra hoop of calling PowerShell.exe.
Install location is also transparent if using Install-Module to grab from the PowerShell Gallery. Though Chocolatey or any other installer could copy it to the system modules directory without much trouble.
is this the kind of thing you could paper over with a .bat?
or is that just gross?
I'm no expert, but I don't see why a .bat file couldn't just invoke powershell.exe clojure @args
or what have you
You get a bunch of weird flashy stuff showing up in the cmd
window as PowerShell searches for the commands but, yeah, the following works in cmd
and should work in .bat
:
X:\workspace\wsmain\clojure\lowlevel>powershell.exe $env:CLJ_CONFIG='..\versions' ; clojure -A:defaults:test-deps:test:runner
Running tests in #{"test"}
...
Ran 37 tests containing 118 assertions.
0 failures, 0 errors.
X:\workspace\wsmain\clojure\lowlevel>
"weird flashy stuff"