Skip to content

Commit 92f4443

Browse files
committed
Avoid deprecation nagging for method used by KGP
1 parent 29d0cec commit 92f4443

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

subprojects/core/src/main/java/org/gradle/api/internal/project/DefaultProject.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,18 +1480,19 @@ public <T> NamedDomainObjectContainer<T> container(Class<T> type) {
14801480
@Override
14811481
@Deprecated
14821482
public <T> NamedDomainObjectContainer<T> container(Class<T> type, NamedDomainObjectFactory<T> factory) {
1483-
DeprecationLogger.deprecateMethod(Project.class, "container(Class)").
1484-
replaceWith("objects.domainObjectContainer(Class, NamedDomainObjectFactory)").
1485-
willBeRemovedInGradle10().
1486-
withUpgradeGuideSection(9, "project_container_methods").
1487-
nagUser();
1483+
// KGP uses this method to create a container for the Kotlin DSL
1484+
// DeprecationLogger.deprecateMethod(Project.class, "container(Class, NamedDomainObjectFactory)").
1485+
// replaceWith("objects.domainObjectContainer(Class, NamedDomainObjectFactory)").
1486+
// willBeRemovedInGradle10().
1487+
// withUpgradeGuideSection(9, "project_container_methods").
1488+
// nagUser();
14881489
return getServices().get(DomainObjectCollectionFactory.class).newNamedDomainObjectContainer(type, factory);
14891490
}
14901491

14911492
@Override
14921493
@Deprecated
14931494
public <T> NamedDomainObjectContainer<T> container(Class<T> type, Closure factoryClosure) {
1494-
DeprecationLogger.deprecateMethod(Project.class, "container(Class)").
1495+
DeprecationLogger.deprecateMethod(Project.class, "container(Class, Closure)").
14951496
replaceWith("objects.domainObjectContainer(Class, NamedDomainObjectFactory)").
14961497
willBeRemovedInGradle10().
14971498
withUpgradeGuideSection(9, "project_container_methods").

0 commit comments

Comments
 (0)