@Test public void install_zip_after_dot_net_core_support_by_providing_version_dot_net_core() throws Exception { File toDir = temp.newFolder(); URL zip = ScannerForMSBuildInstallerTest.class.getResource("/com/sonar/orchestrator/build/ScannerForMSBuildInstallerTest/sonar-scanner-msbuild-4.2.0.1214-netcoreapp2.0.zip"); when(locators.locate(any())).thenReturn(new File(zip.toURI())); File script = installer.install(Version.create("4.2.0.1214"), null, toDir, true); assertThat(script).isFile().exists(); assertThat(script.getName()).contains("SonarScanner.MSBuild.dll"); assertThat(script.getParentFile()).hasName("sonar-scanner-msbuild-4.2.0.1214" + "-" + ScannerForMSBuildInstaller.NETCOREAPP_2_0); }
public File install(@Nullable Version scannerVersion, @Nullable Location location, File toDir, boolean useDotNetCore) { if (location != null) { return installFromLocation(location, toDir, useDotNetCore); } else if (scannerVersion != null) { return install(scannerVersion, toDir, useDotNetCore); } else { return install(Version.create(DEFAULT_SCANNER_VERSION), toDir, useDotNetCore); } }
ScannerForMSBuildInstaller { public File install(@Nullable Version scannerVersion, @Nullable Location location, File toDir, boolean useDotNetCore) { if (location != null) { return installFromLocation(location, toDir, useDotNetCore); } else if (scannerVersion != null) { return install(scannerVersion, toDir, useDotNetCore); } else { return install(Version.create(DEFAULT_SCANNER_VERSION), toDir, useDotNetCore); } } }
ScannerForMSBuildInstaller { public File install(@Nullable Version scannerVersion, @Nullable Location location, File toDir, boolean useDotNetCore) { if (location != null) { return installFromLocation(location, toDir, useDotNetCore); } else if (scannerVersion != null) { return install(scannerVersion, toDir, useDotNetCore); } else { return install(Version.create(DEFAULT_SCANNER_VERSION), toDir, useDotNetCore); } } ScannerForMSBuildInstaller(Locators locators); }
ScannerForMSBuildInstaller { public File install(@Nullable Version scannerVersion, @Nullable Location location, File toDir, boolean useDotNetCore) { if (location != null) { return installFromLocation(location, toDir, useDotNetCore); } else if (scannerVersion != null) { return install(scannerVersion, toDir, useDotNetCore); } else { return install(Version.create(DEFAULT_SCANNER_VERSION), toDir, useDotNetCore); } } ScannerForMSBuildInstaller(Locators locators); File install(@Nullable Version scannerVersion, @Nullable Location location, File toDir, boolean useDotNetCore); }
ScannerForMSBuildInstaller { public File install(@Nullable Version scannerVersion, @Nullable Location location, File toDir, boolean useDotNetCore) { if (location != null) { return installFromLocation(location, toDir, useDotNetCore); } else if (scannerVersion != null) { return install(scannerVersion, toDir, useDotNetCore); } else { return install(Version.create(DEFAULT_SCANNER_VERSION), toDir, useDotNetCore); } } ScannerForMSBuildInstaller(Locators locators); File install(@Nullable Version scannerVersion, @Nullable Location location, File toDir, boolean useDotNetCore); static final String DEFAULT_SCANNER_VERSION; static final String NETCOREAPP_2_0; static final String NET_46; }