Skip to content

Simple property assignments and dropping Property by extension #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get()))
languageVersion = JavaLanguageVersion.of(libs.versions.java.get())
}

jvm()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ tasks.withType<DokkaTaskPartial>().configureEach {
includes.from("Module.md")

sourceLink {
localDirectory.set(rootDir)
remoteUrl.set(URL("https://github.com/kotlin/kotlinx-io/tree/master"))
remoteLineSuffix.set("#L")
localDirectory = rootDir
remoteUrl = URL("https://github.com/kotlin/kotlinx-io/tree/master")
remoteLineSuffix = "#L"
}

// we don't want to advertise `unsafe` APIs in documentation
perPackageOption {
suppress.set(true)
matchingRegex.set(".*unsafe.*")
suppress = true
matchingRegex = ".*unsafe.*"
}

// as in kotlinx-io-multiplatform.gradle.kts:configureSourceSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ plugins {
kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
allWarningsAsErrors.set(true)
allWarningsAsErrors = true
freeCompilerArgs.add("-Xexpect-actual-classes")
}

val versionCatalog: VersionCatalog = extensions.getByType<VersionCatalogsExtension>().named("libs")
jvmToolchain {
val javaVersion = versionCatalog.findVersion("java").getOrNull()?.requiredVersion
?: throw GradleException("Version 'java' is not specified in the version catalog")
languageVersion.set(JavaLanguageVersion.of(javaVersion))
languageVersion = JavaLanguageVersion.of(javaVersion)
}

jvm {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,40 @@ publishing {
}
}

// Pom configuration
infix fun <T> Property<T>.by(value: T) {
set(value)
}

fun MavenPom.configureMavenCentralMetadata(project: Project) {
name by project.name
description by "IO support for Kotlin"
url by "https://github.com/Kotlin/kotlinx-io"
name = project.name
description = "IO support for Kotlin"
url = "https://github.com/Kotlin/kotlinx-io"

licenses {
license {
name by "The Apache Software License, Version 2.0"
url by "https://www.apache.org/licenses/LICENSE-2.0.txt"
distribution by "repo"
name = "The Apache Software License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "repo"
}
}

developers {
developer {
id by "JetBrains"
name by "JetBrains Team"
organization by "JetBrains"
organizationUrl by "https://www.jetbrains.com"
id = "JetBrains"
name = "JetBrains Team"
organization = "JetBrains"
organizationUrl = "https://www.jetbrains.com"
}
}

scm {
url by "https://github.com/Kotlin/kotlinx-io"
url = "https://github.com/Kotlin/kotlinx-io"
}
}

fun MavenPublication.mavenCentralArtifacts(project: Project, sources: SourceDirectorySet) {
val sourcesJar by project.tasks.creating(Jar::class) {
archiveClassifier.set("sources")
archiveClassifier = "sources"
from(sources)
}
val javadocJar by project.tasks.creating(Jar::class) {
archiveClassifier.set("javadoc")
archiveClassifier = "javadoc"
// contents are deliberately left empty
}
artifact(sourcesJar)
Expand Down Expand Up @@ -100,7 +95,7 @@ fun RepositoryHandler.configureMavenPublication( project: Project) {

fun Project.configureEmptyJavadocArtifact(): Jar {
val javadocJar by project.tasks.creating(Jar::class) {
archiveClassifier.set("javadoc")
archiveClassifier = "javadoc"
// contents are deliberately left empty
}
return javadocJar
Expand Down