[tasks.all] dependencies = [ "build", "tarpaulin", "rpm", "deb" ] [tasks.linux] dependencies = [ "build", "test", "rpm", "deb" ] [tasks.rpm] dependencies = [ "tar", "spec", "rpmbuild" ] [tasks.deb] dependencies = [ "control", "debsetup", "dpkg" ] [tasks.windows] dependencies = [ "build", "test", "zip" ] [tasks.build] args = ["build", "--release"] [tasks.test] args = ["test"] [tasks.tarpaulin] command = "cargo" args = ["tarpaulin", "-v", "--exclude-files", "learning/*.rs"] [tasks.tar] script = [ "mkdir -p ~/rpmbuild/SOURCES", "VERSION=`awk -F\\\" '/^version/{print $2}' Cargo.toml`", "tar czf ~/rpmbuild/SOURCES/diskspace-${VERSION}.tgz LICENSE README.md man/ds.1 target/release/ds", ] [tasks.spec] script = [ "mkdir -p ~/rpmbuild/SPECS", "VERSION=`awk -F\\\" '/^version/{print $2}' Cargo.toml`", "sed -e 's!@@VERSION@@!'${VERSION}'!' .rpm/diskspace.spec > ~/rpmbuild/SPECS/diskspace.spec" ] [tasks.rpmbuild] script = [ "rpmbuild -bb ~/rpmbuild/SPECS/diskspace.spec 2>&1| grep ^Wrote" ] [tasks.control] script = [ "VERSION=`awk -F\\\" '/^version/{print $2}' Cargo.toml`", "mkdir -p target/release/diskspace-${VERSION}/DEBIAN", "sed -e 's!@@VERSION@@!'${VERSION}'!' .deb/control > target/release/diskspace-${VERSION}/DEBIAN/control" ] [tasks.debsetup] script = [ "VERSION=`awk -F\\\" '/^version/{print $2}' Cargo.toml`", "mkdir -p target/release/diskspace-${VERSION}/usr/bin", "mkdir -p target/release/diskspace-${VERSION}/usr/share/doc/packages/diskspace", "install -m 755 target/release/ds target/release/diskspace-${VERSION}/usr/bin", "install -m 755 README.md target/release/diskspace-${VERSION}/usr/share/doc/packages/diskspace/", "install -m 755 LICENSE target/release/diskspace-${VERSION}/usr/share/doc/packages/diskspace/", ] [tasks.dpkg] script = [ "VERSION=`awk -F\\\" '/^version/{print $2}' Cargo.toml`", "dpkg-deb -b target/release/diskspace-${VERSION}" ] [tasks.zip] description = "Zips up the release binary, README, and license(s)" category = "Publish" script = [ "powershell -executionPolicy bypass -file .zip/zip.ps1" ]