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

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

Merged
merged 6 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[alias]
xtask = "run --package xtask --"
50 changes: 34 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ readme = "README.md"
description = "A simple portable multimedia layer to create apps or games easily"

[workspace]
members = ["crates/*"]
members = [
"crates/*",
"xtask"
]

[workspace.package]
version = "0.12.1"
Expand Down
1 change: 0 additions & 1 deletion scripts/build_docs.ps1

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/build_docs.sh

This file was deleted.

19 changes: 0 additions & 19 deletions scripts/build_msvc_examples.ps1

This file was deleted.

36 changes: 0 additions & 36 deletions scripts/build_web_examples.ps1

This file was deleted.

28 changes: 1 addition & 27 deletions scripts/build_web_examples.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1 @@
#!/bin/bash
mkdir -p ./docs/examples/assets
cp -R ./examples/assets ./docs/examples

doc_body="<ul>\n"

compile() {
f=$1
f=${f/\.\/examples\//""}
f=${f/.rs/""}
./scripts/web_example.sh $f --release --no-assets

url="examples/${f}.html"
image="examples/images/${f}.jpg"
doc_body="${doc_body}\n<li><a href=\"${url}\"><div class=\"example-image\"><img src=\"${image}\" alt=\"${f}\"></div><div class=\"example-link\">${f}</div></a></li>"
}

for f in ./examples/*.rs; do
compile "$f"
done

wait

doc_body="${doc_body}\n</ul>"
cp ./scripts/docs.html ./docs/index.html
index=$(sed "s#{{ BODY }}#${doc_body}#g" "./scripts/docs.html")
echo "${index}" > ./docs/index.html
cargo xtask examples web --release
22 changes: 0 additions & 22 deletions scripts/msvc_example.ps1

This file was deleted.

38 changes: 0 additions & 38 deletions scripts/web_example.ps1

This file was deleted.

33 changes: 0 additions & 33 deletions scripts/web_example.sh

This file was deleted.

18 changes: 18 additions & 0 deletions xtask/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "xtask"
version = "0.1.0"
publish = false
authors.workspace = true
edition.workspace = true
homepage.workspace = true
repository.workspace = true
license.workspace = true
readme = "README.md"
description = ""

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
flate2 = "1.0"
fs_extra = "1.3.0"
xflags = "0.3.2"
4 changes: 4 additions & 0 deletions xtask/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
xtask
===

Adds useful development commands using xtask. Use the command `cargo xtask` to show the help.
File renamed without changes.
File renamed without changes.
Loading
Loading