Files
pkl/docs/modules/pkl-gradle/partials/gradle-modules-properties.adoc
Daniel Chao ce25cb8ef0 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.
2024-10-23 14:36:57 -07:00

76 lines
2.6 KiB
Plaintext

.sourceModules: ListProperty<Object>
[%collapsible]
====
Default: `[]` +
Example 1: `sourceModules = ["module1.pkl", "module2.pkl"]` +
Example 2: `+sourceModules = fileTree("config").include("**/*.pkl")+` +
List of Pkl modules which are used for this operation.
This property accepts the following types to represent a module:
* `java.net.URI`
* `java.io.File`
* `java.nio.file.Path`
* `java.net.URL`
* `java.lang.CharSequence` - if the represented string looks like a URI (it contains a scheme), the input is treated as a URI. Otherwise, it is treated as a path. Relative paths are resolved against the project directory.
* `org.gradle.api.file.FileSystemLocation`
====
.transitiveModules: ConfigurableFileCollection
[%collapsible]
====
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.
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.
====
.projectDir: DirectoryProperty
[%collapsible]
====
Default: `null` +
Example 1: `projectDir = layout.projectDirectory.dir("pkl")` +
Example 2: `projectDir.fileValue file("/some/absolute/path")`
Directory where the project lives.
A project is a directory that contains a `PklProject` file, which is used to declare package dependencies, as well as common evaluator settings to be applied in the project.
If `null`, this is determined by searching up from the working directory for a directory that contains a `PklProject` file, until `evalRootDir` or the file system root is reached.
====
.omitProjectSettings: Property<Boolean>
[%collapsible]
====
Disables loading evaluator settings from the PklProject file.
====
.noProject: Property<Boolean>
[%collapsible]
====
Disables all behavior related to projects.
====
.settingsModule: Property<Object>
[%collapsible]
====
Default: `null` +
Example: `settingsModule = layout.projectDirectory.file("mySettings.pkl")` +
The Pkl settings module to use.
This property accepts the same input types as the `sourceModules` property.
If `null`, `~/.pkl/settings.pkl` or defaults specified in the `pkl.settings` standard library module are used.
====
include::../partials/gradle-common-properties.adoc[]