mpetuska / npm-publish

Gradle plugin for NPM package publishing. Allows for arbitrary publishing as well as seamless integration with Kotlin JS/MPP plugins.
https://npm-publish.petuska.dev
Apache License 2.0
126 stars 10 forks source link

Cache problem when changing files collection #156

Open rjaros opened 10 months ago

rjaros commented 10 months ago

Steps to reproduce:

  1. Checkout https://github.com/rjaros/kilua
  2. Run NPM_AUTH_TOKEN=dummy ./gradlew :kilua-assets:pack (some token in env is required to enable task)
  3. Two packages are created inside kilua-assets/build/packages. aaa-kilua-assets-0.0.3.tgz contains nodejs_dom.js and nodejs_dom.mjs files, and zzz-kilua-assets-0.0.3-tgz contains style.css at the top level (so far so good, this is how the packages are configured inside kilua-assets/build.gradle.kts).
  4. Now make a change in kilua-assets/build.gradle.kts changing from("$projectDir/src/js") to from("$projectDir/src") and from("$projectDir/src/css") to from("$projectDir/src").
  5. Delete kilua-assets/build directory
  6. Run NPM_AUTH_TOKEN=dummy ./gradlew :kilua-assets:pack again.
  7. Two packages are created again but the first one (aaa-kilua-assets-0.0.3.tgz) still contains nodejs_dom.js and nodejs_dom.mjs files at top level (and it should not - it should be the same as the other package, which for some reason is build correctly). Cleaning the project and build directories doesn't help. The package will be incorrect every time.