Skip to content

Cleanup default classpaths for Clojure/ClojureScript and make them more configurable #173

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

Merged
merged 6 commits into from
Jul 30, 2022

Conversation

ajoberstar
Copy link
Member

@ajoberstar ajoberstar commented Jul 29, 2022

This removes the need to provide a separate source set for Clojure code
that the main source set depends on.

This may be related to #172, but doesn't test for Clojure depending on
Groovy/Kotlin/etc.

Related issues:

Contributor Checklist

  • Review Contributing Guidelines.
  • Commits contain discrete changes, messages include context about why the change was made and reference the relevant issues.
  • Commit messages should be prefixed with one of the following (these are used to determine the next version we release):
    • patch: if the change added no new functionality and is backwards compatible
    • minor: if the change added new functionality and is backwards compatible
    • major: if the change is not backwards compatible
    • chore: if the change doesn't affect plugin logic/behavior at all (and obviously still backwards compatible)
    • Any of these can optionally specify an area of the plugin they affected in parentheses (e.g. patch(clojurescript): )
      • build
      • docs
      • clojure
      • clojurescript
      • common
      • repl
  • Provide functional tests. (under clojurephant-plugin/src/compatTest)
  • Update documentation for user-facing changes. (under docs/)
  • Ensure all verification tasks pass locally. (./gradlew check)
  • Ensure CI builds pass on all Java versions. (watch the checks tab once the PR is opened)

TIP: If troubleshooting a CI failure, look for the build scan URL in the workflow run summary.

This removes the need to provide a separate source set for Clojure code
that the main source set depends on.

This may be related to #172, but doesn't test for Clojure depending on
Groovy/Kotlin/etc.
Porting the approach used to wire up the source from the Clojure
plugins. This is primarily for consistency, don't expect any
user-visible changes.
We need to ensure that the compile task was registered before we call
compiledBy on the SourceDirectorySet. This new ordering should be solid.
This was legacy from the way we generated templates. It could be
considered a breaking change for some if they relied on this, so should
document it if they still want it.
It seems I'm getting a wider exception in the Prepl input loop
sometimes, this AsynchronousCloseException instead of the
ClosedByInterrupteException (which is a subclass) we used to get and
were handling. This just caused some harmless, but confusing, stack
traces in the Gradle output. This change should help clean that up.
This removes special logic we had to disable Clojure tasks when the repl
was the only task requested at the command line. Instead, we're just
being more explicit about which stuff we put on the classpath, and avoid
having dependencies on any of the *classes tasks that pulled in all
language compile tasks.

The breaking change here is that compiled test Java classes will not be
on the classpath anymore, however that doesn't seem like a common need.

It will also be a little more fiddly to get other language classes on
the classpath, but won't be terrible.

This does revert b151ff1, so it will
require some other solution to allow you to get your ClojureScript
compiles on the classpath.

I think this involves outputting to build/tmp/clojureRepl, but need to
make that easier and let people get access to all of their build
configurations.
@ajoberstar ajoberstar changed the title minor(clojure): Allow Java code to depend on Clojure Cleanup default classpaths for Clojure/ClojureScript and make them more configurable Jul 29, 2022
@ajoberstar ajoberstar marked this pull request as ready for review July 30, 2022 00:16
@ajoberstar ajoberstar merged commit 9d5f4a2 into main Jul 30, 2022
@ajoberstar ajoberstar deleted the classpath branch July 30, 2022 00:16
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.

1 participant