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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved the scripts used for example and doc building to xtask #321

Merged
merged 6 commits into from
Jun 8, 2024

Conversation

Rzial
Copy link
Collaborator

@Rzial Rzial commented Mar 28, 2024

This PR handles #319 and allows to handle cross-platform compilation without major overhead in terms of script maintenance.

For now I've only added the building scripts but we may add the others in the future:

  • publish.sh
  • take_screenshots.sh
  • upgrade.sh

I've tested Windows on MSVC and Web targets and it works pretty fine. Seems the same for Linux but I would like some external confirmation since is not my main dev scene for Notan and I might had some overlook.

P.S.: This is one of my firsts Rust code contributions so there may be some flaws in codewritting/codestyle. If there is any feedback I'm open to it 馃槃

@Rzial Rzial requested a review from Nazariglez March 28, 2024 07:50
@Nazariglez
Copy link
Owner

Hey! I was out for a few days (Spain holidays), let me settle and I'll come back to this in a few days! thanks!

@Nazariglez
Copy link
Owner

This is pretty nice, I love the cargo xtask example web. However I think I am doing something wrong, if I do in the develop branch: ./scripts/build_examples.sh then I can do http-server ./docs and I see the index with all the examples linked. When I do the xtask then the ./docs folder has the examples under a subdirectory docs/web_examples/release/examples, and no index. I am on a new machine so I am probably missing something.

Something that I saw is that if you don't have wasm-bindgen-cli and wasm-opt installed then the task succeed but without output files. This is fine though, we can add to the readme this (this deps are needed for the bash script too), although eventually would be cool to have an error if the deps are not there.

@Rzial
Copy link
Collaborator Author

Rzial commented Apr 6, 2024

Hmm 馃

For me, when i execute cargo xtask examples web it outputs an index.html at the root of the docs/web_examples/release folder. Maybe there is something related to paths?

Can you check which output gives to you the value in xtask/src/cli_examples_web.rs:58?

docs_web_dir(release, "").join("index.html")

About checking if some of the tools are available when trying to compile, thats something I can totally do.

P.S: I took the decision to move everything related to examples from ``./docs/HEREto./docs/TARGET_examples/HERE` being TARGET values like `msvc` and `web`. The reason behind this is because we you do both tests you get a lot of mixed up files that are not really related. I can revert this if its not desired.

@Nazariglez Nazariglez linked an issue Jun 8, 2024 that may be closed by this pull request
Copy link
Owner

@Nazariglez Nazariglez left a comment

Choose a reason for hiding this comment

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

LGTM!

@Nazariglez
Copy link
Owner

Hey @Rzial, sorry for the delay (once again). The web build command is used to generate this: https://github.com/Nazariglez/notan-web/tree/main/docs, which is the examples page online, so the output should matches that structure. I made some minor changes (mainly directory changes and clippy fixes) and rebased from develop to keep the branch updated.

I hope this is fine with you. Thanks you so much for allocating the time and the effort to make this!

@Nazariglez Nazariglez merged commit 5d3ac6f into Nazariglez:develop Jun 8, 2024
1 check passed
@Nazariglez Nazariglez mentioned this pull request Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Window bash scripts (powershell)
2 participants