Greg Magolan
18ae5a89a6
fix: allow copy_to_directory to have an empty srcs list ( #871 )
2024-06-21 11:33:00 -06:00
Greg Magolan
602b7b8f80
Revert: feat: expose a config_setting for copy execution_requirements ( #606 ) ( #640 )
2023-10-31 15:19:38 -07:00
Douglas Parker
323329f119
fix: always include files from the same workspace as the build target in copy_to_directory()
( #360 )
...
* fix: always include files from the same workspace as the build target in `copy_to_directory`
Fixes #359 .
This updates the `copy_to_directory` tool to accept a workspace name representing the workspace of the target it is executing under. Any files in this workspace are automatically included, regardless of the `include_external_repositories` option. This makes it support usage within an external target (such as `@wksp//:dir`).
* test: add e2e test which uses `copy_to_directory` within an external workspace
Refs #359 .
This should catch regressions where no files are copied when built within an external workspace and not using `include_external_repositories`.
* ci: fix stray workspace refs
---------
Co-authored-by: Alex Eagle <alex@aspect.dev>
2023-10-10 10:57:08 -07:00
Alex Eagle
4bfe55711a
feat: expose a config_setting for copy execution_requirements ( #606 )
...
* feat: expose a config_setting for copy execution_requirements
Fixes #604
* chore: add user docs
* chore: improve docs
* chore: better link to copy_file
2023-10-09 13:57:34 -07:00
Greg Magolan
1cd2eb7e0a
refactor: remove exclude_prefixes from copy_to_directory and copy_to_directory_bin_action ( #591 )
2023-10-06 10:17:33 -07:00
Greg Magolan
cb9b74f41e
refactor: remove to_workspace_path and to_manifest_path ( #590 )
2023-10-06 08:37:53 -07:00
Derek Cormier
dca2b1df0c
chore: remove legacy copy_to_directory_action ( #582 )
2023-10-05 15:52:37 -07:00
Alex Eagle
e00ea2b977
chore: update pre-commit buildifier ( #563 )
...
It needs to match the one CI runs in
https://github.com/aspect-build/bazel-lib/actions/runs/6357283303/job/17268197322
2023-09-29 14:42:33 -07:00
Alex Eagle
1df2becc7a
chore: turn on more basic precommit checks
...
In particular this makes our bazelrc presets more compliant with client codebases, ensuring they can copy these files and not trip on their own pre-commit check
2023-02-17 11:00:00 -08:00
Alex Eagle
bda8e69ea0
chore: fix spelling
2023-02-15 09:08:46 -08:00
Jason Bedard
05a92b8b99
fix: show directory being copied to in copy_to_directory progress message ( #345 )
...
* fix: use formatted short_path in copy progress messages
* fix: display destination directory in copy_to_directory progress message
2023-02-05 20:47:02 -08:00
Greg Magolan
63f5aff803
feat: hardlink generated files in copy_to_directory and copy_directory instead of copying ( #321 )
2023-01-16 17:19:13 -08:00
Greg Magolan
1d3f04f7b9
chore: cleanup copy_to_directory docs and expose attr docstrings via lib for use downstream ( #330 )
2023-01-15 13:24:15 -08:00
Greg Magolan
7b6c814e27
Add copy_directory binary tool ( #324 )
2023-01-14 15:51:01 -08:00
Greg Magolan
fb3ef6e45d
feat: improved copy_to_directory performance & globbing support using copy_to_directory_bin_action ( #311 )
2023-01-07 11:26:27 -08:00
Greg Magolan
bf76da829c
fix: handle directory symlinks in copy_to_directory_bin_action tool binary ( #314 )
2023-01-06 10:29:45 -08:00
Greg Magolan
ec13ec9a69
feat: improve performance of copy_to_directory by moving glob match & copying to a golang binary ( #308 )
2023-01-03 09:42:20 -08:00
Greg Magolan
9077a147c0
fix: fix copy_to_directory flattening with root_paths = ['**'] ( #277 )
2022-11-07 18:28:04 -08:00
Greg Magolan
1f76b0b0bb
chore: nit cleanup in copy_to_directory _longest_glob_match helper ( #275 )
2022-11-03 09:42:03 -07:00
Jason Bedard
350408b93d
perf: do not execute glob for non-glob copy_to_directory root_paths/replace_prefix params ( #274 )
...
* glob: add is_glob util method
* perf: do not execute glob for non-glob copy_to_directory root_paths/replace_prefix params
* perf: add common path matching shortcuts
* fix: disallow invalid empty glob expressions
2022-11-02 18:44:42 -07:00
Greg Magolan
65e852f774
fix: don't generate @aspect_bazel_lib_local_config_platform repository as it is a leaky abstraction for rule consumers and not just rule authors ( #243 )
2022-09-13 21:58:08 -07:00
Greg Magolan
bbfb74c8e6
fix: fix host platform detection on all copy actions which always run locally ( #241 )
2022-09-12 20:45:48 -07:00
Jason Bedard
803dbf815e
copy_to_directory performance improvements ( #236 )
...
* reduce use of depset.to_list()
* avoid copying arrays when invoking copy_file
* fixup! reduce use of depset.to_list()
* fixup! reduce use of depset.to_list()
2022-09-12 18:01:25 -07:00
Greg Magolan
9efedb72c0
fix: handle the ** root_path case correctly in copy_to_directory
2022-08-25 21:25:13 -07:00
Greg Magolan
3e20e6c0b1
fix: fix issue in copy_to_directory where root_path is the full path of a directory input
2022-08-18 21:14:12 -07:00
Greg Magolan
3caff577b9
fix: handle copy_to_directory '.' and './**' special patterns correctly when in the root package ( #212 )
2022-08-11 16:25:51 -07:00
Greg Magolan
165d7dafdb
chore: normalize src and outputs paths in copy_to_directory ( #206 )
2022-08-01 13:14:18 -07:00
Greg Magolan
06d54eef4c
fix: improve handling of duplicate files in copy_to_directory ( #205 )
2022-08-01 09:56:52 -07:00
Greg Magolan
c4f6fcff42
fix: add missing convienence aliases to exclude_srcs_packages
2022-07-29 18:52:54 -07:00
Greg Magolan
01da4db80c
fix: add missing convienence aliases to include_srcs_packages
2022-07-29 18:52:54 -07:00
Greg Magolan
6d3c1a393b
chore: add improved error messages to copy_to_directory when include_srcs_packages and include_srcs_patterns are empty
2022-07-29 18:52:54 -07:00
Greg Magolan
71910e93f3
feat: add include_srcs_packages and exclude_srcs_packages and improve implementation and documentation of other filters and transformations ( #203 )
2022-07-29 16:16:33 -07:00
Greg Magolan
83912625a3
chore: fix out-of-date text in copy_to_directory.include_srcs_patterns docstring ( #202 )
2022-07-28 23:31:08 -07:00
Greg Magolan
c74f0e29a6
chore: fix out-of-date text in copy_to_directory.include_srcs_patterns docstring: ( #201 )
2022-07-28 23:13:22 -07:00
Greg Magolan
a5e61b3961
fix: dedup additional files in copy_to_directory_action ( #200 )
2022-07-28 20:39:12 -07:00
Greg Magolan
85e8b7e555
feat: add glob support to copy_to_directory include_srcs_patterns, exclude_srcs_patterns, replace_prefixes and root_paths. ( #196 )
...
This deprecates exclude_prefixes with docs suggesting to using exclude_srcs_patterns instead
2022-07-28 12:50:41 -07:00
Greg Magolan
61c7cc209b
feat: add include_prefixes to copy_to_directory ( #193 )
2022-07-27 15:15:42 -07:00
Greg Magolan
d4f6524fbd
feat: add copy_to_directory_action
2022-06-28 09:08:45 -07:00
Greg Magolan
6ba7c64c8d
feat: add allow_overwrites attribute to copy_to_directory and disable overwrites as the default behavior on linux and macos ( #153 )
2022-06-14 10:52:40 -07:00
Alex Eagle
695a8c4ad4
fix: copy_to_directory repairs read-only file permissions ( #134 )
...
When two srcs have the same nested folder, we need to correct the permissions like bazel's sandbox would.
Fixes #133
2022-06-08 15:41:54 -07:00
Derek Cormier
faba95385d
fix: fix a bug where copy_to_directory wouldn't copy hidden files inside
...
of folders
2022-05-19 20:50:43 -07:00
Greg Magolan
58b2c59bb0
refactor: export copy_to_directory_lib in the public API for use downstream in packaging rules ( #96 )
2022-04-29 15:26:24 -07:00
Greg Magolan
9a9a1888e1
chore: normalize @generated by comments ( #93 )
2022-04-29 00:49:15 -07:00
Greg Magolan
f1e10df09c
chore: replace is_windows select pattern with target_platform_has_constraint pattern ( #95 )
2022-04-29 00:36:51 -07:00
Greg Magolan
d59ca6092f
fix: improve execution requirements of all copy files/directory rules for better perf ( #79 )
2022-04-14 10:48:44 -07:00
Greg Magolan
e679a26b42
fix: use -R instead of -r in cp calls so macos & linxu behavior is the same ( #58 )
2022-04-01 00:57:34 -07:00
Greg Magolan
0fd56dc59d
feat: add directory_path rule and DirectoryPathInfo for specifying files within tree artifacts ( #42 )
2022-03-03 16:40:32 -08:00
Derek Cormier
ca4a9f8c23
fix: fix buildifier 5.0.0 errors ( #35 )
2022-02-11 07:52:01 -08:00
Greg Magolan
40e25c0b37
fix: use robocopy in copy_file#is_directory and copy_to_directory ( #26 )
...
so we don't hit the file path length limit of xcopy
2022-01-27 04:57:52 -08:00
Greg Magolan
3bce8db100
fix: add windows implementation of copy_to_directory
2021-12-21 16:12:05 -08:00