Search in sources :

Example 6 with BuildInvoker

use of com.google.idea.blaze.base.bazel.BuildSystem.BuildInvoker in project intellij by bazelbuild.

the class BuildPhaseSyncTask method doRun.

private void doRun(BlazeContext context) throws SyncFailedException, SyncCanceledException {
    List<TargetExpression> targets = Lists.newArrayList();
    ProjectViewSet viewSet = projectState.getProjectViewSet();
    if (syncParams.addWorkingSet() && projectState.getWorkingSet() != null) {
        Collection<TargetExpression> workingSetTargets = getWorkingSetTargets(context);
        if (!workingSetTargets.isEmpty()) {
            targets.addAll(workingSetTargets);
            printTargets(context, "working set", workingSetTargets);
        }
    }
    if (syncParams.addProjectViewTargets()) {
        ProjectTargets projectTargets = SyncProjectTargetsHelper.getProjectTargets(project, context, viewSet, projectState.getWorkspacePathResolver(), projectState.getLanguageSettings());
        if (!projectTargets.derivedTargets.isEmpty()) {
            buildStats.setTargetsDerivedFromDirectories(true);
            printTargets(context, "project view directories", projectTargets.derivedTargets);
        }
        if (!projectTargets.explicitTargets.isEmpty()) {
            printTargets(context, "project view targets", projectTargets.explicitTargets);
        }
        targets.addAll(projectTargets.getTargetsToSync());
    }
    if (!syncParams.sourceFilesToSync().isEmpty()) {
        Collection<TargetExpression> targetsFromSources = findTargetsBuildingSourceFiles(syncParams.sourceFilesToSync(), context);
        if (!targetsFromSources.isEmpty()) {
            targets.addAll(targetsFromSources);
            printTargets(context, syncParams.title() + " (targets derived from query)", targetsFromSources);
        }
    }
    if (!syncParams.targetExpressions().isEmpty()) {
        targets.addAll(syncParams.targetExpressions());
        printTargets(context, syncParams.title(), syncParams.targetExpressions());
    }
    buildStats.setTargets(targets);
    notifyBuildStarted(context, syncParams.addProjectViewTargets(), ImmutableList.copyOf(targets));
    BuildInvoker localInvoker = buildSystem.getBuildInvoker(project, context);
    ShardedTargetsResult shardedTargetsResult = BlazeBuildTargetSharder.expandAndShardTargets(project, context, workspaceRoot, viewSet, projectState.getWorkspacePathResolver(), targets, localInvoker, buildSystem.getSyncStrategy(project));
    if (shardedTargetsResult.buildResult.status == BuildResult.Status.FATAL_ERROR) {
        throw new SyncFailedException();
    }
    ShardedTargetList shardedTargets = shardedTargetsResult.shardedTargets;
    boolean parallel;
    SyncStrategy strategy = buildSystem.getSyncStrategy(project);
    switch(strategy) {
        case PARALLEL:
            parallel = true;
            break;
        case DECIDE_AUTOMATICALLY:
            parallel = shardedTargets.shardCount() > 1;
            break;
        case SERIAL:
            parallel = false;
            break;
        default:
            throw new IllegalStateException("Invalid sync strategy: " + strategy);
    }
    if (!shardedTargetsResult.shardedTargets.shardStats().shardingApproach().equals(ShardingApproach.PARTITION_WITHOUT_EXPANDING)) {
        int targetCount = shardedTargets.shardStats().actualTargetSizePerShard().stream().mapToInt(Integer::intValue).sum();
        printShardingSummary(context, targetCount, shardedTargets.shardCount(), parallel);
    }
    BuildInvoker syncBuildInvoker = null;
    if (parallel) {
        syncBuildInvoker = buildSystem.getParallelBuildInvoker(project, context).orElse(null);
    }
    if (syncBuildInvoker == null) {
        syncBuildInvoker = localInvoker;
    }
    resultBuilder.setBlazeInfo(syncBuildInvoker.getBlazeInfo());
    buildStats.setSyncSharded(shardedTargets.shardCount() > 1).setShardCount(shardedTargets.shardCount()).setShardStats(shardedTargets.shardStats()).setParallelBuilds(syncBuildInvoker.supportsParallelism());
    BlazeBuildOutputs blazeBuildResult = getBlazeBuildResult(context, viewSet, shardedTargets, syncBuildInvoker);
    resultBuilder.setBuildResult(blazeBuildResult);
    buildStats.setBuildResult(blazeBuildResult.buildResult).setBuildIds(blazeBuildResult.buildIds).setBuildBinaryType(syncBuildInvoker.getType()).setBepBytesConsumed(blazeBuildResult.bepBytesConsumed);
    if (context.isCancelled()) {
        throw new SyncCanceledException();
    }
    String invocationResultMsg = "Build invocation result: " + blazeBuildResult.buildResult.status;
    if (blazeBuildResult.buildResult.status == BuildResult.Status.FATAL_ERROR) {
        context.setHasError();
        if (blazeBuildResult.buildResult.outOfMemory()) {
            SuggestBuildShardingNotification.syncOutOfMemoryError(project, context);
        }
        context.output(PrintOutput.error(invocationResultMsg));
        throw new SyncFailedException();
    }
    context.output(PrintOutput.log(invocationResultMsg));
}
Also used : ProjectViewSet(com.google.idea.blaze.base.projectview.ProjectViewSet) ShardedTargetsResult(com.google.idea.blaze.base.sync.sharding.BlazeBuildTargetSharder.ShardedTargetsResult) ProjectTargets(com.google.idea.blaze.base.sync.SyncProjectTargetsHelper.ProjectTargets) TargetExpression(com.google.idea.blaze.base.model.primitives.TargetExpression) ShardedTargetList(com.google.idea.blaze.base.sync.sharding.ShardedTargetList) BlazeBuildOutputs(com.google.idea.blaze.base.sync.aspects.BlazeBuildOutputs) SyncFailedException(com.google.idea.blaze.base.sync.SyncScope.SyncFailedException) SyncStrategy(com.google.idea.blaze.base.bazel.BuildSystem.SyncStrategy) SyncCanceledException(com.google.idea.blaze.base.sync.SyncScope.SyncCanceledException) BuildInvoker(com.google.idea.blaze.base.bazel.BuildSystem.BuildInvoker)

Example 7 with BuildInvoker

use of com.google.idea.blaze.base.bazel.BuildSystem.BuildInvoker in project intellij by bazelbuild.

the class BlazeIdeInterfaceAspectsImpl method build.

@Override
public BlazeBuildOutputs build(Project project, BlazeContext context, WorkspaceRoot workspaceRoot, BlazeVersionData blazeVersion, BuildInvoker invoker, ProjectViewSet projectViewSet, ShardedTargetList shardedTargets, WorkspaceLanguageSettings workspaceLanguageSettings, ImmutableSet<OutputGroup> outputGroups, BlazeInvocationContext blazeInvocationContext) {
    AspectStrategy aspectStrategy = AspectStrategy.getInstance(blazeVersion);
    final Ref<BlazeBuildOutputs> combinedResult = new Ref<>();
    // The build is a sync iff INFO output group is present
    boolean isSync = outputGroups.contains(OutputGroup.INFO);
    Function<Integer, String> progressMessage = count -> String.format("Building targets for shard %s of %s...", count, shardedTargets.shardCount());
    final ShardedBuildProgressTracker progressTracker = new ShardedBuildProgressTracker(shardedTargets.shardCount());
    // Sync only flags (sync_only) override build_flags, so log them to warn the users
    List<String> syncOnlyFlags = BlazeFlags.expandBuildFlags(projectViewSet.listItems(SyncFlagsSection.KEY));
    if (!syncOnlyFlags.isEmpty()) {
        String message = String.format("Sync flags (`%s`) specified in the project view file will override the build" + " flags set in blazerc configurations or general build flags in the" + " project view file.", String.join(" ", syncOnlyFlags));
        // Print to both summary and print outputs (i.e. main and subtask window of blaze console)
        context.output(SummaryOutput.output(Prefix.INFO, message));
        context.output(PrintOutput.log(message));
    }
    // Fetching blaze flags here using parent context, to avoid duplicate fetch for every shard.
    List<String> additionalBlazeFlags = BlazeFlags.blazeFlags(project, projectViewSet, BlazeCommandName.BUILD, context, blazeInvocationContext);
    Function<List<? extends TargetExpression>, BuildResult> invocation = targets -> Scope.push(context, (childContext) -> {
        Task task = createTask(project, context, "Build shard " + StringUtil.first(UUID.randomUUID().toString(), 8, true), isSync);
        // we use context (rather than childContext) here since the shard state relates to
        // the parent task (which encapsulates all the build shards).
        setupToolWindow(project, childContext, workspaceRoot, task);
        progressTracker.onBuildStarted(context);
        BlazeBuildOutputs result = runBuildForTargets(project, childContext, workspaceRoot, invoker, projectViewSet, workspaceLanguageSettings.getActiveLanguages(), targets, aspectStrategy, outputGroups, additionalBlazeFlags);
        // TODO(b/216104482) track failures
        progressTracker.onBuildCompleted(context);
        printShardFinishedSummary(context, task.getName(), result);
        if (!result.buildResult.outOfMemory()) {
            synchronized (combinedResult) {
                combinedResult.set(combinedResult.isNull() ? result : combinedResult.get().updateOutputs(result));
            }
        }
        return result.buildResult;
    });
    BuildResult buildResult = shardedTargets.runShardedCommand(project, context, progressMessage, invocation, invoker);
    if (combinedResult.isNull() || buildResult.status == Status.FATAL_ERROR) {
        return BlazeBuildOutputs.noOutputs(buildResult);
    }
    return combinedResult.get();
}
Also used : AdditionalLanguagesHelper(com.google.idea.blaze.base.lang.AdditionalLanguagesHelper) LanguageSupport(com.google.idea.blaze.base.sync.projectview.LanguageSupport) PrefetchService(com.google.idea.blaze.base.prefetch.PrefetchService) BlazeProjectData(com.google.idea.blaze.base.model.BlazeProjectData) BlazeConsoleScope(com.google.idea.blaze.base.scope.scopes.BlazeConsoleScope) Map(java.util.Map) Task(com.google.idea.blaze.base.toolwindow.Task) FileUtil(com.intellij.openapi.util.io.FileUtil) SyncProjectState(com.google.idea.blaze.base.sync.SyncProjectState) Blaze(com.google.idea.blaze.base.settings.Blaze) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) BuildInvoker(com.google.idea.blaze.base.bazel.BuildSystem.BuildInvoker) Set(java.util.Set) RemoteArtifactPrefetcher(com.google.idea.blaze.base.prefetch.RemoteArtifactPrefetcher) BuildResultHelper(com.google.idea.blaze.base.command.buildresult.BuildResultHelper) PrintOutput(com.google.idea.blaze.base.scope.output.PrintOutput) BlazeArtifact(com.google.idea.blaze.base.command.buildresult.BlazeArtifact) OutputArtifact(com.google.idea.blaze.base.command.buildresult.OutputArtifact) ProjectTargetData(com.google.idea.blaze.base.model.ProjectTargetData) Status(com.google.idea.blaze.base.sync.aspects.BuildResult.Status) ProjectViewSet(com.google.idea.blaze.base.projectview.ProjectViewSet) ToolWindowScope(com.google.idea.blaze.base.scope.scopes.ToolWindowScope) Joiner(com.google.common.base.Joiner) ListeningExecutorService(com.google.common.util.concurrent.ListeningExecutorService) Iterables(com.google.common.collect.Iterables) BlazeContext(com.google.idea.blaze.base.scope.BlazeContext) StatusOutput(com.google.idea.blaze.base.scope.output.StatusOutput) ArrayList(java.util.ArrayList) NavigatableAdapter(com.intellij.pom.NavigatableAdapter) ArtifactsDiff(com.google.idea.blaze.base.filecache.ArtifactsDiff) Kind(com.google.idea.blaze.base.model.primitives.Kind) Lists(com.google.common.collect.Lists) ArtifactState(com.google.idea.blaze.base.filecache.ArtifactState) Scope(com.google.idea.blaze.base.scope.Scope) BoolExperiment(com.google.idea.common.experiments.BoolExperiment) IssueOutput(com.google.idea.blaze.base.scope.output.IssueOutput) ImmutableSet.toImmutableSet(com.google.common.collect.ImmutableSet.toImmutableSet) TargetIdeInfo(com.google.idea.blaze.base.ideinfo.TargetIdeInfo) LinkedHashSet(java.util.LinkedHashSet) Nullable(javax.annotation.Nullable) ImportRoots(com.google.idea.blaze.base.sync.projectview.ImportRoots) StringUtil(com.intellij.openapi.util.text.StringUtil) SyncFlagsSection(com.google.idea.blaze.base.projectview.section.sections.SyncFlagsSection) File(java.io.File) ExecutionException(java.util.concurrent.ExecutionException) BlazeExecutor(com.google.idea.blaze.base.async.executor.BlazeExecutor) AtomicLong(java.util.concurrent.atomic.AtomicLong) Futures(com.google.common.util.concurrent.Futures) BlazeVersionData(com.google.idea.blaze.base.model.BlazeVersionData) SummaryOutput(com.google.idea.blaze.base.scope.output.SummaryOutput) BlazeConfigurationHandler(com.google.idea.blaze.base.command.info.BlazeConfigurationHandler) BlazeFlags(com.google.idea.blaze.base.command.BlazeFlags) BlazeInvocationContext(com.google.idea.blaze.base.command.BlazeInvocationContext) BlazeConsoleExperimentManager(com.google.idea.blaze.base.console.BlazeConsoleExperimentManager) BlazeCommand(com.google.idea.blaze.base.command.BlazeCommand) EventType(com.google.idea.blaze.base.scope.scopes.TimingScope.EventType) AutomaticallyDeriveTargetsSection(com.google.idea.blaze.base.projectview.section.sections.AutomaticallyDeriveTargetsSection) Result(com.google.idea.blaze.base.scope.Result) BlazeSyncBuildResult(com.google.idea.blaze.base.sync.BlazeSyncBuildResult) TargetExpression(com.google.idea.blaze.base.model.primitives.TargetExpression) Logger(com.intellij.openapi.diagnostic.Logger) IntellijIdeInfo(com.google.devtools.intellij.ideinfo.IntellijIdeInfo) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) AspectStrategy(com.google.idea.blaze.base.sync.aspects.strategy.AspectStrategy) Predicate(java.util.function.Predicate) Collection(java.util.Collection) FutureUtil(com.google.idea.blaze.base.async.FutureUtil) WorkspaceLanguageSettings(com.google.idea.blaze.base.sync.projectview.WorkspaceLanguageSettings) UUID(java.util.UUID) Instant(java.time.Instant) Sets(com.google.common.collect.Sets) BlazeCommandName(com.google.idea.blaze.base.command.BlazeCommandName) Objects(java.util.Objects) IssueOutputFilter(com.google.idea.blaze.base.issueparser.IssueOutputFilter) List(java.util.List) WorkspaceRoot(com.google.idea.blaze.base.model.primitives.WorkspaceRoot) TargetKey(com.google.idea.blaze.base.ideinfo.TargetKey) ShardedTargetList(com.google.idea.blaze.base.sync.sharding.ShardedTargetList) Ref(com.intellij.openapi.util.Ref) TargetMap(com.google.idea.blaze.base.ideinfo.TargetMap) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) ContextType(com.google.idea.blaze.base.command.BlazeInvocationContext.ContextType) HashMap(java.util.HashMap) Function(java.util.function.Function) HashSet(java.util.HashSet) ProcessCanceledException(com.intellij.openapi.progress.ProcessCanceledException) ImmutableList(com.google.common.collect.ImmutableList) OutputGroup(com.google.idea.blaze.base.sync.aspects.strategy.AspectStrategy.OutputGroup) Project(com.intellij.openapi.project.Project) RemoteOutputArtifacts(com.google.idea.blaze.base.model.RemoteOutputArtifacts) Prefix(com.google.idea.blaze.base.scope.output.SummaryOutput.Prefix) LanguageClass(com.google.idea.blaze.base.model.primitives.LanguageClass) PerformanceWarning(com.google.idea.blaze.base.scope.output.PerformanceWarning) PrefetchFileSource(com.google.idea.blaze.base.prefetch.PrefetchFileSource) Maps(com.google.common.collect.Maps) ShardedBuildProgressTracker(com.google.idea.blaze.base.sync.sharding.ShardedBuildProgressTracker) Ordering(com.google.common.collect.Ordering) TimingScope(com.google.idea.blaze.base.scope.scopes.TimingScope) BlazeIssueParser(com.google.idea.blaze.base.issueparser.BlazeIssueParser) LocalFileArtifact(com.google.idea.blaze.base.command.buildresult.BlazeArtifact.LocalFileArtifact) Task(com.google.idea.blaze.base.toolwindow.Task) ShardedBuildProgressTracker(com.google.idea.blaze.base.sync.sharding.ShardedBuildProgressTracker) TargetExpression(com.google.idea.blaze.base.model.primitives.TargetExpression) Ref(com.intellij.openapi.util.Ref) BlazeSyncBuildResult(com.google.idea.blaze.base.sync.BlazeSyncBuildResult) AspectStrategy(com.google.idea.blaze.base.sync.aspects.strategy.AspectStrategy) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) ArrayList(java.util.ArrayList) List(java.util.List) ShardedTargetList(com.google.idea.blaze.base.sync.sharding.ShardedTargetList) ImmutableList(com.google.common.collect.ImmutableList)

Example 8 with BuildInvoker

use of com.google.idea.blaze.base.bazel.BuildSystem.BuildInvoker in project intellij by bazelbuild.

the class BlazeBuildTargetSharder method doExpandWildcardTargets.

private static ExpandedTargetsResult doExpandWildcardTargets(Project project, BlazeContext context, WorkspaceRoot workspaceRoot, BuildInvoker buildBinary, ProjectViewSet projectViewSet, WorkspacePathResolver pathResolver, List<TargetExpression> targets) {
    List<WildcardTargetPattern> includes = getWildcardPatterns(targets);
    if (includes.isEmpty()) {
        return new ExpandedTargetsResult(targets, BuildResult.SUCCESS);
    }
    Map<TargetExpression, List<TargetExpression>> expandedTargets = WildcardTargetExpander.expandToNonRecursiveWildcardTargets(project, context, pathResolver, includes);
    if (expandedTargets == null) {
        return new ExpandedTargetsResult(ImmutableList.of(), BuildResult.FATAL_ERROR);
    }
    // replace original recursive targets with expanded list, retaining relative ordering
    List<TargetExpression> fullList = new ArrayList<>();
    for (TargetExpression target : targets) {
        List<TargetExpression> expanded = expandedTargets.get(target);
        if (expanded == null) {
            fullList.add(target);
        } else {
            fullList.addAll(expanded);
        }
    }
    ExpandedTargetsResult result = WildcardTargetExpander.expandToSingleTargets(project, context, workspaceRoot, buildBinary, projectViewSet, fullList);
    // finally add back any explicitly-specified, unexcluded single targets which may have been
    // removed by the query (for example, because they have the 'manual' tag)
    TargetExpressionList helper = TargetExpressionList.create(targets);
    List<TargetExpression> singleTargets = targets.stream().filter(t -> !t.isExcluded()).filter(t -> !isWildcardPattern(t)).filter(t -> t instanceof Label).filter(t -> helper.includesTarget((Label) t)).collect(toImmutableList());
    return ExpandedTargetsResult.merge(result, new ExpandedTargetsResult(singleTargets, result.buildResult));
}
Also used : ExpandedTargetsResult(com.google.idea.blaze.base.sync.sharding.WildcardTargetExpander.ExpandedTargetsResult) TargetShardSizeSection(com.google.idea.blaze.base.projectview.section.sections.TargetShardSizeSection) BlazeContext(com.google.idea.blaze.base.scope.BlazeContext) BuildResult(com.google.idea.blaze.base.sync.aspects.BuildResult) StatusOutput(com.google.idea.blaze.base.scope.output.StatusOutput) ProjectViewManager(com.google.idea.blaze.base.projectview.ProjectViewManager) ArrayList(java.util.ArrayList) ShardBlazeBuildsSection(com.google.idea.blaze.base.projectview.section.sections.ShardBlazeBuildsSection) ImmutableList(com.google.common.collect.ImmutableList) Scope(com.google.idea.blaze.base.scope.Scope) Map(java.util.Map) ImmutableSet.toImmutableSet(com.google.common.collect.ImmutableSet.toImmutableSet) Project(com.intellij.openapi.project.Project) TargetExpression(com.google.idea.blaze.base.model.primitives.TargetExpression) WorkspacePathResolver(com.google.idea.blaze.base.sync.workspace.WorkspacePathResolver) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) BuildInvoker(com.google.idea.blaze.base.bazel.BuildSystem.BuildInvoker) Math.min(java.lang.Math.min) IntExperiment(com.google.idea.common.experiments.IntExperiment) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) List(java.util.List) WildcardTargetPattern(com.google.idea.blaze.base.model.primitives.WildcardTargetPattern) TargetExpressionList(com.google.idea.blaze.base.sync.projectview.TargetExpressionList) SyncStrategy(com.google.idea.blaze.base.bazel.BuildSystem.SyncStrategy) Label(com.google.idea.blaze.base.model.primitives.Label) TimingScope(com.google.idea.blaze.base.scope.scopes.TimingScope) ProjectViewSet(com.google.idea.blaze.base.projectview.ProjectViewSet) WorkspaceRoot(com.google.idea.blaze.base.model.primitives.WorkspaceRoot) ShardStats(com.google.idea.blaze.base.logging.utils.ShardStats) VisibleForTesting(com.google.common.annotations.VisibleForTesting) EventType(com.google.idea.blaze.base.scope.scopes.TimingScope.EventType) WildcardTargetPattern(com.google.idea.blaze.base.model.primitives.WildcardTargetPattern) ArrayList(java.util.ArrayList) Label(com.google.idea.blaze.base.model.primitives.Label) TargetExpression(com.google.idea.blaze.base.model.primitives.TargetExpression) ArrayList(java.util.ArrayList) ImmutableList(com.google.common.collect.ImmutableList) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) List(java.util.List) TargetExpressionList(com.google.idea.blaze.base.sync.projectview.TargetExpressionList) ExpandedTargetsResult(com.google.idea.blaze.base.sync.sharding.WildcardTargetExpander.ExpandedTargetsResult) TargetExpressionList(com.google.idea.blaze.base.sync.projectview.TargetExpressionList)

Aggregations

BuildInvoker (com.google.idea.blaze.base.bazel.BuildSystem.BuildInvoker)8 WorkspaceRoot (com.google.idea.blaze.base.model.primitives.WorkspaceRoot)6 StatusOutput (com.google.idea.blaze.base.scope.output.StatusOutput)5 BlazeCommand (com.google.idea.blaze.base.command.BlazeCommand)4 BlazeProjectData (com.google.idea.blaze.base.model.BlazeProjectData)4 TargetExpression (com.google.idea.blaze.base.model.primitives.TargetExpression)4 ProjectViewSet (com.google.idea.blaze.base.projectview.ProjectViewSet)4 BlazeContext (com.google.idea.blaze.base.scope.BlazeContext)4 Project (com.intellij.openapi.project.Project)4 ImmutableList (com.google.common.collect.ImmutableList)3 ImmutableSet (com.google.common.collect.ImmutableSet)3 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)3 AndroidDeployInfo (com.google.devtools.build.lib.rules.android.deployinfo.AndroidDeployInfoOuterClass.AndroidDeployInfo)3 BlazeAndroidDeployInfo (com.google.idea.blaze.android.run.deployinfo.BlazeAndroidDeployInfo)3 GetDeployInfoException (com.google.idea.blaze.android.run.deployinfo.BlazeApkDeployInfoProtoHelper.GetDeployInfoException)3 SyncStrategy (com.google.idea.blaze.base.bazel.BuildSystem.SyncStrategy)3 BuildResultHelper (com.google.idea.blaze.base.command.buildresult.BuildResultHelper)3 GetArtifactsException (com.google.idea.blaze.base.command.buildresult.BuildResultHelper.GetArtifactsException)3 BlazeBuildOutputs (com.google.idea.blaze.base.sync.aspects.BlazeBuildOutputs)3 File (java.io.File)3