use of com.synopsys.integration.detect.workflow.ArtifactResolver in project synopsys-detect by blackducksoftware.
the class DetectBootFactory method createAirGapCreator.
public AirGapCreator createAirGapCreator(ConnectionDetails connectionDetails, DetectExecutableOptions detectExecutableOptions, Configuration freemarkerConfiguration, InstalledToolManager installedToolManager, InstalledToolLocator installedToolLocator) {
ConnectionFactory connectionFactory = new ConnectionFactory(connectionDetails);
ArtifactResolver artifactResolver = new ArtifactResolver(connectionFactory, gson);
ArtifactoryZipInstaller artifactoryZipInstaller = new ArtifactoryZipInstaller(artifactResolver);
DirectoryExecutableFinder directoryExecutableFinder = DirectoryExecutableFinder.forCurrentOperatingSystem(fileFinder);
SystemPathExecutableFinder systemPathExecutableFinder = new SystemPathExecutableFinder(directoryExecutableFinder);
DetectExecutableResolver detectExecutableResolver = new DetectExecutableResolver(directoryExecutableFinder, systemPathExecutableFinder, detectExecutableOptions);
DetectExecutableRunner runner = DetectExecutableRunner.newDebug(eventSystem);
GradleAirGapCreator gradleAirGapCreator = new GradleAirGapCreator(detectExecutableResolver, runner, freemarkerConfiguration);
NugetInspectorAirGapCreator nugetAirGapCreator = new NugetInspectorAirGapCreator(new ArtifactoryNugetInspectorInstaller(detectInfo, artifactoryZipInstaller, new NugetInspectorExecutableLocator(detectInfo)));
ProjectInspectorExecutableLocator projectInspectorExecutableLocator = new ProjectInspectorExecutableLocator(detectInfo);
ArtifactoryProjectInspectorInstaller projectInspectorInstaller = new ArtifactoryProjectInspectorInstaller(detectInfo, artifactoryZipInstaller, projectInspectorExecutableLocator);
ProjectInspectorAirGapCreator projectInspectorAirGapCreator = new ProjectInspectorAirGapCreator(projectInspectorInstaller);
DockerAirGapCreator dockerAirGapCreator = new DockerAirGapCreator(new DockerInspectorInstaller(artifactResolver));
DetectFontAirGapCreator detectFontAirGapCreator = new DetectFontAirGapCreator(new DetectFontInstaller(artifactResolver, installedToolManager, installedToolLocator));
return new AirGapCreator(new AirGapPathFinder(), eventSystem, gradleAirGapCreator, nugetAirGapCreator, dockerAirGapCreator, detectFontAirGapCreator, projectInspectorAirGapCreator);
}
use of com.synopsys.integration.detect.workflow.ArtifactResolver in project synopsys-detect by blackducksoftware.
the class FontLoaderTestIT method createTempDirectory.
@BeforeEach
public void createTempDirectory() throws Exception {
fontDirectory = Files.createTempDirectory("junit_test_font_loader").toFile();
PropertyConfiguration propertyConfiguration = new PropertyConfiguration(Collections.emptyList());
Gson gson = new Gson();
DetectConfigurationFactory detectConfigurationFactory = new DetectConfigurationFactory(new DetectPropertyConfiguration(propertyConfiguration, new SimplePathResolver()), gson);
ConnectionFactory connectionFactory = new ConnectionFactory(detectConfigurationFactory.createConnectionDetails());
ArtifactResolver artifactResolver = new ArtifactResolver(connectionFactory, gson);
InstalledToolManager installedToolManager = new InstalledToolManager();
InstalledToolLocator installedToolLocator = new InstalledToolLocator(Paths.get(""), new Gson());
DetectFontInstaller installer = new DetectFontInstaller(artifactResolver, installedToolManager, installedToolLocator);
DirectoryOptions directoryOptions = new DirectoryOptions(null, null, null, null, fontDirectory.toPath(), null);
DirectoryManager directoryManager = new DirectoryManager(directoryOptions, DetectRunId.createDefault());
detectFontLocator = new OnlineDetectFontLocator(installer, directoryManager);
}
use of com.synopsys.integration.detect.workflow.ArtifactResolver in project synopsys-detect by blackducksoftware.
the class SingletonFactory method createUtilitySingletons.
public UtilitySingletons createUtilitySingletons(EventSingletons eventSingletons) throws DetectUserFriendlyException {
ExternalIdFactory externalIdFactory = new ExternalIdFactory();
ConnectionDetails connectionDetails = detectConfigurationFactory.createConnectionDetails();
ConnectionFactory connectionFactory = new ConnectionFactory(connectionDetails);
ArtifactResolver artifactResolver = new ArtifactResolver(connectionFactory, gson);
ArtifactoryZipInstaller artifactoryZipInstaller = new ArtifactoryZipInstaller(artifactResolver);
AirGapPathFinder airGapPathFinder = new AirGapPathFinder();
BdioOptions bdioOptions = detectConfigurationFactory.createBdioOptions();
CodeLocationNameGenerator codeLocationNameGenerator = detectConfigurationFactory.createCodeLocationOverride().map(CodeLocationNameGenerator::withOverride).orElse(CodeLocationNameGenerator.withPrefixSuffix(bdioOptions.getProjectCodeLocationPrefix().orElse(null), bdioOptions.getProjectCodeLocationSuffix().orElse(null)));
CodeLocationNameManager codeLocationNameManager = new CodeLocationNameManager(codeLocationNameGenerator);
AirGapInspectorPaths airGapInspectorPaths = new AirGapInspectorPaths(airGapPathFinder);
DetectExecutableRunner executableRunner = DetectExecutableRunner.newDebug(eventSystem);
DirectoryExecutableFinder directoryExecutableFinder = DirectoryExecutableFinder.forCurrentOperatingSystem(fileFinder);
SystemPathExecutableFinder systemExecutableFinder = new SystemPathExecutableFinder(directoryExecutableFinder);
DetectExecutableResolver detectExecutableResolver = new DetectExecutableResolver(directoryExecutableFinder, systemExecutableFinder, detectConfigurationFactory.createDetectExecutableOptions());
OperationSystem operationSystem = new OperationSystem(eventSingletons.getStatusEventPublisher());
OperationWrapper operationWrapper = new OperationWrapper();
return new UtilitySingletons(externalIdFactory, connectionDetails, artifactResolver, codeLocationNameManager, airGapInspectorPaths, executableRunner, detectExecutableResolver, operationSystem, operationWrapper, artifactoryZipInstaller);
}
use of com.synopsys.integration.detect.workflow.ArtifactResolver in project synopsys-detect by blackducksoftware.
the class DetectFontInstallerTestIT method testFontInstall.
@Test
public void testFontInstall() throws Exception {
Gson gson = new Gson();
PropertyConfiguration propertyConfiguration = new PropertyConfiguration(Collections.emptyList());
DetectConfigurationFactory detectConfigurationFactory = new DetectConfigurationFactory(new DetectPropertyConfiguration(propertyConfiguration, new SimplePathResolver()), gson);
ConnectionFactory connectionFactory = new ConnectionFactory(detectConfigurationFactory.createConnectionDetails());
ArtifactResolver artifactResolver = new ArtifactResolver(connectionFactory, gson);
InstalledToolManager installedToolManager = new InstalledToolManager();
InstalledToolLocator installedToolLocator = new InstalledToolLocator(Paths.get(""), new Gson());
DetectFontInstaller installer = new DetectFontInstaller(artifactResolver, installedToolManager, installedToolLocator);
installer.installFonts(targetDirectory);
String[] fileList = targetDirectory.list();
assertNotNull(fileList);
assertTrue(fileList.length > 0);
}
Aggregations