Skip to content

Commit

Permalink
Remove the generate-config task
Browse files Browse the repository at this point in the history
AFAIK we have never really promoted this, and it is far less functional
than the Dev UI config editor (especially given the number of properties
that we expose these days).
  • Loading branch information
stuartwdouglas committed Oct 6, 2021
1 parent 657ae29 commit e46de36
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 598 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.function.Function;
import java.util.stream.Collectors;

import org.eclipse.microprofile.config.spi.ConfigProviderResolver;
import org.jboss.logging.Logger;

import io.quarkus.bootstrap.BootstrapDebug;
Expand All @@ -34,23 +33,16 @@
import io.quarkus.bootstrap.app.QuarkusBootstrap;
import io.quarkus.bootstrap.classloading.ClassLoaderEventListener;
import io.quarkus.bootstrap.classloading.QuarkusClassLoader;
import io.quarkus.builder.BuildChain;
import io.quarkus.builder.BuildChainBuilder;
import io.quarkus.builder.BuildExecutionBuilder;
import io.quarkus.builder.BuildResult;
import io.quarkus.builder.item.BuildItem;
import io.quarkus.deployment.ExtensionLoader;
import io.quarkus.deployment.QuarkusAugmentor;
import io.quarkus.deployment.builditem.ApplicationClassNameBuildItem;
import io.quarkus.deployment.builditem.CuratedApplicationShutdownBuildItem;
import io.quarkus.deployment.builditem.GeneratedClassBuildItem;
import io.quarkus.deployment.builditem.GeneratedFileSystemResourceHandledBuildItem;
import io.quarkus.deployment.builditem.GeneratedResourceBuildItem;
import io.quarkus.deployment.builditem.LaunchModeBuildItem;
import io.quarkus.deployment.builditem.LiveReloadBuildItem;
import io.quarkus.deployment.builditem.MainClassBuildItem;
import io.quarkus.deployment.builditem.RawCommandLineArgumentsBuildItem;
import io.quarkus.deployment.builditem.ShutdownContextBuildItem;
import io.quarkus.deployment.builditem.TransformedClassesBuildItem;
import io.quarkus.deployment.pkg.builditem.ArtifactResultBuildItem;
import io.quarkus.deployment.pkg.builditem.BuildSystemTargetBuildItem;
Expand Down Expand Up @@ -292,70 +284,6 @@ public StartupActionImpl reloadExistingApplication(boolean hasStartedSuccessfull
return new StartupActionImpl(curatedApplication, result);
}

/**
* Runs a custom augmentation action, such as generating config.
*
* @param chainBuild A consumer that customises the build to select the output targets
* @param executionBuild A consumer that can see the initial build execution
* @return The build result
*/
public BuildResult runCustomAction(Consumer<BuildChainBuilder> chainBuild, Consumer<BuildExecutionBuilder> executionBuild) {
ProfileManager.setLaunchMode(launchMode);
QuarkusClassLoader classLoader = curatedApplication.getAugmentClassLoader();

ClassLoader old = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(classLoader);

final BuildChainBuilder chainBuilder = BuildChain.builder();
chainBuilder.setClassLoader(classLoader);

ExtensionLoader.loadStepsFrom(classLoader, new Properties(),
curatedApplication.getApplicationModel(), launchMode, devModeType, null)
.accept(chainBuilder);
chainBuilder.loadProviders(classLoader);

for (Consumer<BuildChainBuilder> c : chainCustomizers) {
c.accept(chainBuilder);
}
chainBuilder
.addInitial(ShutdownContextBuildItem.class)
.addInitial(LaunchModeBuildItem.class)
.addInitial(CuratedApplicationShutdownBuildItem.class)
.addInitial(LiveReloadBuildItem.class)
.addInitial(RawCommandLineArgumentsBuildItem.class);
chainBuild.accept(chainBuilder);

BuildChain chain = chainBuilder
.build();
boolean auxiliaryApplication = curatedApplication.getQuarkusBootstrap().isAuxiliaryApplication();
BuildExecutionBuilder execBuilder = chain.createExecutionBuilder("main")
.produce(new LaunchModeBuildItem(launchMode,
devModeType == null ? Optional.empty() : Optional.of(devModeType),
auxiliaryApplication,
Optional.ofNullable(curatedApplication.getQuarkusBootstrap().isHostApplicationIsTestOnly()
? DevModeType.TEST_ONLY
: (auxiliaryApplication ? DevModeType.LOCAL : null)),
curatedApplication.getQuarkusBootstrap().isTest()))
.produce(new ShutdownContextBuildItem())
.produce(new CuratedApplicationShutdownBuildItem(curatedApplication.getAugmentClassLoader(), true))
.produce(new RawCommandLineArgumentsBuildItem())
.produce(new LiveReloadBuildItem());
executionBuild.accept(execBuilder);
return execBuilder
.execute();
} catch (Exception e) {
throw new RuntimeException("Failed to run task", e);
} finally {
try {
ConfigProviderResolver.instance().releaseConfig(ConfigProviderResolver.instance().getConfig(classLoader));
} catch (Exception ignore) {

}
Thread.currentThread().setContextClassLoader(old);
}
}

private BuildResult runAugment(boolean firstRun, Set<String> changedResources,
ClassChangeInformation classChangeInformation, ClassLoader deploymentClassLoader,
Class<? extends BuildItem>... finalOutputs) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import io.quarkus.gradle.tasks.QuarkusBuild;
import io.quarkus.gradle.tasks.QuarkusDev;
import io.quarkus.gradle.tasks.QuarkusGenerateCode;
import io.quarkus.gradle.tasks.QuarkusGenerateConfig;
import io.quarkus.gradle.tasks.QuarkusListCategories;
import io.quarkus.gradle.tasks.QuarkusListExtensions;
import io.quarkus.gradle.tasks.QuarkusListPlatforms;
Expand All @@ -64,7 +63,6 @@ public class QuarkusPlugin implements Plugin<Project> {
public static final String QUARKUS_GENERATE_CODE_TASK_NAME = "quarkusGenerateCode";
public static final String QUARKUS_GENERATE_CODE_TESTS_TASK_NAME = "quarkusGenerateCodeTests";
public static final String QUARKUS_BUILD_TASK_NAME = "quarkusBuild";
public static final String GENERATE_CONFIG_TASK_NAME = "generateConfig";
public static final String QUARKUS_DEV_TASK_NAME = "quarkusDev";
public static final String QUARKUS_REMOTE_DEV_TASK_NAME = "quarkusRemoteDev";
public static final String QUARKUS_TEST_TASK_NAME = "quarkusTest";
Expand Down Expand Up @@ -107,7 +105,6 @@ private void registerTasks(Project project, QuarkusPluginExtension quarkusExt) {
tasks.create(LIST_PLATFORMS_TASK_NAME, QuarkusListPlatforms.class);
tasks.create(ADD_EXTENSION_TASK_NAME, QuarkusAddExtension.class);
tasks.create(REMOVE_EXTENSION_TASK_NAME, QuarkusRemoveExtension.class);
tasks.create(GENERATE_CONFIG_TASK_NAME, QuarkusGenerateConfig.class);

QuarkusGenerateCode quarkusGenerateCode = tasks.create(QUARKUS_GENERATE_CODE_TASK_NAME, QuarkusGenerateCode.class);
QuarkusGenerateCode quarkusGenerateCodeTests = tasks.create(QUARKUS_GENERATE_CODE_TESTS_TASK_NAME,
Expand Down

This file was deleted.

Loading

0 comments on commit e46de36

Please sign in to comment.