Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gradle.tooling.provider.model.internal;
import org.gradle.api.NonNullApi;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.internal.project.ProjectInternal;
import org.gradle.api.internal.project.ProjectState;
import org.gradle.internal.Cast;
import org.gradle.internal.build.BuildState;
import org.gradle.internal.build.BuildToolingModelController;
import org.gradle.internal.buildtree.IntermediateBuildActionRunner;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.function.Supplier;
import static java.util.stream.Collectors.toList;
@NonNullApi
public class DefaultIntermediateToolingModelProvider implements IntermediateToolingModelProvider {
private final IntermediateBuildActionRunner actionRunner;
private final ToolingModelParameterCarrier.Factory parameterCarrierFactory;
private final ToolingModelProjectDependencyListener projectDependencyListener;
public DefaultIntermediateToolingModelProvider(
IntermediateBuildActionRunner actionRunner,
ToolingModelParameterCarrier.Factory parameterCarrierFactory,
ToolingModelProjectDependencyListener projectDependencyListener
) {
this.actionRunner = actionRunner;
this.parameterCarrierFactory = parameterCarrierFactory;
this.projectDependencyListener = projectDependencyListener;
}
@Override
public List getModels(Project requester, List targets, String modelName, Class modelType, @Nullable Object parameter) {
if (targets.isEmpty()) {
return Collections.emptyList();
}
List