Skip to content

Conversation

@matrei
Copy link
Contributor

@matrei matrei commented Jun 23, 2025

Previously, webjars were marked as developmentOnly, which excluded them from integration tests.
By using testAndDevelopmentOnly, they are now available in both development and test environments.

Previously, `webjars` were marked as `developmentOnly`,
which excluded them from integration tests.
By using `testAndDevelopmentOnly`, they are now available
in both development and test environments.
@jamesfredley
Copy link
Contributor

This will need a few changes in GradleConfiguration to map the Scope to a GradleConfiguration.

Something like:

TEST_AND_DEVELOPMENT_ONLY("testAndDevelopmentOnly", 2),
if (scope.getPhases().contains(Phase.DEVELOPMENT_ONLY)) {
    if(scope == Scope.DEVELOPMENT_ONLY) {
        return Optional.of(GradleConfiguration.DEVELOPMENT_ONLY);
    }
    else {
        return Optional.of(GradleConfiguration.TEST_AND_DEVELOPMENT_ONLY);
    }
}

The failure is unrelated to this change:

* What went wrong:
Could not determine the dependencies of task ':bootWar'.
> Could not create task ':assetCompile'.
   > Could not set unknown property 'destinationDirectory' for task ':assetCompile' of type asset.pipeline.gradle.AssetCompile.

@jamesfredley
Copy link
Contributor

Also seeing the assetCompile error on: #596

Copy link
Contributor

@jamesfredley jamesfredley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks and works great.

@jamesfredley
Copy link
Contributor

jamesfredley commented Jun 24, 2025

Merging since we need part of this for #596

@jamesfredley jamesfredley merged commit c7ee76a into apache:7.0.x Jun 24, 2025
6 checks passed
@jdaugherty
Copy link
Contributor

I noticed that the tests are failing and this code exists in the asset pipeline: https://github.com/wondrify/asset-pipeline/blob/00db3ef6b137e7fab84b5b9f5a7d687fa844283f/asset-pipeline-gradle/src/main/groovy/asset/pipeline/gradle/AssetPipelinePlugin.groovy#L116

Doesn't that mean we should revert this change? Since the developmentOnly assets will be added to the test run classpath? @matrei @jamesfredley

@matrei
Copy link
Contributor Author

matrei commented Jun 24, 2025

Doesn't that mean we should revert this change? Since the developmentOnly assets will be added to the test run classpath?

No, this change puts the actual webjars on the testRuntimeClasspath, and they are also needed.

@jdaugherty
Copy link
Contributor

jdaugherty commented Jun 24, 2025

But according to that link, the testRuntimeClasspath extends the development runtimeOnly. It looks like this is now broken for dev too because of wondrify/asset-pipeline#380

@matrei
Copy link
Contributor Author

matrei commented Jun 24, 2025

But according to that link, the testRuntimeClasspath extends the development runtimeOnly. It looks like this is now broken for dev too because of wondrify/asset-pipeline#380

I think testRuntimeOnly extends an asset-pipeline custom configuration named assetDevelopmentRuntime. This is used to make asset-pipeline-gradle available when running bootRun, bootTestRun and on the testRuntimeOnly classpath.

@jdaugherty
Copy link
Contributor

I completely read that configuration wrong. Yes, this is the right change. thank you!

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.

3 participants