In addition, it also deprecates transitiveModules from pkl-gradle. It instead derives transitive modules by building an import graph of those tasks' source modules.
🔄 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/695
**Author:** [@bioball](https://github.com/bioball)
**Created:** 10/16/2024
**Status:** ✅ Merged
**Merged:** 10/23/2024
**Merged by:** [@bioball](https://github.com/bioball)
**Base:** `main` ← **Head:** `get-imports-command`
---
### 📝 Commits (10+)
- [`d3493c9`](https://github.com/apple/pkl/commit/d3493c9e7ca5b564ea51dc16399c11bd84043884) Add import analyzer
- [`d0ef1f7`](https://github.com/apple/pkl/commit/d0ef1f7101b676eb2220105b4d3e2d62ea2c313c) Add Gradle support for analyze
- [`125814b`](https://github.com/apple/pkl/commit/125814b528bfffd751b104066e17ab5d15208af8) Add documentation
- [`89f2f6f`](https://github.com/apple/pkl/commit/89f2f6fad7abd15d9669c2d96c87353a77183962) Touchups
- [`fc63be4`](https://github.com/apple/pkl/commit/fc63be49524f1256d977678a8f8269938f60ea1f) Apply suggestions from code review
- [`048fd43`](https://github.com/apple/pkl/commit/048fd43ebc7521bb40028c4db63eddab291740cd) Cleanup code
- [`b9572a4`](https://github.com/apple/pkl/commit/b9572a4ee891fc720eb64817f9257ed972e755cf) Update docs/modules/pkl-cli/pages/index.adoc
- [`c72c877`](https://github.com/apple/pkl/commit/c72c877da4951d1b6d0efb0a8205ea5e991d0de9) Updates
- [`7b93523`](https://github.com/apple/pkl/commit/7b93523cd415a00be35ccf84953e8430fd671d21) Address more PR comments
- [`d4ef31e`](https://github.com/apple/pkl/commit/d4ef31e039cb2a43525e5503a3d1d219f1d487a4) Address more PR comments
### 📊 Changes
**53 files changed** (+2052 additions, -51 deletions)
<details>
<summary>View changed files</summary>
📝 `docs/modules/language-reference/pages/index.adoc` (+3 -2)
📝 `docs/modules/pkl-cli/pages/index.adoc` (+52 -2)
📝 `docs/modules/pkl-cli/partials/cli-common-options.adoc` (+0 -1)
📝 `docs/modules/pkl-gradle/pages/index.adoc` (+58 -5)
📝 `docs/modules/pkl-gradle/partials/gradle-common-properties.adoc` (+0 -1)
📝 `docs/modules/pkl-gradle/partials/gradle-modules-properties.adoc` (+8 -2)
➕ `pkl-cli/src/main/kotlin/org/pkl/cli/CliImportAnalyzer.kt` (+79 -0)
➕ `pkl-cli/src/main/kotlin/org/pkl/cli/CliImportAnalyzerOptions.kt` (+34 -0)
📝 `pkl-cli/src/main/kotlin/org/pkl/cli/Main.kt` (+2 -1)
➕ `pkl-cli/src/main/kotlin/org/pkl/cli/commands/AnalyzeCommand.kt` (+66 -0)
➕ `pkl-cli/src/test/kotlin/org/pkl/cli/CliImportAnalyzerTest.kt` (+142 -0)
📝 `pkl-cli/src/test/kotlin/org/pkl/cli/CliMainTest.kt` (+3 -1)
➕ `pkl-core/src/main/java/org/pkl/core/Analyzer.java` (+120 -0)
📝 `pkl-core/src/main/java/org/pkl/core/EvaluatorBuilder.java` (+4 -0)
➕ `pkl-core/src/main/java/org/pkl/core/ImportGraph.java` (+111 -0)
📝 `pkl-core/src/main/java/org/pkl/core/ast/builder/ImportsAndReadsParser.java` (+44 -17)
📝 `pkl-core/src/main/java/org/pkl/core/module/ProjectDependenciesManager.java` (+4 -0)
📝 `pkl-core/src/main/java/org/pkl/core/project/ProjectPackager.java` (+3 -5)
➕ `pkl-core/src/main/java/org/pkl/core/runtime/AnalyzeModule.java` (+53 -0)
📝 `pkl-core/src/main/java/org/pkl/core/runtime/ModuleCache.java` (+2 -0)
_...and 33 more files_
</details>
### 📄 Description
This adds a new feature to build a dependency graph of Pkl programs, following the SPICE outlined in https://github.com/apple/pkl-evolution/pull/2.
It adds:
* CLI command `pkl analyze imports`
* Java API `org.pkl.core.Analyzer`
* Pkl stdlib module `pkl:analyze`
* pkl-gradle extension `analyze`
In addition, it also deprecates `transitiveModules` from pkl-gradle. It instead derives transitive modules by building an import graph of those tasks' source modules.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/695
Author: @bioball
Created: 10/16/2024
Status: ✅ Merged
Merged: 10/23/2024
Merged by: @bioball
Base:
main← Head:get-imports-command📝 Commits (10+)
d3493c9Add import analyzerd0ef1f7Add Gradle support for analyze125814bAdd documentation89f2f6fTouchupsfc63be4Apply suggestions from code review048fd43Cleanup codeb9572a4Update docs/modules/pkl-cli/pages/index.adocc72c877Updates7b93523Address more PR commentsd4ef31eAddress more PR comments📊 Changes
53 files changed (+2052 additions, -51 deletions)
View changed files
📝
docs/modules/language-reference/pages/index.adoc(+3 -2)📝
docs/modules/pkl-cli/pages/index.adoc(+52 -2)📝
docs/modules/pkl-cli/partials/cli-common-options.adoc(+0 -1)📝
docs/modules/pkl-gradle/pages/index.adoc(+58 -5)📝
docs/modules/pkl-gradle/partials/gradle-common-properties.adoc(+0 -1)📝
docs/modules/pkl-gradle/partials/gradle-modules-properties.adoc(+8 -2)➕
pkl-cli/src/main/kotlin/org/pkl/cli/CliImportAnalyzer.kt(+79 -0)➕
pkl-cli/src/main/kotlin/org/pkl/cli/CliImportAnalyzerOptions.kt(+34 -0)📝
pkl-cli/src/main/kotlin/org/pkl/cli/Main.kt(+2 -1)➕
pkl-cli/src/main/kotlin/org/pkl/cli/commands/AnalyzeCommand.kt(+66 -0)➕
pkl-cli/src/test/kotlin/org/pkl/cli/CliImportAnalyzerTest.kt(+142 -0)📝
pkl-cli/src/test/kotlin/org/pkl/cli/CliMainTest.kt(+3 -1)➕
pkl-core/src/main/java/org/pkl/core/Analyzer.java(+120 -0)📝
pkl-core/src/main/java/org/pkl/core/EvaluatorBuilder.java(+4 -0)➕
pkl-core/src/main/java/org/pkl/core/ImportGraph.java(+111 -0)📝
pkl-core/src/main/java/org/pkl/core/ast/builder/ImportsAndReadsParser.java(+44 -17)📝
pkl-core/src/main/java/org/pkl/core/module/ProjectDependenciesManager.java(+4 -0)📝
pkl-core/src/main/java/org/pkl/core/project/ProjectPackager.java(+3 -5)➕
pkl-core/src/main/java/org/pkl/core/runtime/AnalyzeModule.java(+53 -0)📝
pkl-core/src/main/java/org/pkl/core/runtime/ModuleCache.java(+2 -0)...and 33 more files
📄 Description
This adds a new feature to build a dependency graph of Pkl programs, following the SPICE outlined in https://github.com/apple/pkl-evolution/pull/2.
It adds:
pkl analyze importsorg.pkl.core.Analyzerpkl:analyzeanalyzeIn addition, it also deprecates
transitiveModulesfrom pkl-gradle. It instead derives transitive modules by building an import graph of those tasks' source modules.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.