Skip to content

Commit

Permalink
Merge pull request #190 from grails/springloaded
Browse files Browse the repository at this point in the history
Hide Springloaded plugin and show FeaturePredicate warnings to UI
  • Loading branch information
puneetbehl authored Aug 3, 2023
2 parents 3e139c5 + 7bd58f6 commit bca0dbd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Set<Feature> getFinalFeatures(ConsoleOutput consoleOutput) {
return features.stream().filter(feature -> {
for (FeaturePredicate predicate: exclusions) {
if (predicate.test(feature)) {
predicate.getWarning().ifPresent(consoleOutput::warning);
predicate.getWarning().ifPresent(message -> { throw new IllegalArgumentException(message); });
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package org.grails.forge.feature.reloading;

import jakarta.inject.Singleton;
import org.grails.forge.application.ApplicationType;
import org.grails.forge.application.generator.GeneratorContext;
import org.grails.forge.feature.Feature;
import org.grails.forge.feature.FeatureContext;
Expand Down Expand Up @@ -45,6 +44,11 @@ public String getDescription() {
return "Adds support for class reloading with Spring Loaded";
}

@Override
public boolean isVisible() {
return false;
}

@Override
public void processSelectedFeatures(FeatureContext featureContext) {
int jdkVersion = featureContext.getJavaVersion().majorVersion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SpringBootDevToolsSpec extends ApplicationContextSpec implements CommandOu

void "test there can be only one of Reloading feature"() {
when:
getFeatures(beanContext.getBeansOfType(ReloadingFeature.class)*.name)
getFeatures(["spring-boot-devtools", "jrebel"])

then:
def ex = thrown(IllegalArgumentException)
Expand Down

0 comments on commit bca0dbd

Please sign in to comment.