From 99062cbf5e332b3883c502da612d97f83eee9bff Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Fri, 21 Jul 2023 13:41:18 +0200 Subject: Remove "project dependencies are published" check (#3078) The check was likely added because bintray did not perform any checks of its own, but Maven Central should check for that before the staging repository is closed and all the artifacts are published, so it's not needed locally --- .../kotlin/org/jetbrains/ValidatePublications.kt | 34 ---------------------- 1 file changed, 34 deletions(-) (limited to 'build-logic/src') diff --git a/build-logic/src/main/kotlin/org/jetbrains/ValidatePublications.kt b/build-logic/src/main/kotlin/org/jetbrains/ValidatePublications.kt index af35a847..d69ee6c4 100644 --- a/build-logic/src/main/kotlin/org/jetbrains/ValidatePublications.kt +++ b/build-logic/src/main/kotlin/org/jetbrains/ValidatePublications.kt @@ -27,39 +27,11 @@ open class ValidatePublications : DefaultTask() { .filterIsInstance() .filter { it.version == project.dokkaVersion } .forEach { _ -> - checkProjectDependenciesArePublished(subProject) subProject.assertPublicationVersion() } } } - private fun checkProjectDependenciesArePublished(project: Project) { - val implementationDependencies = project.findDependenciesByName("implementation") - val apiDependencies = project.findDependenciesByName("api") - - val allDependencies = implementationDependencies + apiDependencies - - allDependencies - .filterIsInstance() - .forEach { projectDependency -> - val publishing = projectDependency.dependencyProject.extensions.findByType() - ?: throw UnpublishedProjectDependencyException( - project = project, dependencyProject = projectDependency.dependencyProject - ) - - val isPublished = publishing.publications.filterIsInstance() - .any { it.version == project.dokkaVersion } - - if (!isPublished) { - throw UnpublishedProjectDependencyException(project, projectDependency.dependencyProject) - } - } - } - - private fun Project.findDependenciesByName(name: String): Set { - return configurations.findByName(name)?.allDependencies.orEmpty() - } - private fun Project.assertPublicationVersion() { val versionTypeMatchesPublicationChannels = publicationChannels.all { publicationChannel -> publicationChannel.acceptedDokkaVersionTypes.any { acceptedVersionType -> @@ -70,10 +42,4 @@ open class ValidatePublications : DefaultTask() { throw AssertionError("Wrong version $dokkaVersion for configured publication channels $publicationChannels") } } - - private class UnpublishedProjectDependencyException( - project: Project, dependencyProject: Project - ): GradleException( - "Published project ${project.path} cannot depend on unpublished project ${dependencyProject.path}" - ) } -- cgit