Sitelet https://github.com/clojurephant/clojurephant/pull/179/files
Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions manual-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ dependencies {
implementation 'com.stuartsierra:component:1.1.0'
devImplementation 'com.stuartsierra:component.repl:0.2.0'

// cider
devImplementation 'cider:cider-nrepl:0.28.5'
devImplementation 'cider:piggieback:0.5.3'

// figwheel
devImplementation 'com.bhauman:figwheel-repl:0.2.18'
devImplementation 'ring:ring-jetty-adapter:1.9.5'
Expand All @@ -45,10 +41,6 @@ tasks.withType(Test) {
useJUnitPlatform()
}

tasks.named('clojureRepl') {
middleware = ['cider.nrepl/cider-middleware', 'cider.piggieback/wrap-cljs-repl']
}

clojure {
builds {
main {
Expand Down
6 changes: 6 additions & 0 deletions src/compatTest/clojure/dev/clojurephant/compat_test/repl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@
(is (= "0.28.2" (-> (send-repl client {:op "cider-version"}) :cider-version :version-string)))
(is (pr-str 7) (eval-repl client '(do (require 'basic-project.core) (basic-project/use-ns 4)))))))

(deftest cider-jack-in
(testing "nREPL dependencies can be jacked-in via command line"
(with-client [client "BasicClojureProjectTest" "--handler=cider.nrepl/cider-nrepl-handler" "-Pdev.clojurephant.jack-in.nrepl=nrepl:nrepl:0.9,cider:cider-nrepl:0.28.3"]
(is (= "0.28.3" (-> (send-repl client {:op "cider-version"}) :cider-version :version-string)))
(is (pr-str 7) (eval-repl client '(do (require 'basic-project.core) (basic-project/use-ns 4)))))))

(deftest task-dependencies-clj
(testing "No Clojure compiles happen when REPL is requested, but other languages are compiled"
(gradle/with-project "MixedJavaClojureTest"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
package dev.clojurephant.plugin.common.internal;


import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.plugins.JavaBasePlugin;
import org.gradle.api.tasks.SourceSetContainer;

public class ClojureCommonBasePlugin implements Plugin<Project> {
public static final String NREPL_JACK_IN_PROPERTY = "dev.clojurephant.jack-in.nrepl";

@Override
public void apply(Project project) {
project.getPluginManager().apply(JavaBasePlugin.class);
configureNreplDependencies(project);
}

public void configureNreplDependencies(Project project) {
Configuration nrepl = project.getConfigurations().create(ClojureCommonPlugin.NREPL_CONFIGURATION_NAME);
if (project.hasProperty(NREPL_JACK_IN_PROPERTY)) {
String[] jackInDeps = project.findProperty(NREPL_JACK_IN_PROPERTY).toString().split(",");
for (String jackInDep : jackInDeps) {
project.getLogger().lifecycle("Jacking {} into the {} configuration", jackInDep, ClojureCommonPlugin.NREPL_CONFIGURATION_NAME);
project.getDependencies().add(ClojureCommonPlugin.NREPL_CONFIGURATION_NAME, jackInDep);
}
} else {
project.getDependencies().add(ClojureCommonPlugin.NREPL_CONFIGURATION_NAME, "nrepl:nrepl:0.9.0");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ private void configureDev(Project project, SourceSetContainer sourceSets) {
SourceSet test = sourceSets.getByName(SourceSet.TEST_SOURCE_SET_NAME);
SourceSet dev = sourceSets.create(DEV_SOURCE_SET_NAME);

Configuration nrepl = project.getConfigurations().create(NREPL_CONFIGURATION_NAME);
project.getDependencies().add(NREPL_CONFIGURATION_NAME, "nrepl:nrepl:0.9.0");

Configuration nrepl = project.getConfigurations().getByName(NREPL_CONFIGURATION_NAME);
project.getConfigurations().getByName(dev.getCompileClasspathConfigurationName()).extendsFrom(nrepl);
project.getConfigurations().getByName(dev.getRuntimeClasspathConfigurationName()).extendsFrom(nrepl);

Expand Down