本文整理汇总了Java中org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java StandaloneGlobalConfiguration类的具体用法?Java StandaloneGlobalConfiguration怎么用?Java StandaloneGlobalConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StandaloneGlobalConfiguration类属于org.sonarsource.sonarlint.core.client.api.standalone包,在下文中一共展示了StandaloneGlobalConfiguration类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cleanUpOld
import org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration; //导入依赖的package包/类
@Test
public void cleanUpOld() throws IOException {
long creationTime = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(100);
File workingDir = temp.newFolder();
for (int i = 0; i < 3; i++) {
File tmp = new File(workingDir, ".sonartmp_" + i);
tmp.mkdirs();
setFileCreationDate(tmp, creationTime);
}
tempFolderProvider.provide(StandaloneGlobalConfiguration.builder().setWorkDir(workingDir.toPath()).build());
// this also checks that all other temps were deleted
assertThat(getCreatedTempDir(workingDir)).exists();
FileUtils.deleteQuietly(workingDir);
}
示例2: createStandalone
import org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration; //导入依赖的package包/类
private static SonarLint createStandalone(boolean verbose) {
LOGGER.info("Standalone mode");
URL[] plugins;
try {
plugins = loadPlugins();
} catch (Exception e) {
throw new IllegalStateException("Error loading plugins", e);
}
StandaloneGlobalConfiguration config = StandaloneGlobalConfiguration.builder()
.addPlugins(plugins)
.setLogOutput(new DefaultLogOutput(LOGGER, verbose))
.build();
StandaloneSonarLintEngine engine = new StandaloneSonarLintEngineImpl(config);
return new StandaloneSonarLint(engine);
}
示例3: createTempFolderProps
import org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration; //导入依赖的package包/类
@Test
public void createTempFolderProps() throws Exception {
File workingDir = temp.newFolder();
TempFolder tempFolder = tempFolderProvider.provide(StandaloneGlobalConfiguration.builder().setWorkDir(workingDir.toPath()).build());
tempFolder.newDir();
tempFolder.newFile();
assertThat(getCreatedTempDir(workingDir)).exists();
assertThat(getCreatedTempDir(workingDir).list()).hasSize(2);
FileUtils.deleteQuietly(workingDir);
}
示例4: createTempFolderSonarHome
import org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration; //导入依赖的package包/类
@Test
public void createTempFolderSonarHome() throws Exception {
// with sonar home, it will be in {sonar.home}/.sonartmp
File sonarHome = temp.newFolder();
File workingDir = new File(sonarHome, StandaloneGlobalConfiguration.DEFAULT_WORK_DIR).getAbsoluteFile();
TempFolder tempFolder = tempFolderProvider.provide(StandaloneGlobalConfiguration.builder().setSonarLintUserHome(sonarHome.toPath()).build());
tempFolder.newDir();
tempFolder.newFile();
assertThat(getCreatedTempDir(workingDir)).exists();
assertThat(getCreatedTempDir(workingDir).list()).hasSize(2);
FileUtils.deleteQuietly(sonarHome);
}
示例5: prepare
import org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration; //导入依赖的package包/类
@BeforeClass
public static void prepare() throws Exception {
StandaloneGlobalConfiguration sonarLintConfig = StandaloneGlobalConfiguration.builder()
.addPlugin(FileLocation.byWildcardMavenFilename(new File("../../sonar-web-plugin/target"), "sonar-web-plugin-*.jar").getFile().toURI().toURL())
.setSonarLintUserHome(temp.newFolder().toPath())
.setLogOutput((formattedMessage, level) -> {
/* Don't pollute logs */ })
.build();
sonarlintEngine = new StandaloneSonarLintEngineImpl(sonarLintConfig);
baseDir = temp.newFolder();
}
示例6: create
import org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration; //导入依赖的package包/类
public static StandaloneGlobalContainer create(StandaloneGlobalConfiguration globalConfig) {
StandaloneGlobalContainer container = new StandaloneGlobalContainer();
container.add(globalConfig);
container.add(new StandalonePluginUrls(globalConfig.getPluginUrls()));
return container;
}
示例7: StandaloneSonarLintEngineImpl
import org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration; //导入依赖的package包/类
public StandaloneSonarLintEngineImpl(StandaloneGlobalConfiguration globalConfig) {
this.globalConfig = globalConfig;
this.logOutput = globalConfig.getLogOutput();
start();
}
示例8: setUp
import org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration; //导入依赖的package包/类
@Before
public void setUp() throws IOException {
userHome = temp.newFolder();
PluginCache fileCache = new PluginCacheProvider().provide(StandaloneGlobalConfiguration.builder().setSonarLintUserHome(userHome.toPath()).build());
underTest = new DefaultPluginJarExploder(fileCache);
}
示例9: setUp
import org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration; //导入依赖的package包/类
@Before
public void setUp() throws IOException {
engine = new StandaloneSonarLintEngineImpl(StandaloneGlobalConfiguration.builder().build());
sonarLint = new StandaloneSonarLint(engine);
}