| plugins { | |
| id("common-configuration") | |
| id("com.autonomousapps.dependency-analysis") | |
| id("maven-publish") | |
| } | |
| description = 'Kotlin Common Standard Library' | |
| def stdlibCommonDependencies = configurations.create("stdlibCommonDependencies") { | |
| canBeResolved = true | |
| canBeConsumed = false | |
| } | |
| def stdlibCommonElements = configurations.create("stdlibCommonElements") { | |
| canBeResolved = false | |
| canBeConsumed = true | |
| attributes { | |
| attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.LIBRARY)) | |
| } | |
| extendsFrom(stdlibCommonDependencies) | |
| } | |
| dependencies { | |
| add(stdlibCommonDependencies.name, project(":kotlin-stdlib")) | |
| } | |
| SoftwareComponentFactory componentFactory = plugins.publishing.CustomVariantPublishingDslKt.getComponentFactory(project) | |
| def rootComponent = componentFactory.adhoc("root") | |
| rootComponent.addVariantsFromConfiguration(stdlibCommonElements) { | |
| mapToOptional() | |
| } | |
| plugins.KotlinBuildPublishingPluginKt.configureDefaultPublishing(project) | |
| publishing { | |
| publications { | |
| def mainPublication = register("main", MavenPublication) { | |
| from(rootComponent) | |
| plugins.KotlinBuildPublishingPluginKt.configureKotlinPomAttributes(it, project, "Kotlin Common Standard Library (legacy, use kotlin-stdlib instead)", "pom", null) | |
| } | |
| SbomKt.configureSbom(project, "Main", "kotlin-stdlib-common", ["stdlibCommonDependencies"], mainPublication) | |
| } | |
| } |