/cargo-make-tasks

Reusable makefiles for cargo-make

Apache License 2.0Apache-2.0

cargo-make-tasks

Release license

Reusable makefiles for cargo-make.

Overview

The cargo-make-tasks repository contains makefiles with tasks specific for a programing language or environment.
While cargo-make comes with many built in tasks, those are either generic tasks (such as git actions) or specific for rust (such as cargo actions).
However, this repository aims to provide additional tasks that can be used as is for projects that have different requirements.

The following example Makefile.toml does the following:

  • Pulls the cmake.toml from the cargo-make-tasks repository
  • Pulls several generic tomls from cargo-make repository (git, github and toml)
  • Loads all makefiles so all tasks defined in them are now available
# Include the requested makefile (in this example, cmake.toml) and optionally also
# other generic makefiles from cargo-make directly.
extend = [
  { path = "./target/cargo-make/build-file.toml" },
  { path = "./target/cargo-make/git.toml" },
  { path = "./target/cargo-make/github.toml" },
  { path = "./target/cargo-make/toml.toml" },
  { path = "./target/cargo-make/cmake.toml" }
]

[config]
load_script = '''
#!@duckscript
# setup directory for external makefiles
mkdir ./target/cargo-make

# load the makefile from the cargo-make-tasks repository (in this example, cmake.toml)
file = set cmake
file_path = set ./target/cargo-make/${file}.toml
if not is_file ${file_path}
  content = http_client --method GET https://raw.githubusercontent.com/sagiegurari/cargo-make-tasks/master/src/${file}.toml
  writefile ${file_path} ${content}
end

# Optionally, load additional generic makefiles from cargo-make repository
files = array build-file git github toml
for file in ${files}
  file_path = set ./target/cargo-make/${file}.toml
  if not is_file ${file_path}
    content = http_client --method GET https://raw.githubusercontent.com/sagiegurari/cargo-make/master/src/lib/descriptor/makefiles/${file}.toml
    writefile ${file_path} ${content}
  end
end
release ${files}
'''

Contributing

See contributing guide

Release History

See Changelog

License

Developed by Sagie Gur-Ari and licensed under the Apache 2 open source license.