@Override
  protected void setUp() throws Exception {
    super.setUp();
    workspace = rootDirectory;

    ConfiguredRuleClassProvider ruleClassProvider = TestRuleClassProvider.getRuleClassProvider();
    PathPackageLocator pkgLocator = new PathPackageLocator(rootDirectory);
    final PackageFactory pkgFactory;
    BlazeDirectories directories = new BlazeDirectories(outputBase, outputBase, rootDirectory);
    pkgFactory = new PackageFactory(ruleClassProvider);
    AnalysisTestUtil.DummyWorkspaceStatusActionFactory workspaceStatusActionFactory =
        new AnalysisTestUtil.DummyWorkspaceStatusActionFactory(directories);
    skyframeExecutor =
        SequencedSkyframeExecutor.create(
            reporter,
            pkgFactory,
            new TimestampGranularityMonitor(BlazeClock.instance()),
            directories,
            workspaceStatusActionFactory,
            ruleClassProvider.getBuildInfoFactories(),
            ImmutableSet.<Path>of(),
            ImmutableList.<DiffAwareness.Factory>of(),
            Predicates.<PathFragment>alwaysFalse(),
            Preprocessor.Factory.Supplier.NullSupplier.INSTANCE,
            ImmutableMap.<SkyFunctionName, SkyFunction>of(),
            ImmutableList.<PrecomputedValue.Injected>of(),
            ImmutableList.<SkyValueDirtinessChecker>of());

    skyframeExecutor.preparePackageLoading(
        pkgLocator,
        Options.getDefaults(PackageCacheOptions.class).defaultVisibility,
        true,
        7,
        ruleClassProvider.getDefaultsPackageContent(),
        UUID.randomUUID());

    AnalysisMock analysisMock = getAnalysisMock();
    analysisMock.setupMockClient(new MockToolsConfig(rootDirectory));
    analysisMock.setupMockWorkspaceFiles(directories.getEmbeddedBinariesRoot());
    configurationFactory = analysisMock.createConfigurationFactory();
    buildOptionClasses = analysisMock.getBuildOptions();
  }
Exemple #2
0
 private static void missingArg(String flag) {
   throw new IllegalArgumentException(
       flag + " is required:\n" + Options.getUsage(PlMergeOptions.class));
 }