Skip to content

Commit

Permalink
Add binaries to bin/
Browse files Browse the repository at this point in the history
Add devtool with build target
Add openssl as vendored dependency for cross-rs/cross#229
  • Loading branch information
spoorn committed Aug 29, 2022
1 parent 30069b4 commit 63c5d5d
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ serde_json = "1.0.85"
slice-deque = "0.3.0"
lazy_static = "1.4.0"
regex = "1.6.0"
# Cross removed openssl from their docker: https://github.com/cross-rs/cross/issues/510. This is a workaround.
openssl = { version = "0.10", features = ["vendored"] }
Binary file added bin/reddit_notifier
Binary file not shown.
Binary file added bin/reddit_notifier.exe
Binary file not shown.
30 changes: 30 additions & 0 deletions devtool
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

# Note: If developing on windows, you might need to run this command to get rid of /r in this script file:
# sed -i 's/\r$//' devtool
# Or make sure your git has autocrlf off: https://stackoverflow.com/questions/29045140/env-bash-r-no-such-file-or-directory

set -euo pipefail
set -x

install_cross() {
cargo install cross
}

build() {
install_cross

# TODO: Once output-dir is in stable release, use that instead of copying over binaries/executables
# Linux
cross build --release --target x86_64-unknown-linux-gnu
mv target/x86_64-unknown-linux-gnu/release/reddit_notifier bin/

# Windows
rustup target add x86_64-pc-windows-msvc # Installs the target
cross build --release --target x86_64-pc-windows-gnu
mv target/x86_64-pc-windows-gnu/release/reddit_notifier.exe bin/
}

# Comment set +x out to show commands run
set +x
$@

0 comments on commit 63c5d5d

Please sign in to comment.