Skip to content

Commit

Permalink
Merge pull request #32 from lalbuild/travis-and-list-supported
Browse files Browse the repository at this point in the history
Travis and list supported
  • Loading branch information
clux authored Dec 14, 2017
2 parents 974ab62 + 4f33c1f commit 4d46a02
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ before_script:
- export RUST_BACKTRACE=full
script:
- cargo clean
- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then cargo build; fi
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then docker run --rm -v $PWD:/volume -w /volume -t clux/muslrust cargo build --release; fi
- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then cargo test; fi
- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then cargo doc --no-deps; fi
- if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then cargo build; fi
- if [ "$TRAVIS_EVENT_TYPE" = "push" ]; then docker run --rm -v $PWD:/volume -w /volume -t clux/muslrust cargo build --release; fi
- if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then cargo test; fi
- if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then cargo doc --no-deps; fi
notifications:
email:
on_success: change
Expand All @@ -41,7 +41,7 @@ deploy:
api_key:
secure: jo7upaSy/Suepldw8OAjFhIl0y0xdIrd5W0WS7XMNCtHk3QC+iUSGiqlmZ/uQPp0IW5v8cTKVGyQ5bW66eUj8yLbw1QOwGUKdVF33jdZA1kAwY0baxcZCkbeEbWUiDKMRSJ/kr/AqFKgVJVLBcPhqGmHHmfK+m8RuVSI2ioUrW3hYdLUT35xws4wOdgQiEuKOn6EGUsFaulNj6LJWfl9jYmCUFX55UmMU/VIQiwCEMSCBin739BwHXBDNLwJEgHR9VHceSaBWsazOW6roT9gE6FdUqMGkjiK9vOBgTp9LElfK/4RO30TJ7Nz4EYz3/PoQzNrB3TMMBRtD14I8BnWRGeNKlFwUCXoPWnEeVuyurNQLLb0KiV4+JoxYQ1614pwaIwiz1wMf2yGMswc7VT89KqGGV18saVcQJaPOWSjsNyySWjK0FSMIAyCX5qzixFmvgfPu6Jf9/A2Wd5v6oJypo9i4n4x63UjXXuH/dOeg49V/QlM3py0CsztlUNRypb0NyFOBlYGJerAkKuTSW3Fh3fjte3GS+ze3rzC//ADYowG9R1mJdrpM48busoOzwzytgRHXAAXq0CFlWEw5a/Ly+iES2f3yQbGqx0/ZLIb5oZqlXsv3iEEczhokPiK74Psc/7yG7Mn5+Vjndb1AGcZ6gmNfGFRy4WWcaUFZ/b23VA=
after_script: |
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
if [ "$TRAVIS_EVENT_TYPE" = "push" ] && [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
bash <(curl -sSL https://raw.githubusercontent.com/xd009642/tarpaulin/master/travis-install.sh)
sudo chown -R $USER:$USER target
cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID
Expand Down
4 changes: 2 additions & 2 deletions lal.complete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _lal()

local -r subcommands="build clean configure export fetch help init script run ls
query remove rm shell stash save status update upgrade verify
publish env list-components list-dependencies
publish env list-components list-supported-environments list-dependencies
list-environments list-configurations propagate"

local has_sub
Expand Down Expand Up @@ -77,7 +77,7 @@ _lal()
[[ $in_lal_repo ]] || return 0
local -r env_subs="set reset update help -h --help"
if [[ $prev = "set" ]]; then
local -r envs="$(lal list-environments)"
local -r envs="$(lal list-supported-environments)"
COMPREPLY=($(compgen -W "$envs" -- "$cur"))
else
COMPREPLY=($(compgen -W "$env_subs" -- "$cur"))
Expand Down
8 changes: 8 additions & 0 deletions src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ pub fn buildables(manifest: &Manifest) -> LalResult<()> {
Ok(())
}

/// Print the supported environments from the `Manifest`
pub fn supported_environments(manifest: &Manifest) -> LalResult<()> {
for env in &manifest.supportedEnvironments {
println!("{}", env);
}
Ok(())
}

/// Print the available configurations for a buildable Component
pub fn configurations(component: &str, manifest: &Manifest) -> LalResult<()> {
let component_settings = match manifest.components.get(component) {
Expand Down
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ fn handle_environment_agnostic_cmds(args: &ArgMatches, mf: &Manifest, backend: &
a.is_present("time"))
} else if args.subcommand_matches("list-components").is_some() {
lal::list::buildables(mf)
} else if args.subcommand_matches("list-supported-environments").is_some() {
lal::list::supported_environments(mf)
} else if let Some(a) = args.subcommand_matches("list-configurations") {
lal::list::configurations(a.value_of("component").unwrap(), mf)
} else if let Some(a) = args.subcommand_matches("list-dependencies") {
Expand Down Expand Up @@ -508,6 +510,9 @@ fn main() {
.subcommand(SubCommand::with_name("list-components")
.setting(AppSettings::Hidden)
.about("list components that can be used with lal build"))
.subcommand(SubCommand::with_name("list-supported-environments")
.setting(AppSettings::Hidden)
.about("list supported environments from the manifest"))
.subcommand(SubCommand::with_name("list-environments")
.setting(AppSettings::Hidden)
.about("list environments that can be used with lal build"))
Expand Down

0 comments on commit 4d46a02

Please sign in to comment.