Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.util.PatternSet;
import org.gradle.internal.Factory;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;

import java.io.File;

@ServiceScope(Scope.Project.class)
public class DefaultProjectLayout implements ProjectLayout, TaskFileVarFactory {

private final Directory settingsDir;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.file.FileCollection;
import org.gradle.api.internal.file.collections.MinimalFileSet;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;

@ServiceScope(Scope.Project.class)
public interface TaskFileVarFactory {
/**
* Creates a {@link ConfigurableFileCollection} that can be used as a task input.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.gradle.model.internal.registry;

import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;
import org.gradle.model.RuleSource;
import org.gradle.model.internal.core.ModelAction;
import org.gradle.model.internal.core.ModelActionRole;
Expand All @@ -28,6 +30,7 @@

import javax.annotation.Nullable;

@ServiceScope(Scope.Project.class)
public interface ModelRegistry {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
import org.gradle.internal.operations.BuildOperationRef;
import org.gradle.internal.operations.BuildOperationRunner;
import org.gradle.internal.service.ServiceRegistry;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;
import org.gradle.process.internal.worker.RequestHandler;

@ServiceScope(Scope.Project.class)
public class IsolatedClassloaderWorkerFactory implements WorkerFactory {
private final BuildOperationRunner buildOperationRunner;
private final ServiceRegistry internalServices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@
import org.gradle.internal.operations.BuildOperationRef;
import org.gradle.internal.operations.BuildOperationRunner;
import org.gradle.internal.operations.CurrentBuildOperationRef;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;

import javax.annotation.concurrent.ThreadSafe;

/**
* Controls the lifecycle of the worker daemon and provides access to it.
*/
@ServiceScope(Scope.Project.class)
@ThreadSafe
public class WorkerDaemonFactory implements WorkerFactory {
private final WorkerDaemonClientsManager clientsManager;
Expand All @@ -48,7 +51,7 @@ public DefaultWorkResult execute(IsolatedParametersActionExecutionSpec<?> spec,
// is never called) the cancellation handler will not stop daemons on a cancellation (as there is no danger of
// leaving one in an unsafe state).
workerDaemonClientCancellationHandler.start();

// wrap in build operation for logging startup failures
final WorkerDaemonClient client = CurrentBuildOperationRef.instance().with(parentBuildOperation, this::reserveClient);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

package org.gradle.internal.typeconversion;

import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;

@ServiceScope(Scope.Project.class)
public interface TypeConverter {
/**
* @param type The target type. Should be the boxed type for primitives.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import org.gradle.api.UncheckedIOException;
import org.gradle.internal.buildconfiguration.DaemonJvmPropertiesConfigurator;
import org.gradle.internal.buildconfiguration.DaemonJvmPropertiesDefaults;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;
import org.gradle.internal.util.PropertiesUtils;
import org.gradle.jvm.toolchain.JavaLanguageVersion;
import org.gradle.platform.BuildPlatform;
Expand All @@ -33,6 +35,7 @@

import static org.gradle.internal.buildconfiguration.tasks.DaemonJvmPropertiesUtils.getToolchainUrlPropertyForPlatform;

@ServiceScope(Scope.Project.class)
public class DaemonJvmPropertiesModifier {

public DaemonJvmPropertiesModifier() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@

package org.gradle.internal.logging.progress;

import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;

import java.io.IOException;

@ServiceScope(Scope.Project.class)
public interface ProgressLoggingInputStreamListener {

void onProcessedBytes(int numberOfBytes) throws IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@

package org.gradle.internal.enterprise.test.impl;

import org.gradle.internal.enterprise.test.TestTaskPropertiesService;
import org.gradle.internal.service.ServiceRegistration;
import org.gradle.internal.service.scopes.AbstractGradleModuleServices;

public class TestTaskPropertiesServices extends AbstractGradleModuleServices {

@Override
public void registerProjectServices(ServiceRegistration registration) {
registration.add(DefaultTestTaskPropertiesService.class);
registration.add(TestTaskPropertiesService.class, DefaultTestTaskPropertiesService.class);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@

package org.gradle.internal.snapshot;

import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;

import java.nio.file.Path;

/**
* Snapshotting service which is used by test distribution.
*/
@ServiceScope(Scope.Project.class)
public interface SnapshottingService {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@

import org.gradle.internal.service.ServiceRegistration;
import org.gradle.internal.service.scopes.AbstractGradleModuleServices;
import org.gradle.internal.snapshot.SnapshottingService;

public class SnapshottingServices extends AbstractGradleModuleServices {

@Override
public void registerProjectServices(ServiceRegistration registration) {
registration.add(DefaultSnapshottingService.class);
registration.add(SnapshottingService.class, DefaultSnapshottingService.class);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
import org.gradle.api.artifacts.component.ProjectComponentIdentifier;
import org.gradle.api.file.FileCollection;
import org.gradle.api.internal.tasks.TaskDependencyContainer;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;

import javax.annotation.Nullable;
import java.util.List;

/**
* This should merge into {@link org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectPublicationRegistry}.
*/
@ServiceScope(Scope.Project.class)
public interface IdeArtifactRegistry {
/**
* Registers an IDE project model to be included in the IDE workspace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public void registerBuildTreeServices(ServiceRegistration registration) {

@Override
public void registerProjectServices(ServiceRegistration registration) {
registration.add(DefaultIdeArtifactRegistry.class);
registration.add(IdeArtifactRegistry.class, DefaultIdeArtifactRegistry.class);
}
}
1 change: 0 additions & 1 deletion platforms/jvm/language-groovy/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ dependencies {
implementation(projects.classloaders)
implementation(projects.concurrent)
implementation(projects.serviceLookup)
implementation(projects.stdlibJavaExtensions)
implementation(projects.fileCollections)
implementation(projects.logging)
implementation(projects.loggingApi)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import org.gradle.initialization.ClassLoaderRegistry;
import org.gradle.initialization.layout.ProjectCacheDir;
import org.gradle.internal.jvm.inspection.JvmVersionDetector;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;
import org.gradle.language.base.internal.compile.Compiler;
import org.gradle.language.base.internal.compile.CompilerFactory;
import org.gradle.process.internal.JavaForkOptionsFactory;
Expand All @@ -40,6 +42,7 @@
import java.io.File;
import java.util.List;

@ServiceScope(Scope.Project.class)
public class GroovyCompilerFactory implements CompilerFactory<GroovyJavaJointCompileSpec> {
private final WorkerDaemonFactory workerDaemonFactory;
private final IsolatedClassloaderWorkerFactory inProcessWorkerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@
import org.gradle.api.tasks.SourceSet;
import org.gradle.api.tasks.TaskProvider;
import org.gradle.api.tasks.compile.AbstractCompile;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;

/**
* This class exposes a number of internal utilities for use by Gradle JVM plugins that use
* types specific to Java and other JVM languages, such as {@link HasCompileOptions} which are
* not available in the {@code platform-jvm} project and would otherwise be located on the
* {@link JvmPluginServices} type.
*/
@ServiceScope(Scope.Project.class)
public interface JvmLanguageUtilities {
/**
* Configures a configuration so that its exposed target jvm version is inferred from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.gradle.api.internal.tasks.DefaultSourceSetContainer;
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.plugins.jvm.internal.DefaultJvmPluginServices;
import org.gradle.api.plugins.jvm.internal.JvmPluginServices;
import org.gradle.api.tasks.SourceSetContainer;
import org.gradle.internal.service.Provides;
import org.gradle.internal.service.ServiceRegistration;
Expand All @@ -39,7 +40,7 @@ public void registerBuildServices(ServiceRegistration registration) {
@Override
public void registerProjectServices(ServiceRegistration registration) {
registration.addProvider(new ProjectScopeServices());
registration.add(DefaultJvmPluginServices.class);
registration.add(JvmPluginServices.class, DefaultJvmPluginServices.class);
}

private static class ProjectScopeServices implements ServiceRegistrationProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@
import org.gradle.api.attributes.HasConfigurableAttributes;
import org.gradle.api.tasks.SourceSet;
import org.gradle.internal.HasInternalProtocol;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;

/**
* This class exposes a number of internal utilities for use by Gradle JVM plugins.
*/
@NonNullApi
@HasInternalProtocol
@ServiceScope(Scope.Project.class)
@SuppressWarnings({"UnusedReturnValue", "deprecation"})
public interface JvmPluginServices extends JvmEcosystemUtilities {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@
package org.gradle.api.tasks;

import org.gradle.api.NamedDomainObjectContainer;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;

/**
* A {@code SourceSetContainer} manages a set of {@link SourceSet} objects.
*/
@ServiceScope(Scope.Project.class)
public interface SourceSetContainer extends NamedDomainObjectContainer<SourceSet> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.gradle.api.plugins.internal;

import org.gradle.api.plugins.jvm.internal.DefaultJvmLanguageUtilities;
import org.gradle.api.plugins.jvm.internal.JvmLanguageUtilities;
import org.gradle.internal.service.ServiceRegistration;
import org.gradle.internal.service.scopes.AbstractGradleModuleServices;

Expand All @@ -26,6 +27,6 @@
public class JvmLanguageUtilsServices extends AbstractGradleModuleServices {
@Override
public void registerProjectServices(ServiceRegistration registration) {
registration.add(DefaultJvmLanguageUtilities.class);
registration.add(JvmLanguageUtilities.class, DefaultJvmLanguageUtilities.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@


import org.gradle.api.Incubating;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;
import org.gradle.jvm.toolchain.JavaToolchainDownload;
import org.gradle.jvm.toolchain.JavaToolchainRequest;

Expand All @@ -29,6 +31,7 @@
* @since 8.13
*/
@Incubating
@ServiceScope(Scope.Project.class)
public interface JavaToolchainResolverService {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.gradle.internal.service.ServiceRegistrationProvider;
import org.gradle.internal.service.scopes.AbstractGradleModuleServices;
import org.gradle.jvm.toolchain.JavaToolchainResolverRegistry;
import org.gradle.jvm.toolchain.JavaToolchainService;
import org.gradle.jvm.toolchain.JvmToolchainManagement;
import org.gradle.jvm.toolchain.internal.AsdfInstallationSupplier;
import org.gradle.jvm.toolchain.internal.CurrentJvmToolchainSpec;
Expand All @@ -50,6 +51,7 @@
import org.gradle.jvm.toolchain.internal.JabbaInstallationSupplier;
import org.gradle.jvm.toolchain.internal.JavaToolchainQueryService;
import org.gradle.jvm.toolchain.internal.JavaToolchainResolverRegistryInternal;
import org.gradle.jvm.toolchain.internal.JavaToolchainResolverService;
import org.gradle.jvm.toolchain.internal.JdkCacheDirectory;
import org.gradle.jvm.toolchain.internal.LinuxInstallationSupplier;
import org.gradle.jvm.toolchain.internal.MavenToolchainsInstallationSupplier;
Expand Down Expand Up @@ -145,7 +147,7 @@ public void registerBuildServices(ServiceRegistration registration) {

@Override
public void registerProjectServices(ServiceRegistration registration) {
registration.add(DefaultJavaToolchainResolverService.class);
registration.add(DefaultJavaToolchainService.class);
registration.add(JavaToolchainResolverService.class, DefaultJavaToolchainResolverService.class);
registration.add(JavaToolchainService.class, DefaultJavaToolchainService.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import org.gradle.api.Action;
import org.gradle.api.provider.Provider;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;

/**
* Allows to query for toolchain managed tools, like {@link JavaCompiler}, {@link JavaLauncher} and {@link JavadocTool}.
Expand All @@ -26,6 +28,7 @@
*
* @since 6.7
*/
@ServiceScope(Scope.Project.class)
public interface JavaToolchainService {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@

import org.gradle.internal.Factory;
import org.gradle.internal.file.RelativeFilePathResolver;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;

import javax.annotation.Nonnull;

@ServiceScope(Scope.Project.class)
public class CompilerOutputFileNamingSchemeFactory implements Factory<CompilerOutputFileNamingScheme> {
private final RelativeFilePathResolver fileResolver;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@
import org.gradle.buildinit.plugins.internal.modifiers.ComponentType;
import org.gradle.buildinit.plugins.internal.modifiers.Language;
import org.gradle.internal.logging.text.TreeFormatter;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

@ServiceScope(Scope.Project.class)
public class ProjectLayoutSetupRegistry {
private final Map<String, BuildInitializer> registeredProjectDescriptors = new TreeMap<>();
private final BuildGenerator defaultType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
package org.gradle.api.component;

import org.gradle.api.ExtensiblePolymorphicDomainObjectContainer;
import org.gradle.internal.service.scopes.Scope;
import org.gradle.internal.service.scopes.ServiceScope;

/**
* A Container that contains all of the Software Components produced by a Project.
*/
@ServiceScope(Scope.Project.class)
public interface SoftwareComponentContainer extends ExtensiblePolymorphicDomainObjectContainer<SoftwareComponent> {
}
Loading