Skip to content

Commit

Permalink
Refactored themes management (#1515)
Browse files Browse the repository at this point in the history
* Refactored themes management

* Removal of a copied thmede boostrap artifact

* Managed dependencies for tests with themed bootstrap artifact

* Re-introduced windup-bootstrap dependency to have proper build ordering

* Added 'furnace-manager' for running 'windup-tsmodelsgen-maven-plugin' in 'windup-web' project

* Excluded 'windup-config-api' transitive dependecy from 'test-util' artifact

* Dependencies for compiling the Windup maven plugin

* Excluded 'windup-rules-java-api' transitive dependecy from 'test-util' artifact

* Added 'test-util' dependency to 'windup-tooling-tests' artifact

* Added 'test-util' dependency to 'windup-ui-tests' artifact

* Excluded 'slf4j-api' transitive dependecy in 'test-util' artifact

* Fixed the issue with '--discoverPackages' in the CLI

* Enhanced some reporting rules to better work with themes

* Enriched CLI initial log entry

* Removed unused previous themed files

* Changed the CLI version shown in the About page

* Added 'furnace-manager-resolver-maven' dep for the Maven plugin
  • Loading branch information
mrizzi committed Oct 4, 2022
1 parent b521e03 commit 2bc507e
Show file tree
Hide file tree
Showing 62 changed files with 512 additions and 409 deletions.
19 changes: 17 additions & 2 deletions bom/pom.xml
Expand Up @@ -324,10 +324,25 @@
<version>${project.version}</version>
</dependency>

<!-- Windup Engine - Bootstrap -->
<!-- Windup Engine - Themed Bootstraps -->
<dependency>
<groupId>org.jboss.windup</groupId>
<artifactId>windup-bootstrap</artifactId>
<artifactId>windup-bootstrap-windup</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.windup</groupId>
<artifactId>windup-bootstrap-mtr</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.windup</groupId>
<artifactId>windup-bootstrap-mta</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.windup</groupId>
<artifactId>windup-bootstrap-tackle</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
10 changes: 0 additions & 10 deletions bootstrap/pom.xml
Expand Up @@ -154,16 +154,6 @@
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/filtered-resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Expand Up @@ -9,6 +9,7 @@

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
Expand Down Expand Up @@ -56,8 +57,8 @@
import org.jboss.windup.bootstrap.commands.windup.ToolingModeCommand;
import org.jboss.windup.bootstrap.commands.windup.UpdateRulesetsCommand;
import org.jboss.windup.bootstrap.listener.ContainerStatusListener;
import org.jboss.windup.bootstrap.listener.GreetingListener;
import org.jboss.windup.server.WindupServerProvider;
import org.jboss.windup.util.PathUtil;
import org.jboss.windup.util.Theme;
import org.jboss.windup.util.ThemeProvider;

Expand Down Expand Up @@ -207,15 +208,16 @@ public static String getVersion() {
}

public static String getVersionString() {
return "> " + ThemeProvider.getInstance().getTheme().getBrandNameLong() + " CLI, version " + getRuntimeAPIVersion() + ".";
Theme theme = ThemeProvider.getInstance().getTheme();
return String.format("> %s CLI %s (Windup Components %s) %s",
theme.getBrandName(),
theme.getCliVersion(),
theme.getComponentsVersion(),
theme.getBrandDocumentationUrl());
}

public static Version getRuntimeAPIVersion() {
String version = Bootstrap.class.getPackage().getImplementationVersion();
if (version != null) {
return SingleVersion.valueOf(version);
}
return EmptyVersion.getInstance();
return SingleVersion.valueOf(ThemeProvider.getInstance().getTheme().getComponentsVersion());
}

private static File getUserRulesDir() {
Expand Down Expand Up @@ -289,8 +291,6 @@ private void run(List<String> args) {
if (!executePhase(CommandPhase.PRE_EXECUTION, commands) || commands.isEmpty())
return;

furnace.addContainerLifecycleListener(new GreetingListener());

// Now see if there are any server SPIs that need to run
Imported<WindupServerProvider> serverProviders = furnace.getAddonRegistry().getServices(WindupServerProvider.class);
for (WindupServerProvider serverProvider : serverProviders) {
Expand Down
36 changes: 0 additions & 36 deletions bootstrap/src/main/java/org/jboss/windup/bootstrap/Theme.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 11 additions & 0 deletions bootstraps-themed/bootstrap-mta/pom.xml
@@ -0,0 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.windup</groupId>
<artifactId>windup-bootstraps-themed</artifactId>
<version>6.0.1-SNAPSHOT</version>
</parent>

<artifactId>windup-bootstrap-mta</artifactId>
<name>Windup - MTA Bootstrap module</name>
</project>
@@ -0,0 +1,8 @@
# We need duplicate this file and have it here as a Workaround for not being able
# to consume org.jboss.windup.util.* because of java.lang.NoClassDefFoundError in windup-distribution
# TODO: Fix this issue in https://issues.redhat.com/browse/WINDUP-3283 and then remove this block of code
distributionBrandName=Migration Toolkit for Applications by Red Hat (MTA)
distributionBrandNameAcronym=MTA
distributionBrandWebsiteUrl=https://developers.redhat.com/products/mta/overview/
distributionBrandDocumentationUrl=https://access.redhat.com/documentation/en-us/migration_toolkit_for_applications/
distributionBrandCliName=mta-cli
11 changes: 11 additions & 0 deletions bootstraps-themed/bootstrap-mtr/pom.xml
@@ -0,0 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.windup</groupId>
<artifactId>windup-bootstraps-themed</artifactId>
<version>6.0.1-SNAPSHOT</version>
</parent>

<artifactId>windup-bootstrap-mtr</artifactId>
<name>Windup - MTR Bootstrap module</name>
</project>
@@ -0,0 +1,8 @@
# We need duplicate this file and have it here as a Workaround for not being able
# to consume org.jboss.windup.util.* because of java.lang.NoClassDefFoundError in windup-distribution
# TODO: Fix this issue in https://issues.redhat.com/browse/WINDUP-3283 and then remove this block of code
distributionBrandName=Migration Toolkit for Runtimes by Red Hat (MTR)
distributionBrandNameAcronym=MTR
distributionBrandWebsiteUrl=https://developers.redhat.com/products/mtr/overview/
distributionBrandDocumentationUrl=https://access.redhat.com/documentation/en-us/migration_toolkit_for_runtimes/
distributionBrandCliName=mtr-cli
11 changes: 11 additions & 0 deletions bootstraps-themed/bootstrap-tackle/pom.xml
@@ -0,0 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.windup</groupId>
<artifactId>windup-bootstraps-themed</artifactId>
<version>6.0.1-SNAPSHOT</version>
</parent>

<artifactId>windup-bootstrap-tackle</artifactId>
<name>Windup - Tackle Bootstrap module</name>
</project>
@@ -0,0 +1,8 @@
# We need duplicate this file and have it here as a Workaround for not being able
# to consume org.jboss.windup.util.* because of java.lang.NoClassDefFoundError in windup-distribution
# TODO: Fix this issue in https://issues.redhat.com/browse/WINDUP-3283 and then remove this block of code
distributionBrandName=Tackle
distributionBrandNameAcronym=TACKLE
distributionBrandWebsiteUrl=https://github.com/konveyor/tackle2-addon-windup
distributionBrandDocumentationUrl=https://konveyor.github.io/tackle/
distributionBrandCliName=tackle-cli
11 changes: 11 additions & 0 deletions bootstraps-themed/bootstrap-windup/pom.xml
@@ -0,0 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.windup</groupId>
<artifactId>windup-bootstraps-themed</artifactId>
<version>6.0.1-SNAPSHOT</version>
</parent>

<artifactId>windup-bootstrap-windup</artifactId>
<name>Windup - Windup Bootstrap module</name>
</project>
@@ -1,7 +1,8 @@
# We need duplicate this file and have it here as a Workaround for not being able
# to consume org.jboss.windup.util.* because of java.lang.NoClassDefFoundError in windup-distribution
# TODO: Fix this issue in https://issues.redhat.com/browse/WINDUP-3283 and then remove this block of code
distributionBrandName=${distribution.brand.name}
distributionBrandNameAcronym=${distribution.brand.name-acronym}
distributionBrandDocumentationUrl=${distribution.brand.documentation.url}
distributionBrandCliName=${distribution.brand.cli-name}
distributionBrandName=Windup
distributionBrandNameAcronym=WINDUP
distributionBrandWebsiteUrl=https://windup.github.io/
distributionBrandDocumentationUrl=https://github.com/windup/windup
distributionBrandCliName=windup-cli

0 comments on commit 2bc507e

Please sign in to comment.