Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke post_compile hook before install and add pre/post_install hooks #68

Merged
merged 3 commits into from
Jan 19, 2022
Merged

Conversation

seeppp
Copy link

@seeppp seeppp commented Jan 18, 2022

Changing time of hook execution

This PR moves the invocation of the post_compile script up some lines, right after swift-compile has completed and before swift-install is executed.

It also adds a pre_install and a post_install hook too.

Description

I have a task which must be executed against the .build folder. Mainly a script that copies the /Resources/* folder out of a dependent package. (I'm using Leaf in a dependency, but Leaf is unable to render files that are packaged with SPM in a dependency).

Therefore, I tried a post_compile script like cp -r $BUILD_DIR/.build/checkouts/repo/Resources .

But since the post_compile script is executed after swift-install, the .build folder is already gone. This PR resolves this case.

@vzsg
Copy link
Member

vzsg commented Jan 19, 2022

Thank you for the PR, I believe the expectation that post_compile runs after the compilation is completely legit.
Could you also touch the README and at least add the two new hooks to the list of hook scripts?

@seeppp
Copy link
Author

seeppp commented Jan 19, 2022

I just added the new hooks to the README.

@vzsg vzsg merged commit 4d11b09 into vapor-community:master Jan 19, 2022
@vzsg
Copy link
Member

vzsg commented Jan 19, 2022

Perfect, thank you. I'll release it to the buildpack registry in a moment.

EDIT: the vapor/vapor buildpack is now up to date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants