refactor: use starmelon for derive macros

infra/homer/examples was the start of my work on macros for Elm. I have
greatly refined these ideas in starmelon. Delete the multi step build
process and replace it with a single call to starmelon.
This commit is contained in:
YetAnotherMinion 2021-10-10 19:44:29 +01:00 committed by nobody
commit 0576ae168a
Signed by: GrocerPublishAgent
GPG key ID: D460CD54A9E3AB86
4 changed files with 28 additions and 4 deletions

2
always-rebuild.do Normal file
View file

@ -0,0 +1,2 @@
redo-always
redo-ifchange release

4
release.do Normal file
View file

@ -0,0 +1,4 @@
redo-ifchange Cargo.toml
find src/ -type f | xargs redo-ifchange
cargo build --release

View file

@ -446,10 +446,21 @@ globalThis.runOnInput = function(data) {
// now. Another way to do this would be with an Arc. This will panic if the // now. Another way to do this would be with an Arc. This will panic if the
// mailbox is currently borrowed // mailbox is currently borrowed
match mailbox.replace(None) { match mailbox.replace(None) {
Some(Ok(output)) => { Some(Ok(buffer)) => {
io::stdout() match output {
.write_all(&output) None => {
.map_err(|io_err| CompilerError::WriteOutputFailed(io_err, "stdout".into()))?; io::stdout()
.write_all(&buffer)
.map_err(|io_err| CompilerError::WriteOutputFailed(io_err, "stdout".into()))?;
},
Some(filename) => {
let mut f = fs::File::create(&filename)
.map_err(|io_err| CompilerError::WriteOutputFailed(io_err, filename))?;
f.write_all(&buffer)
.map_err(|io_err| CompilerError::WriteOutputFailed(io_err, "stdout".into()))?;
}
}
} }
Some(Err(problem)) => { Some(Err(problem)) => {
println!("had a problem {}", problem); println!("had a problem {}", problem);

7
starmelon-binary.do Normal file
View file

@ -0,0 +1,7 @@
if test -f ../../target/debug/gen-css-selectors; then
redo-ifchange always-rebuild
ls -al ../../../target/release/starmelon | redo-stamp
else;
cargo build --release
ls -al ../../../target/release/starmelon | redo-stamp
fi