-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test-k2 convention to use test suites (#3524)
* Update test-k2 convention to use test suites - use jvm-test-suites to create create separate targets for descriptor and symbols tests - rename descriptorsTest/symbolsTest tasks - update Configurations to use newer Gradle guidelines for declarable/resolvable configurations - add comments to clarify K1 vs K2 analysis - always run symbol and descriptor tests
- Loading branch information
Showing
8 changed files
with
180 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package dokkabuild.utils | ||
|
||
import org.gradle.api.artifacts.Configuration | ||
import org.gradle.api.attributes.* | ||
import org.gradle.api.attributes.java.TargetJvmEnvironment | ||
import org.gradle.api.model.ObjectFactory | ||
import org.gradle.kotlin.dsl.named | ||
|
||
|
||
/** | ||
* Mark this [Configuration] as one that should be used to declare dependencies in | ||
* [org.gradle.api.Project.dependencies] block. | ||
* | ||
* Declarable Configurations should be extended by [resolvable] and [consumable] Configurations. | ||
* They must not have attributes. | ||
* | ||
* ``` | ||
* isCanBeResolved = false | ||
* isCanBeConsumed = false | ||
* isCanBeDeclared = true | ||
* ``` | ||
*/ | ||
internal fun Configuration.declarable( | ||
visible: Boolean = false, | ||
) { | ||
isCanBeResolved = false | ||
isCanBeConsumed = false | ||
@Suppress("UnstableApiUsage") | ||
isCanBeDeclared = true | ||
isVisible = visible | ||
} | ||
|
||
|
||
/** | ||
* Mark this [Configuration] as one that will be consumed by other subprojects. | ||
* | ||
* Consumable Configurations must extend a [declarable] Configuration. | ||
* They should have attributes. | ||
* | ||
* ``` | ||
* isCanBeResolved = false | ||
* isCanBeConsumed = true | ||
* isCanBeDeclared = false | ||
* ``` | ||
*/ | ||
internal fun Configuration.consumable( | ||
visible: Boolean = false, | ||
) { | ||
isCanBeResolved = false | ||
isCanBeConsumed = true | ||
@Suppress("UnstableApiUsage") | ||
isCanBeDeclared = false | ||
isVisible = visible | ||
} | ||
|
||
|
||
/** | ||
* Mark this [Configuration] as one that will consume artifacts from other subprojects (also known as 'resolving') | ||
* | ||
* Resolvable Configurations should have attributes. | ||
* | ||
* ``` | ||
* isCanBeResolved = true | ||
* isCanBeConsumed = false | ||
* isCanBeDeclared = false | ||
* ``` | ||
*/ | ||
internal fun Configuration.resolvable( | ||
visible: Boolean = false, | ||
) { | ||
isCanBeResolved = true | ||
isCanBeConsumed = false | ||
@Suppress("UnstableApiUsage") | ||
isCanBeDeclared = false | ||
isVisible = visible | ||
} | ||
|
||
|
||
internal fun AttributeContainer.jvmJar(objects: ObjectFactory) { | ||
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME)) | ||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY)) | ||
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL)) | ||
attribute(TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE, objects.named(TargetJvmEnvironment.STANDARD_JVM)) | ||
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters