Skip to content
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
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
with:
distribution: 'zulu'
java-version: |
8
17
21
${{ matrix.java }}
Expand All @@ -38,4 +39,4 @@ jobs:
- name: Gradle build
run: ./gradlew --stacktrace build
env:
JDK_VERSION_FOR_TESTS: ${{ matrix.java }}
JDK_VERSION_FOR_TESTS: ${{ matrix.java }}
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,39 @@ Plugin providing Clojuresque with compatibility fixes for Gradle 8.x
# Quick Start

Refer to the [Gradle Plugin Portal](https://plugins.gradle.org/plugin/nebula.clojure) for instructions on how to apply the plugin.

# Selecting Clojure tests

Use `./gradlew clojureTest -Pclojuresque.test.vars=example.app-test/first-test`
to select test vars. Separate multiple vars with commas. The selector can also be
set in `gradle.properties` as `clojuresque.test.vars=example.app-test/first-test`;
`-P` overrides that value. An absent or empty selector runs all tests.

A project's own `ext.set('clojuresque.test.vars', 'example.app-test/first-test')`
takes precedence over `-P` and `gradle.properties`. It can be set after plugin
application, but must be set before `clojureTest` is realized. Later changes to
the extra do not affect the captured selection.

Explicit task configuration overrides the selector:

```groovy
tasks.named('clojureTest') {
tests.set(['example.app-test/second-test'])
}
```

`tests.set([])` runs all tests. Selection changes are tracked task inputs and
execute the newly selected tests. These rules apply to the default `junit = false`
runner; `junit = true` continues to run whole namespaces.

**Adoption requirement:** parent-only extra properties are no longer inherited as
selectors in either build mode. Move shared values to `gradle.properties` or `-P`,
or configure `tests`/the local extra in each participating project. Each project
must also apply the Clojure plugin, directly or through a local convention plugin.

The selector path is tested with strict configuration-cache validation in single,
sibling, and nested projects on Gradle 8.0 and the current wrapper (9.2.1), both
with and without Isolated Projects. Enabled uber-JAR configuration-cache issues
and overly broad documentation inputs remain unresolved. This coverage establishes
selector behavior only, without claiming whole-plugin isolation compatibility or
defining a new minimum supported Gradle/JDK version.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@ tasks.withType(Test).configureEach {
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
testLogging {
events "PASSED", "FAILED", "SKIPPED"
exceptionFormat 'full'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,13 @@ class ClojureBasePlugin implements Plugin<Project> {
dependsOn project.tasks.classes, project.configurations.testRuntimeClasspath
description = "Run Clojure tests in src/test."
group = JavaBasePlugin.VERIFICATION_GROUP
if (project.hasProperty("clojuresque.test.vars")) {
tests.set(project.property("clojuresque.test.vars").split(",").toList())
// Resolve during lazy task configuration so local extras retain their override timing.
def selectorProperty = "clojuresque.test.vars"
def localExtras = project.extensions.extraProperties
def selector = localExtras.has(selectorProperty) ? localExtras.get(selectorProperty) :
project.providers.gradleProperty(selectorProperty).orNull
if (selector != null) {
tests.set(selector.split(",").toList())
}
if (project.gradle.startParameter.taskNames.contains('--tests')) {
enabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ abstract class ClojureTest extends ClojureSourceTask {
@Optional
abstract Property<File> getJunitOutputDir()

@Internal
@Input
@Optional
abstract ListProperty<String> getTests()

private final ExecOperations execOperations
Expand Down
Loading
Loading