Joel
04/02/2021, 1:51 AMjs(IR) {
moduleName = project.name
nodejs()
binaries.executable()
}
The only relevant documentation I can find areย hereย andย here.
There also appears to be a bug when the module name includes a group resulting in an invalid package main path:Robert Jaros
04/02/2021, 11:55 AMJoel
04/02/2021, 1:36 PMJoel
04/02/2021, 1:39 PMbinaries.library()
which produces a folder called productionLibrary
. This might be the ticket.Joel
04/02/2021, 3:04 PMRobert Jaros
04/02/2021, 3:07 PMJoel
04/02/2021, 3:12 PMBig Chungus
04/02/2021, 3:23 PMBig Chungus
04/02/2021, 3:26 PMJoel
04/02/2021, 3:27 PMktor-client-websockets
depends on a few npm packages such as ws
. The IR compiler correctly compiles ktor-client-websockets
into the output, but those transitive npm dependencies are not enumerated in package.json
using either plugin.Big Chungus
04/02/2021, 3:28 PMBig Chungus
04/02/2021, 3:29 PMJoel
04/02/2021, 3:30 PMBig Chungus
04/02/2021, 3:30 PMJoel
04/02/2021, 3:30 PMnodejs
target, let me see if it works using browser
which enable webpackBig Chungus
04/02/2021, 3:31 PMJoel
04/02/2021, 3:31 PMJoel
04/02/2021, 3:36 PMJoel
04/02/2021, 3:36 PMError: Cannot find module 'ws'
Joel
04/02/2021, 3:37 PMBig Chungus
04/02/2021, 3:37 PMBig Chungus
04/02/2021, 3:38 PMBig Chungus
04/02/2021, 3:38 PMJoel
04/02/2021, 3:40 PMJoel
04/02/2021, 3:46 PMJoel
04/02/2021, 3:47 PMBig Chungus
04/02/2021, 3:49 PMBig Chungus
04/02/2021, 3:50 PMJoel
04/02/2021, 3:55 PMBig Chungus
04/02/2021, 3:57 PMBig Chungus
04/02/2021, 3:58 PMJoel
04/02/2021, 3:58 PMBig Chungus
04/02/2021, 3:58 PMJoel
04/02/2021, 3:59 PMBig Chungus
04/02/2021, 6:12 PMJoel
04/02/2021, 6:24 PMBig Chungus
04/03/2021, 7:49 PMJoel
04/05/2021, 11:22 AMJoel
04/05/2021, 8:46 PMBig Chungus
04/05/2021, 8:47 PMBig Chungus
04/05/2021, 8:48 PMBig Chungus
04/05/2021, 8:48 PMBig Chungus
04/05/2021, 8:49 PMJoel
04/05/2021, 8:52 PMnpmPublishing
extension. I figured there may be an incantation like extensionWithType<NpmPublishingExtension>
but no cigar.Big Chungus
04/05/2021, 8:53 PMJoel
04/05/2021, 8:53 PMBig Chungus
04/05/2021, 8:53 PMJoel
04/05/2021, 8:55 PMJoel
04/05/2021, 8:55 PMBig Chungus
04/05/2021, 8:55 PMJoel
04/05/2021, 8:58 PMJoel
04/05/2021, 8:58 PMBig Chungus
04/05/2021, 8:59 PMJoel
04/06/2021, 3:40 PMBig Chungus
04/06/2021, 3:50 PMBig Chungus
04/06/2021, 3:50 PMJoel
04/06/2021, 3:50 PMJoel
04/06/2021, 3:58 PMUnresolved reference: npmPublishing
Big Chungus
04/06/2021, 4:03 PMBig Chungus
04/06/2021, 4:04 PMJoel
04/06/2021, 4:05 PMBig Chungus
04/06/2021, 5:10 PMJoel
04/06/2021, 6:58 PMJoel
04/06/2021, 7:07 PMJoel
04/06/2021, 7:16 PMbuildSrc/build.gradle.kts
:
implementation("lt.petuska:npm-publish:1.1.3")
Joel
04/06/2021, 7:16 PMFAILURE: Build failed with an exception.
* Where:
Build file '/Users/joel/Code/bank/build.gradle.kts' line: 4
* What went wrong:
Error resolving plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.4.32', apply: false]
> Plugin request for plugin already on the classpath must not include a version
Big Chungus
04/06/2021, 7:17 PMJoel
04/06/2021, 7:18 PMJoel
04/06/2021, 7:18 PMBig Chungus
04/06/2021, 7:19 PMBig Chungus
04/06/2021, 7:19 PMJoel
04/06/2021, 7:19 PMJoel
04/06/2021, 7:20 PMBig Chungus
04/06/2021, 7:21 PMBig Chungus
04/06/2021, 7:23 PMhard
chooses transitive dependency versions (in this case kotlin). You can still override it by adding implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:_")
to your buildSrc/build.gradle.kts
I guess it's just the way convention plugin dependencies are resolvedBig Chungus
04/06/2021, 7:24 PMJoel
04/06/2021, 7:24 PMBig Chungus
04/06/2021, 7:25 PMBig Chungus
04/06/2021, 7:25 PMJoel
04/06/2021, 7:31 PMnpmPublishing
Big Chungus
04/06/2021, 7:33 PMJoel
04/06/2021, 7:34 PMJoel
04/06/2021, 7:34 PMJoel
04/06/2021, 7:36 PMBig Chungus
04/06/2021, 7:37 PMJoel
04/06/2021, 7:38 PMJoel
04/06/2021, 7:38 PMjoel@computer bank % ./gradlew clean
Watching the file system is not supported on this operating system.
> Task :buildSrc:extractPrecompiledScriptPluginPlugins UP-TO-DATE
> Task :buildSrc:generateExternalPluginSpecBuilders UP-TO-DATE
> Task :buildSrc:compilePluginsBlocks UP-TO-DATE
> Task :buildSrc:generatePrecompiledScriptPluginAccessors UP-TO-DATE
> Task :buildSrc:configurePrecompiledScriptDependenciesResolver
> Task :buildSrc:generateScriptPluginAdapters UP-TO-DATE
> Task :buildSrc:compileKotlin FAILED
The `kotlin-dsl` plugin applied to project ':buildSrc' enables experimental Kotlin compiler features. For more information see <https://docs.gradle.org/6.8.3/userguide/kotlin_dsl.html#sec:kotlin-dsl_plugin>
e: /Users/joel/Code/bank/buildSrc/src/main/kotlin/springbank.npm-conventions.gradle.kts: (5, 1): Unresolved reference: npmPublishing
e: /Users/joel/Code/bank/buildSrc/src/main/kotlin/springbank.npm-conventions.gradle.kts: (6, 5): Unresolved reference: organization
e: /Users/joel/Code/bank/buildSrc/src/main/kotlin/springbank.npm-conventions.gradle.kts: (8, 5): Unresolved reference: publications
e: /Users/joel/Code/bank/buildSrc/src/main/kotlin/springbank.npm-conventions.gradle.kts: (9, 9): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public inline operator fun <K, V> Map<out TypeVariable(K), TypeVariable(V)>.get(key: TypeVariable(K)): TypeVariable(V)? defined in kotlin.collections
public operator fun MatchGroupCollection.get(name: String): MatchGroup? defined in kotlin.text
public operator fun <T : Any> NamedDomainObjectCollection<TypeVariable(T)>.get(name: String): TypeVariable(T) defined in org.gradle.kotlin.dsl
public operator fun ExtensionContainer.get(name: String): Any defined in org.gradle.kotlin.dsl
public inline fun <S : Any, T : SoftwareComponent> BinaryCollection<TypeVariable(T)>.get(type: KClass<TypeVariable(S)>, spec: Spec<in TypeVariable(S)>): BinaryProvider<TypeVariable(S)> defined in org.gradle.kotlin.dsl
e: /Users/joel/Code/bank/buildSrc/src/main/kotlin/springbank.npm-conventions.gradle.kts: (9, 13): No get method providing array access
e: /Users/joel/Code/bank/buildSrc/src/main/kotlin/springbank.npm-conventions.gradle.kts: (10, 13): Unresolved reference: repository
e: /Users/joel/Code/bank/buildSrc/src/main/kotlin/springbank.npm-conventions.gradle.kts: (11, 17): Unresolved reference: url
e: /Users/joel/Code/bank/buildSrc/src/main/kotlin/springbank.npm-conventions.gradle.kts: (17, 9): Unresolved reference: repository
e: /Users/joel/Code/bank/buildSrc/src/main/kotlin/springbank.npm-conventions.gradle.kts: (18, 13): Unresolved reference: registry
e: /Users/joel/Code/bank/buildSrc/src/main/kotlin/springbank.npm-conventions.gradle.kts: (19, 13): Unresolved reference: authToken
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':buildSrc:compileKotlin'.
> Compilation error. See log for more details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at <https://help.gradle.org>
BUILD FAILED in 729ms
Big Chungus
04/06/2021, 10:01 PMBig Chungus
04/06/2021, 10:02 PMproject.properties
during conventional plugins resolution... Had to refactor into using it the ugly way ๐Joel
04/07/2021, 12:08 AMJoel
04/07/2021, 12:08 AMBig Chungus
04/07/2021, 12:10 AMBig Chungus
04/07/2021, 12:11 AMJoel
04/07/2021, 12:19 AMJoel
04/07/2021, 12:19 AMBig Chungus
04/07/2021, 12:24 AMBig Chungus
04/07/2021, 12:25 AM