When a directory created dy ctx.actions.declare_directory is referred to in a sandbox, if it is empty, or a subdirectory of it is empty, the empty directory won't be created in the sandbox. These functions resolve the problem by also recording the directory structure in a text file.
Return the list of declared File objects in a directory_with_structure.
PARAMETERS
| Name | Description | Default Value |
|---|---|---|
| directory_with_structure | - | none |
PARAMETERS
| Name | Description | Default Value |
|---|---|---|
| obj | - | none |
The replacement of ctx.actions.declare_directory that also preserves empty directories.
Return a struct with the following fields: - directory: A File object from ctx.actions.declare_directory. - structure_file: A File object that will the directory structure.
PARAMETERS
| Name | Description | Default Value |
|---|---|---|
| ctx | ctx | none |
| filename | See ctx.actions.declare_directory. | none |
Return a command that records the directory structure to the structure_file.
It is expected that the shell has properly set up hermetic tools.
PARAMETERS
| Name | Description | Default Value |
|---|---|---|
| directory_with_structure | struct returned by directory_with_structure.declare. | none |
Return a command that restores a directory_with_structure.
It is expected that the shell has properly set up hermetic tools.
PARAMETERS
| Name | Description | Default Value |
|---|---|---|
| directory_with_structure | struct returned by declare_directory_with_structure. | none |
| dst | a string containing the path to the destination directory. | none |
| options | a string containing options to rsync. If None, default to "-a". | None |