當前位置: 首頁>>代碼示例>>Java>>正文


Java StandaloneGlobalConfiguration類代碼示例

本文整理匯總了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);
}
 
開發者ID:instalint-org,項目名稱:instalint,代碼行數:18,代碼來源:GlobalTempFolderProviderTest.java

示例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);
}
 
開發者ID:SonarSource,項目名稱:sonarlint-cli,代碼行數:19,代碼來源:SonarLintFactory.java

示例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);
}
 
開發者ID:instalint-org,項目名稱:instalint,代碼行數:13,代碼來源:GlobalTempFolderProviderTest.java

示例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);
}
 
開發者ID:instalint-org,項目名稱:instalint,代碼行數:15,代碼來源:GlobalTempFolderProviderTest.java

示例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();
}
 
開發者ID:SonarSource,項目名稱:sonar-web,代碼行數:12,代碼來源:SonarLintTest.java

示例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;
}
 
開發者ID:instalint-org,項目名稱:instalint,代碼行數:7,代碼來源:StandaloneGlobalContainer.java

示例7: StandaloneSonarLintEngineImpl

import org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration; //導入依賴的package包/類
public StandaloneSonarLintEngineImpl(StandaloneGlobalConfiguration globalConfig) {
  this.globalConfig = globalConfig;
  this.logOutput = globalConfig.getLogOutput();
  start();
}
 
開發者ID:instalint-org,項目名稱:instalint,代碼行數:6,代碼來源:StandaloneSonarLintEngineImpl.java

示例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);
}
 
開發者ID:instalint-org,項目名稱:instalint,代碼行數:7,代碼來源:DefaultPluginJarExploderTest.java

示例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);
}
 
開發者ID:SonarSource,項目名稱:sonarlint-cli,代碼行數:6,代碼來源:StandaloneSonarLintTest.java


注:本文中的org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。