use of io.quarkus.deployment.annotations.Produce in project quarkus by quarkusio.
the class TestTracingProcessor method startTesting.
@BuildStep(onlyIf = IsDevelopment.class)
@Produce(LogHandlerBuildItem.class)
@Produce(TestSetupBuildItem.class)
@Produce(ServiceStartBuildItem.class)
void startTesting(TestConfig config, LiveReloadBuildItem liveReloadBuildItem, LaunchModeBuildItem launchModeBuildItem, List<TestListenerBuildItem> testListenerBuildItems) {
if (TestSupport.instance().isEmpty() || config.continuousTesting == TestConfig.Mode.DISABLED || config.flatClassPath) {
return;
}
DevModeType devModeType = launchModeBuildItem.getDevModeType().orElse(null);
if (devModeType == null || !devModeType.isContinuousTestingSupported()) {
return;
}
if (testingSetup) {
return;
}
testingSetup = true;
TestSupport testSupport = TestSupport.instance().get();
for (TestListenerBuildItem i : testListenerBuildItems) {
testSupport.addListener(i.listener);
}
testSupport.setConfig(config);
testSupport.setTags(config.includeTags.orElse(Collections.emptyList()), config.excludeTags.orElse(Collections.emptyList()));
testSupport.setPatterns(config.includePattern.orElse(null), config.excludePattern.orElse(null));
testSupport.setEngines(config.includeEngines.orElse(Collections.emptyList()), config.excludeEngines.orElse(Collections.emptyList()));
testSupport.setConfiguredDisplayTestOutput(config.displayTestOutput);
testSupport.setTestType(config.type);
if (!liveReloadBuildItem.isLiveReload()) {
if (config.continuousTesting == TestConfig.Mode.ENABLED) {
testSupport.start();
} else if (config.continuousTesting == TestConfig.Mode.PAUSED) {
testSupport.stop();
}
}
QuarkusClassLoader cl = (QuarkusClassLoader) Thread.currentThread().getContextClassLoader();
((QuarkusClassLoader) cl.parent()).addCloseTask(ContinuousTestingSharedStateManager::reset);
}
use of io.quarkus.deployment.annotations.Produce in project quarkus by quarkusio.
the class DevConsoleProcessor method setupConsole.
@Produce(ServiceStartBuildItem.class)
@BuildStep()
void setupConsole(HttpRootPathBuildItem rp, NonApplicationRootPathBuildItem np, LaunchModeBuildItem launchModeBuildItem) {
if (launchModeBuildItem.getDevModeType().orElse(null) != DevModeType.LOCAL) {
return;
}
if (context == null) {
context = ConsoleStateManager.INSTANCE.createContext("HTTP");
}
Config c = ConfigProvider.getConfig();
String host = c.getOptionalValue("quarkus.http.host", String.class).orElse("localhost");
String port = c.getOptionalValue("quarkus.http.port", String.class).orElse("8080");
context.reset(new ConsoleCommand('w', "Open the application in a browser", null, () -> openBrowser(rp, np, "/", host, port)), new ConsoleCommand('d', "Open the Dev UI in a browser", null, () -> openBrowser(rp, np, "/q/dev", host, port)));
}
Aggregations