Skip to content

Commit ac0781c

Browse files
committed
Fix: don't publish publish-npm-packages project (2)
Previous applied fix (9206843) was still configured in main build file to be published. Apparently `publish.enabled = false` is no longer needed. Maybe since the upgrade to the new publish plugin happened. Publication is simply not set up for "dev ops projects", so `publish` isn't called on those since the tasks don't exist.
1 parent b0635c4 commit ac0781c

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ buildscript {
3131

3232
commonModule = subprojects.find { it.name == 'carp.common' }
3333
coreModules = subprojects.findAll { it.name.endsWith( '.core' ) }
34-
devOpsModules = subprojects.findAll { it.name == 'carp.detekt' || it.name == 'rpc' }
34+
publishNpmModule = subprojects.find { it.name == 'publish-npm-packages' }
35+
devOpsModules =
36+
subprojects.findAll {it.name == 'carp.detekt' || it.name == 'rpc' } + publishNpmModule
3537
}
3638

3739
dependencies {
@@ -236,8 +238,8 @@ task setupTsProject(type: NpmTask) {
236238
args = ['install']
237239
}
238240
task copyTestJsSources(type: Copy, dependsOn: setupTsProject) {
239-
// Compile production sources for all subprojects that compile to JS.
240-
def projects = subprojects - devOpsModules
241+
// Compile production sources for CARP, and the JS publication project (`publishNpmModule`).
242+
def projects = coreModules + commonModule + publishNpmModule
241243
projects.each {
242244
def project = it.name
243245
dependsOn("$project:jsProductionExecutableCompileSync")

carp.detekt/build.gradle

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,3 @@ dependencies {
1616
test {
1717
useJUnitPlatform()
1818
}
19-
20-
21-
// This project is not intended to be published, but the root project is.
22-
// This skips this project when publishing the root: https://stackoverflow.com/a/59096967/590790
23-
apply {
24-
plugin("maven-publish")
25-
}
26-
project.tasks.publish.enabled = false

publish-npm-packages/build.gradle

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1+
apply {
2+
plugin("kotlin-multiplatform")
3+
}
4+
15
kotlin {
6+
js(IR) {
7+
moduleName = project.name.replaceAll("\\.", "-") + "-generated"
8+
binaries.executable() // Export JS/TypeScript files.
9+
browser()
10+
}
11+
212
sourceSets {
313
commonMain {
414
dependencies {
@@ -9,13 +19,12 @@ kotlin {
919
api project(':carp.studies.core')
1020
}
1121
}
12-
}
13-
}
14-
1522

16-
// This project is not intended to be published, but the root project is.
17-
// This skips this project when publishing the root: https://stackoverflow.com/a/59096967/590790
18-
apply {
19-
plugin("maven-publish")
23+
all {
24+
languageSettings {
25+
// We do not mind being early adopters of Jetbrains APIs likely to change in the future.
26+
optIn('kotlin.js.ExperimentalJsExport')
27+
}
28+
}
29+
}
2030
}
21-
project.tasks.publish.enabled = false

0 commit comments

Comments
 (0)