mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[kotlin] Allow specifying classifier when downloading sources jar for tests
Also improve error reporting with more detailed artifact identification. #KTIJ-31132 GitOrigin-RevId: 911f6b7faa7dd4a2ad3dae80e0a0882ee8a2855b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
642bffe812
commit
cbfe0547c3
@@ -40,13 +40,13 @@ object TestKotlinArtifacts {
|
||||
private fun getKlib(artifactId: String): File =
|
||||
downloadOrReportUnavailability(artifactId, kotlinCLibrariesVersion, suffix = ".klib")
|
||||
|
||||
private fun getSourcesJar(artifactId: String): File {
|
||||
return downloadOrReportUnavailability(artifactId, kotlinCLibrariesVersion, suffix = "-sources.jar")
|
||||
private fun getSourcesJar(artifactId: String, extraSuffix: String = ""): File {
|
||||
return downloadOrReportUnavailability(artifactId, kotlinCLibrariesVersion, suffix = "$extraSuffix-sources.jar")
|
||||
.copyTo( // Some tests hardcode jar names in their test data
|
||||
File(PathManager.getCommunityHomePath()) // (KotlinReferenceTypeHintsProviderTestGenerated).
|
||||
.resolve("out") // That's why we need to strip version from the jar name
|
||||
.resolve("kotlin-from-sources-deps-renamed")
|
||||
.resolve("$artifactId-sources.jar"),
|
||||
.resolve("$artifactId$extraSuffix-sources.jar"),
|
||||
overwrite = true
|
||||
)
|
||||
}
|
||||
@@ -86,7 +86,7 @@ object TestKotlinArtifacts {
|
||||
|
||||
libFile
|
||||
}
|
||||
@JvmStatic val kotlinStdlibCommonSources: File by lazy { getSourcesJar("kotlin-stdlib-common") }
|
||||
@JvmStatic val kotlinStdlibCommonSources: File by lazy { getSourcesJar("kotlin-stdlib", extraSuffix = "-common") }
|
||||
@JvmStatic val kotlinStdlibJdk7: File by lazy { getJar("kotlin-stdlib-jdk7") }
|
||||
@JvmStatic val kotlinStdlibJdk7Sources: File by lazy { getSourcesJar("kotlin-stdlib-jdk7") }
|
||||
@JvmStatic val kotlinStdlibJdk8: File by lazy { getJar("kotlin-stdlib-jdk8") }
|
||||
@@ -224,4 +224,7 @@ object TestKotlinArtifacts {
|
||||
@JvmOverloads
|
||||
fun downloadOrReportUnavailability(artifactId: String, version: String, suffix: String = ".jar"): File =
|
||||
KotlinArtifactsDownloader.downloadArtifactForIdeFromSources(artifactId, version, suffix)
|
||||
?: ExternalResourcesChecker.reportUnavailability<Nothing>(KotlinArtifactsDownloader::downloadArtifactForIdeFromSources.name, null)
|
||||
?: ExternalResourcesChecker.reportUnavailability<Nothing>(
|
||||
KotlinArtifactsDownloader::downloadArtifactForIdeFromSources.name + ": $artifactId-$version$suffix",
|
||||
null
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user