How does the KGP JS create the package json file f...
# gradle
h
How does the KGP JS create the package json file for each Kotlin JS dependency? I use the Gradle file permission api to enforce 644 for published artifacts and when consuming the js dependency, the (somehow created) package.json file is created with 204 (write but no read), so reading the package.json file fails failing the build too. Is there any workaround (except changing the published artifact)?
1
e
that is clearly a decimal/octal conversion error
h
Thanks, yeah I also noticed and fixed it but I think, this is a Gradle issue allowing non-octal integers. You can switch to the string instead which works.
e
Kotlin does not have octal literals
h
Yes, that's true but it is somehow confusing because using (non-octal) integers does not work:
Copy code
tasks.withType<AbstractArchiveTask>().configureEach {
    filePermissions {
        unix(644) // fails
        unix("644") // works
    }
}
e
same as every other language
but I'm not sure what you expect. Gradle can't tell if you're calling the API from Kotlin code accidentally specifying
644
or from Java code intentionally specifying
01204
h
Hm, that's true. But thanks for the link for the new API, it also does setup the same defaults I want to set explicitly, so using the empty block removes all the headache 🙂