[PR #821] [MERGED] Exclude non file-based modules from synthesized *GatherImports task #758

Closed
opened 2025-12-30 01:26:34 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/821
Author: @bioball
Created: 11/17/2024
Status: Merged
Merged: 11/18/2024
Merged by: @bioball

Base: mainHead: transitive-modules-fix


📝 Commits (2)

  • da7871a Exclude non file-based modules from synthesized *GatherImports task
  • 487c5b9 Fix bug when generating pkldoc on Windows

📊 Changes

7 files changed (+216 additions, -134 deletions)

View changed files

📝 pkl-doc/src/main/kotlin/org/pkl/doc/DocGenerator.kt (+1 -1)
📝 pkl-gradle/src/main/java/org/pkl/gradle/PklPlugin.java (+36 -3)
📝 pkl-gradle/src/main/java/org/pkl/gradle/task/BasePklTask.java (+3 -102)
📝 pkl-gradle/src/main/java/org/pkl/gradle/task/ModulesTask.java (+4 -26)
pkl-gradle/src/main/java/org/pkl/gradle/utils/PluginUtils.java (+128 -0)
pkl-gradle/src/main/java/org/pkl/gradle/utils/package-info.java (+4 -0)
📝 pkl-gradle/src/test/kotlin/org/pkl/gradle/PkldocGeneratorsTest.kt (+40 -2)

📄 Description

This fixes an issue where certain modules tasks fail due to the plugin attempting to analyze their imports, but the arguments may not actually be Pkl modules.

For example, the pkldoc task accepts entire packages in its "sourceMoules" property.

This changes the gather imports logic to only analyze file-based modules. This is also a performance improvement; non file-based modules are unlikely to import files due to insufficient trust levels.

Closes https://github.com/apple/pkl/issues/791


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/821 **Author:** [@bioball](https://github.com/bioball) **Created:** 11/17/2024 **Status:** ✅ Merged **Merged:** 11/18/2024 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `transitive-modules-fix` --- ### 📝 Commits (2) - [`da7871a`](https://github.com/apple/pkl/commit/da7871a0c90bd0de22a16a0ff80b9c8212eff72d) Exclude non file-based modules from synthesized *GatherImports task - [`487c5b9`](https://github.com/apple/pkl/commit/487c5b9085e4ac157204e2ce13c01340f0624a57) Fix bug when generating pkldoc on Windows ### 📊 Changes **7 files changed** (+216 additions, -134 deletions) <details> <summary>View changed files</summary> 📝 `pkl-doc/src/main/kotlin/org/pkl/doc/DocGenerator.kt` (+1 -1) 📝 `pkl-gradle/src/main/java/org/pkl/gradle/PklPlugin.java` (+36 -3) 📝 `pkl-gradle/src/main/java/org/pkl/gradle/task/BasePklTask.java` (+3 -102) 📝 `pkl-gradle/src/main/java/org/pkl/gradle/task/ModulesTask.java` (+4 -26) ➕ `pkl-gradle/src/main/java/org/pkl/gradle/utils/PluginUtils.java` (+128 -0) ➕ `pkl-gradle/src/main/java/org/pkl/gradle/utils/package-info.java` (+4 -0) 📝 `pkl-gradle/src/test/kotlin/org/pkl/gradle/PkldocGeneratorsTest.kt` (+40 -2) </details> ### 📄 Description This fixes an issue where certain modules tasks fail due to the plugin attempting to analyze their imports, but the arguments may not actually be Pkl modules. For example, the pkldoc task accepts entire packages in its "sourceMoules" property. This changes the gather imports logic to only analyze file-based modules. This is also a performance improvement; non file-based modules are unlikely to import files due to insufficient trust levels. Closes https://github.com/apple/pkl/issues/791 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:26:34 +01:00
adam closed this issue 2025-12-30 01:26:34 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#758