Skip to content

Commit

Permalink
Sonar cloud issues #199
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 committed Sep 13, 2024
1 parent e989a64 commit 7e8a7d2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import lombok.*;
import lombok.extern.slf4j.Slf4j;
import org.fugerit.java.core.lang.helpers.StringUtils;

import java.io.File;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.fugerit.java.core.io.StreamIO;
import org.fugerit.java.core.lang.helpers.ClassHelper;
import org.fugerit.java.core.lang.helpers.StringUtils;
import org.fugerit.java.core.util.PropsIO;
import org.fugerit.java.doc.project.facade.flavour.FlavourConfig;
import org.fugerit.java.doc.project.facade.flavour.ProcessEntry;

Expand All @@ -34,15 +35,9 @@ private FlavourFacade() {}

public static final String FLAVOUR_SPRINGBOOT_3 = "springboot-3";

private static final Properties FLAVOURS_DEFAULT_VERSION = SafeFunction.get( () -> {
Properties versions = new Properties();
versions.setProperty( FLAVOUR_QUARKUS_3, "3.14.3" );
versions.setProperty( FLAVOUR_QUARKUS_2, "2.16.12.Final" );
versions.setProperty( FLAVOUR_MICRONAUT_4, "4.6.2" );
versions.setProperty( FLAVOUR_SPRINGBOOT_3, "3.3.3" );
versions.setProperty( FLAVOUR_OPENLIBERTY, "20.0.0.9" );
return versions;
} );
private static final String VERSION_OPENLIBERTY = "20.0.0.9";

private static final Properties FLAVOURS_DEFAULT_VERSION = PropsIO.loadFromClassLoaderSafe( "config/flavour/flavour_versions_default.properties" );

public static final Set<String> SUPPORTED_FLAVOURS = Collections.unmodifiableSet(
new HashSet<>( Arrays.asList( FLAVOUR_VANILLA, FLAVOUR_QUARKUS_3, FLAVOUR_QUARKUS_2,
Expand Down Expand Up @@ -74,6 +69,10 @@ public static void checkFlavour( FlavourContext context, String actualFlavour )
log.info( "quarkus 2 is a legacy flavour, javaRelease %s will default to '11'", javaVersion );
}
log.info( "checkFlavour {} done", actualFlavour );
checkFlavourVersion( context, actualFlavour );
}

public static void checkFlavourVersion( FlavourContext context, String actualFlavour ) {
// additional flavour config
if ( StringUtils.isEmpty( context.getFlavourVersion() ) ) {
String flavourVersionDefault = FLAVOURS_DEFAULT_VERSION.getProperty( context.getFlavour() );
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# default flavour versions
quarkus-3=3.14.3
quarkus-2=2.16.12.Final
micronaut-4=4.6.2
springboot-3=3.3.3
openliberty=20.0.0.9
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public void testFlavourContext() {
FlavourFacade.checkFlavour( context, FlavourFacade.FLAVOUR_QUARKUS_2 );
FlavourFacade.checkFlavour( new FlavourContext( testFile, "group-id5", "artifact-id5", "3.0.0-SNAPSHOT", "11", "unsupported" ), FlavourFacade.FLAVOUR_QUARKUS_2 );
context.setFlavourVersion( "test" );
FlavourFacade.checkFlavourVersion( context, FlavourFacade.FLAVOUR_QUARKUS_2 );
Assert.assertEquals( "test", context.getFlavourVersion() );
}

Expand Down

0 comments on commit 7e8a7d2

Please sign in to comment.