mirror of
https://github.com/apple/pkl.git
synced 2026-04-20 15:31:28 +02:00
Add analyze imports libs (SPICE-0001) (#695)
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 changes the Gradle plugin such that `transitiveModules` is by default computed from the import graph.
This commit is contained in:
@@ -7,7 +7,6 @@ URI patterns that determine which modules can be loaded and evaluated.
|
||||
Patterns are matched against the beginning of module URIs.
|
||||
(File paths have been converted to `file:` URLs at this stage.)
|
||||
At least one pattern needs to match for a module to be loadable.
|
||||
Both source modules and transitive modules are subject to this check.
|
||||
====
|
||||
|
||||
.allowedResources: ListProperty<String>
|
||||
|
||||
@@ -20,11 +20,17 @@ This property accepts the following types to represent a module:
|
||||
.transitiveModules: ConfigurableFileCollection
|
||||
[%collapsible]
|
||||
====
|
||||
Default: `files()` (empty collection) +
|
||||
Default: [computed by pkl-gradle] +
|
||||
Example 1: `transitiveModules.from files("module1.pkl", "module2.pkl")` +
|
||||
Example 2: `+transitiveModules.from fileTree("config").include("**/*.pkl")+` +
|
||||
|
||||
File paths of modules that are directly or indirectly used by source modules.
|
||||
Setting this option enables correct Gradle up-to-date checks, which ensures that your Pkl tasks are executed if any of the transitive files are modified; it does not affect evaluation otherwise.
|
||||
|
||||
This property, along with `sourceModules`, is the set of input files used to determine whether this task is up-to-date or not.
|
||||
|
||||
By default, Pkl computes this property by analyzing the imports of the source modules.
|
||||
Setting this property explicitly causes Pkl to skip the analyze imports step.
|
||||
|
||||
Including source modules in `transitiveModules` is permitted but not required.
|
||||
Relative paths are resolved against the project directory.
|
||||
====
|
||||
|
||||
Reference in New Issue
Block a user