Skip to content

Test framework: support directory resources#8377

Merged
sovdeeth merged 5 commits intoSkriptLang:dev/featurefrom
devdinc:copy-dir-resources
Jan 29, 2026
Merged

Test framework: support directory resources#8377
sovdeeth merged 5 commits intoSkriptLang:dev/featurefrom
devdinc:copy-dir-resources

Conversation

@devdinc
Copy link
Copy Markdown

@devdinc devdinc commented Jan 16, 2026

Problem

Directory resources are not copied correctly. When using skript-test-action with skript-reflect, custom libraries or nested resources cannot be used because only single files were being copied. This causes missing dependencies or incomplete builds.

Solution

The code now recursively copies directories and all their contents while preserving the directory structure.

  • Checks if a resource is a directory.
  • Uses Files.walk to traverse all nested files and subdirectories.
  • Creates necessary directories before copying files.
  • Falls back to previous single-file behavior if the resource is a file.

This ensures that both single files and full directory resources are copied correctly into the environment, allowing custom libraries to be used without issues.

Testing Completed

  • Manual review and testing were performed by me, skript-test-action workflow run can be seen in this devdinc/skripts repository.
  • Verified that nested directories and files are copied correctly.
  • Confirmed that existing files are replaced without errors.

Supporting Information

  • No breaking changes; backwards compatible with single-file resources.
  • Minor patch; does not change public API or behavior outside resource copying.
  • Outstanding: none.

Completes: none
Related: none
AI assistance: chatgpt (used for drafting PR description and writing the code; manual review and testing performed by author)

@devdinc devdinc requested review from a team as code owners January 16, 2026 12:42
@devdinc devdinc requested review from Pesekjak and UnderscoreTud and removed request for a team January 16, 2026 12:42
@devdinc devdinc changed the base branch from master to dev/patch January 16, 2026 13:28
@devdinc
Copy link
Copy Markdown
Author

devdinc commented Jan 16, 2026

On a second thought, its not really a bug fix so will change base branch to feature.

@devdinc devdinc changed the base branch from dev/patch to dev/feature January 16, 2026 15:58
@sovdeeth
Copy link
Copy Markdown
Member

Please fill out the solution part of the PR template (and perhaps elaborate on ai usage?)

@sovdeeth sovdeeth added the feature Pull request adding a new feature. label Jan 16, 2026
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Jan 16, 2026
@devdinc
Copy link
Copy Markdown
Author

devdinc commented Jan 16, 2026

Please fill out the solution part of the PR template (and perhaps elaborate on ai usage?)

@sovdeeth
Alright edited the original description. Didn't find necessary to do so at the beginning, since the changes were small and quite easy to understand, my bad.

@sovdeeth
Copy link
Copy Markdown
Member

Please fill out the solution part of the PR template (and perhaps elaborate on ai usage?)

@sovdeeth Alright edited the original description. Didn't find necessary to do so at the beginning, since the changes were small and quite easy to understand, my bad.

No worries! You're right they're easy to understand, but part of the reason we ask for the solution section is to ensure the code actually does what the PR author intended it to do. It's unlikely that that's the case here, but it's just good to be sure :)

@skriptlang-automation skriptlang-automation bot added feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. and removed needs reviews A PR that needs additional reviews labels Jan 16, 2026
Copy link
Copy Markdown
Member

@Pesekjak Pesekjak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, I would consider using Files#walkFileTree to allow the IOException to be thrown directly

@devdinc
Copy link
Copy Markdown
Author

devdinc commented Jan 24, 2026

looks good, I would consider using Files#walkFileTree to allow the IOException to be thrown directly

I am not a fan of having to introduce an anonymous FileVisitor just to achieve this, but alright.

@devdinc devdinc requested a review from Pesekjak January 24, 2026 19:32
@Pesekjak
Copy link
Copy Markdown
Member

it is more verbose but definitely a better option here, good job

@sovdeeth sovdeeth merged commit 27850e5 into SkriptLang:dev/feature Jan 29, 2026
13 of 21 checks passed
@skriptlang-automation skriptlang-automation bot added the completed The issue has been fully resolved and the change will be in the next Skript update. label Jan 29, 2026
@skriptlang-automation skriptlang-automation bot removed the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Jan 29, 2026
@devdinc devdinc deleted the copy-dir-resources branch January 29, 2026 06:43
sovdeeth pushed a commit to sovdeeth/Skript that referenced this pull request Feb 9, 2026
* Test framework: support directory resources

* use walkFileTree

* oops forgot imports
sovdeeth added a commit that referenced this pull request Apr 2, 2026
* Add Origin-applying SyntaxRegistry (#8376)

* Add reduce/fold Expression (#8353)

* Location with Yaw/Pitch (#8351)

* Test framework: support directory resources (#8377)

* Test framework: support directory resources

* use walkFileTree

* oops forgot imports

* Pattern Stringification Customization (#8391)

* Implement StringificationProperties

* Package cleanup

* Fix missing call in GroupPatternElement stringification (#8449)

Fix GroupPatternElement stringification

* Stabilise damage source experiment (#8414)

* Stabilise damage source experiment

* Replace STABLE with MAINSTREAM

* Remove experiment from damage source test

* Remove unstable API usage supression

---------

Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>

* Add vector(n) (#8412)

* Init commit

* Fix not registering overloading for old namespaces

* Standardize Module usage + add child modules (#8346)

* child module support

* Create child modules and move over existing Bukkit addon modules.

* Update newer modules

* Clean up

* Requested changes and additional conversions

Just tags left!

* convert last module

* standardize package hierarchies

* remove bad imports

* fix bad examples

* Replace ChildAddonModule with HierarchicalAddonModule, move display/interaction modules into entity module, few other requested changes

* requested changes

* varargs registrar (thanks blue!)

* Use addonmodule javadocs to point to other useful tools

* Requested Changes

* Requested Changes

* Added option to compress file backups (#8396)

* Add fast path for integer strings in variable name comparator (#8483)

* Initial conversion

* Some more conversion

* fixes

* Update StructCommand.java

* no tests

---------

Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
Co-authored-by: mibers <midaswoah2@gmail.com>
Co-authored-by: _tud <98935832+UnderscoreTud@users.noreply.github.com>
Co-authored-by: devdinc <234956748+devdinc@users.noreply.github.com>
Co-authored-by: Tiberiu Sabău <96194994+tibisabau@users.noreply.github.com>
Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
Co-authored-by: Pesek <42549665+Pesekjak@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

completed The issue has been fully resolved and the change will be in the next Skript update. feature Pull request adding a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants