Skip to content

Commit daa65fd

Browse files
committed
chore: dep updates and misc changes
1 parent 9b2cad0 commit daa65fd

File tree

5 files changed

+48
-2
lines changed

5 files changed

+48
-2
lines changed

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ kotlinx.atomicfu.enableJvmIrTransformation=true
2525
kotlinx.atomicfu.enableJsIrTransformation=true
2626

2727
# MPP
28+
kotlin.mpp.stability.nowarn=true
2829
kotlin.mpp.enableCInteropCommonization=true
2930
kotlin.js.ir.output.granularity=per-file
3031
# kotlin.js.ir.output.granularity=whole-program

gradle/build-logic/common-plugins/src/main/kotlin/common/ProjectExtns.kt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
package common
22

33
import java.io.ByteArrayOutputStream
4+
import java.io.File
45
import java.nio.file.Path
56
import org.gradle.accessors.dm.LibrariesForLibs
67
import org.gradle.api.Project
78
import org.gradle.api.Task
89
import org.gradle.api.artifacts.VersionCatalogsExtension
10+
import org.gradle.api.attributes.Category
11+
import org.gradle.api.attributes.DocsType
12+
import org.gradle.api.component.AdhocComponentWithVariants
913
import org.gradle.api.plugins.JavaPluginExtension
1014
import org.gradle.api.tasks.TaskContainer
1115
import org.gradle.internal.os.OperatingSystem
@@ -144,3 +148,27 @@ fun Project.printTaskGraph() {
144148
}
145149
}
146150
}
151+
152+
/** Adds [file] as an outgoing variant to publication. */
153+
fun Project.addFileToJavaComponent(file: File) {
154+
// Here's a configuration to declare the outgoing variant
155+
val executable by
156+
configurations.creating {
157+
description = "Declares executable outgoing variant"
158+
isCanBeConsumed = true
159+
isCanBeResolved = false
160+
attributes {
161+
// See https://docs.gradle.org/current/userguide/variant_attributes.html
162+
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY))
163+
attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named("exe"))
164+
}
165+
}
166+
executable.outgoing.artifact(file) { classifier = "bin" }
167+
val javaComponent = components.findByName("java") as AdhocComponentWithVariants
168+
javaComponent.addVariantsFromConfiguration(executable) {
169+
// dependencies for this variant are considered runtime dependencies
170+
mapToMavenScope("runtime")
171+
// and also optional dependencies, because we don't want them to leak
172+
mapToOptional()
173+
}
174+
}

gradle/build-logic/common-plugins/src/main/kotlin/plugins/kotlin.jvm.gradle.kts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,17 @@ dependencies {
136136
testImplementation(libs.slf4j.simple)
137137
testImplementation(libs.mockk)
138138
}
139+
140+
// Replace the standard jar with the one built by 'shadowJar' in both api and runtime variants
141+
//
142+
// configurations {
143+
// apiElements {
144+
// outgoing.artifacts.clear()
145+
// outgoing.artifact(shadowJar.flatMap {it.archiveFile})
146+
// }
147+
//
148+
// runtimeElements {
149+
// outgoing.artifacts.clear()
150+
// outgoing.artifact(shadowJar.flatMap {it.archiveFile})
151+
// }
152+
// }

gradle/build-logic/common-plugins/src/main/kotlin/plugins/kotlin.mpp.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ kotlinMultiplatform.apply {
183183
// kspDependency("CommonMainMetadata", project(":devtools:ksp:processor"))
184184
// kspDependency("Js", project(":devtools:ksp:processor"))
185185
}
186+
187+
// kotlin.srcDir("src/main/kotlin")
188+
// resources.srcDir("src/main/resources")
186189
}
187190
val jsTest by getting
188191
}

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ kotlinx-html = "0.9.1"
3434
kotlinx-benchmark = "0.4.8"
3535
kotlinx-reflect-lite = "1.1.0"
3636
kotlinx-bincompat = "0.13.2"
37-
kotlin-wrappers = "1.0.0-pre.599"
37+
kotlin-wrappers = "1.0.0-pre.601"
3838
zip-prefixer = "0.3.1"
3939
ajalt-mordant = "2.0.1"
4040
ajalt-clikt = "4.1.0"
@@ -118,7 +118,7 @@ buildkonfig = "0.13.3"
118118
gmazzo-buildconfig = "3.1.0"
119119
cyclonedx-plugin = "1.7.4"
120120
modulegraph = "0.4.0"
121-
jetbrains-compose = "1.5.0-dev1114"
121+
jetbrains-compose = "1.4.3"
122122
jetbrains-compose-compiler = "1.5.0"
123123
cash-molecule = "1.1.0"
124124
npm-publish-plugin = "3.4.1"

0 commit comments

Comments
 (0)