Skip to content

Commit

Permalink
ProjectPackagingExtension: use existing project's propertyFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Feb 12, 2025
1 parent 33b8e48 commit 9cbc038
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import org.gradle.api.internal.file.copy.CopySpecInternal
import org.gradle.api.internal.file.copy.DefaultCopySpec
import org.gradle.api.internal.project.ProjectInternal
import org.gradle.api.internal.provider.DefaultPropertyFactory
import org.gradle.api.internal.provider.PropertyFactory
import org.gradle.api.internal.provider.PropertyHost
import org.gradle.api.specs.Spec
import org.gradle.api.tasks.util.PatternSet
Expand Down Expand Up @@ -46,11 +47,12 @@ class ProjectPackagingExtension extends SystemPackagingExtension {
public ProjectPackagingExtension(Project project) {
FileResolver resolver = ((ProjectInternal) project).getFileResolver();
Instantiator instantiator = ((ProjectInternal) project).getServices().get(Instantiator.class);
if (GradleVersion.current().baseVersion >= GradleVersion.version("8.13-rc-1")) {
FileCollectionFactory fileCollectionFactory = ((ProjectInternal) project).getServices().get(FileCollectionFactory.class);
if (GradleVersion.current().baseVersion >= GradleVersion.version("8.13") || GradleVersion.current().version.startsWith('8.13')) {
FileCollectionFactory fileCollectionFactory = ((ProjectInternal) project).getServices().get(FileCollectionFactory.class)
PropertyFactory propertyFactory = ((ProjectInternal) project).getServices().get(PropertyFactory.class)
Factory<PatternSet> patternSetFactory = new PatternSets.PatternSetFactory(PatternSpecFactory.INSTANCE)
delegateCopySpec = new DefaultCopySpec(fileCollectionFactory, new DefaultPropertyFactory(PropertyHost.NO_OP), instantiator, patternSetFactory);
} else if (GradleVersion.current().baseVersion >= GradleVersion.version("8.3") || GradleVersion.current().version.startsWith('8.3')) {
delegateCopySpec = new DefaultCopySpec(fileCollectionFactory, propertyFactory, instantiator, patternSetFactory)
} else if (GradleVersion.current().baseVersion >= GradleVersion.version("8.3") || GradleVersion.current().version.startsWith('8.3')) {
FileCollectionFactory fileCollectionFactory = ((ProjectInternal) project).getServices().get(FileCollectionFactory.class);
Factory<PatternSet> patternSetFactory = new PatternSets.PatternSetFactory(PatternSpecFactory.INSTANCE)
delegateCopySpec = new DefaultCopySpec(fileCollectionFactory, project.objects, instantiator, patternSetFactory);
Expand Down

0 comments on commit 9cbc038

Please sign in to comment.