aboutsummaryrefslogtreecommitdiff
path: root/build-logic/src
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2023-07-21 13:41:18 +0200
committerGitHub <noreply@github.com>2023-07-21 13:41:18 +0200
commit99062cbf5e332b3883c502da612d97f83eee9bff (patch)
treee1e286dba8eaa208fd1e6c3ed970f3299c3fd0cc /build-logic/src
parent3f50846197ffce7e5dcc1c80e360ce6d499d67a6 (diff)
downloaddokka-99062cbf5e332b3883c502da612d97f83eee9bff.tar.gz
dokka-99062cbf5e332b3883c502da612d97f83eee9bff.tar.bz2
dokka-99062cbf5e332b3883c502da612d97f83eee9bff.zip
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
Diffstat (limited to 'build-logic/src')
-rw-r--r--build-logic/src/main/kotlin/org/jetbrains/ValidatePublications.kt34
1 files changed, 0 insertions, 34 deletions
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<MavenPublication>()
.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<ProjectDependency>()
- .forEach { projectDependency ->
- val publishing = projectDependency.dependencyProject.extensions.findByType<PublishingExtension>()
- ?: throw UnpublishedProjectDependencyException(
- project = project, dependencyProject = projectDependency.dependencyProject
- )
-
- val isPublished = publishing.publications.filterIsInstance<MavenPublication>()
- .any { it.version == project.dokkaVersion }
-
- if (!isPublished) {
- throw UnpublishedProjectDependencyException(project, projectDependency.dependencyProject)
- }
- }
- }
-
- private fun Project.findDependenciesByName(name: String): Set<Dependency> {
- 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}"
- )
}