Files
kotlin-fork/libraries/commonConfiguration.gradle
T
Alexander Udalov 0925e1b497 Enable JVM IR for stdlib/reflect/test libraries
Changes in Gradle integration tests are needed because:
- in new-mpp-android, kotlin-stdlib-jdk8 is used, and JVM IR generates
  JDK 8-specific bytecode (invokedynamic). D8 needs to be configured to
  desugar it with source/target versions set to 1.8, otherwise it
  reports an error.
- in AndroidExtensionsManyVariants and AndroidIcepickProject, D8 fails
  with assertions enabled if AGP < 4.0.0 is used because of
  https://issuetracker.google.com/issues/148661132. The tests which use
  old AGP versions are probably not relevant anymore anyway.

Changes in kotlin-stdlib-runtime-merged.txt are caused by a slightly
different generation scheme of collection subclasses in JVM IR, and are
harmless.

(Previous attempt was at 15e978dbd311c2ba78ec32b394c21acde9811ccb.)
2021-08-05 12:36:35 +02:00

93 lines
3.3 KiB
Groovy

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
ext.manifestAttributes = { Manifest manifest, Project project, String component = null, boolean multiRelease = false ->
project.configure(manifest) {
attributes \
'Implementation-Vendor': 'JetBrains',
'Implementation-Title': project.archivesBaseName,
'Implementation-Version': project.buildNumber
if (component != null) {
attributes \
'Kotlin-Runtime-Component': component,
'Kotlin-Version': project.kotlinLanguageVersion
}
if (multiRelease) {
attributes \
'Multi-Release': 'true'
}
}
}
task preparePublication {
def properties = project.properties
assert project.version != 'unspecified'
Map<String, String> repositoryProviders = ['sonatype-nexus-staging' : 'sonatype', 'sonatype-nexus-snapshots' : 'sonatype']
project.ext.isRelease = !project.version.toString().contains('-SNAPSHOT')
String repo = properties["deployRepo"] ?: properties['deploy-repo']
String repoProvider = repositoryProviders.get(repo, repo)
project.ext.isSonatypePublish = repoProvider == 'sonatype'
project.ext.isSonatypeRelease = isSonatypePublish && isRelease
String deployRepoUrl = properties["deployRepoUrl"] ?: properties["deploy-url"]
String deployFolder = properties["deployRepoFolder"] != null ? "file://${rootProject.buildDir}/${properties["deployRepoFolder"]}" : null
String sonatypeSnapshotsUrl = (isSonatypePublish && !isRelease) ? "https://oss.sonatype.org/content/repositories/snapshots/" : null
String deployUrlFromParameters = deployRepoUrl ?: deployFolder ?: sonatypeSnapshotsUrl
project.ext.isDeployStagingRepoGenerationRequired = project.ext.isSonatypeRelease && deployUrlFromParameters == null
ext.repoUrl = deployUrlFromParameters ?: "file://${rootProject.buildDir}/repo"
logger.info("Deployment repository preliminary url: $repoUrl ($repoProvider)")
ext.username = properties["deployRepoUsername"] ?: properties["kotlin.${repoProvider}.user"]
ext.password = properties["deployRepoPassword"] ?: properties["kotlin.${repoProvider}.password"]
doLast {
println("Deployment repository url: $repoUrl")
}
}
ext.configurePublishing = { Project project, configure = { } ->
ArtifactsKt.publish(project, false) { publication ->
configure.delegate = publication
configure()
}
}
ext.configureGradlePluginPublishing = { Project project ->
ArtifactsKt.publishGradlePlugin(project)
}
ext.configurePluginMarkers = { Project project, withEmptyJars = true ->
PluginMarkersKt.publishPluginMarkers(project, withEmptyJars)
}
allprojects { project ->
project.ext.configureSourcesJar = { lambda = {} ->
ArtifactsKt.sourcesJar(project) { task ->
lambda.delegate = task
lambda()
}
}
project.ext.configureJavadocJar = { lambda = {} ->
ArtifactsKt.javadocJar(project) { task ->
lambda.delegate = task
lambda()
}
}
project.ext.configureModularJar = { lambda = {} ->
ArtifactsKt.modularJar(project) { task ->
lambda.delegate = task
lambda()
}
}
dependencies.ext.kotlinStdlib = { suffix ->
DependenciesKt.kotlinStdlib(project, suffix, null)
}
}