mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Trying to shell out
This commit is contained in:
parent
8c005bb48d
commit
4274ac261f
5
Makefile
5
Makefile
@ -7,7 +7,8 @@ BINS = cargo-compile \
|
||||
cargo-rustc \
|
||||
cargo-verify-project
|
||||
|
||||
SRC = $(wildcard src/*.rs)
|
||||
SRC = $(shell find src -name '*.rs')
|
||||
|
||||
DEPS = -L libs/hammer.rs/target -L libs/rust-toml/lib
|
||||
TOML = libs/rust-toml/lib/$(shell rustc --crate-file-name libs/rust-toml/src/toml/lib.rs)
|
||||
HAMMER = libs/hammer.rs/target/$(shell rustc --crate-type=lib --crate-file-name libs/hammer.rs/src/hammer.rs)
|
||||
@ -32,7 +33,7 @@ $(HAMCREST): $(wildcard libs/hamcrest-rust/src/*.rs)
|
||||
|
||||
$(LIBCARGO): $(SRC)
|
||||
mkdir -p target
|
||||
$(RUSTC) $(RUSTC_FLAGS) --out-dir target src/cargo.rs
|
||||
$(RUSTC) $(RUSTC_FLAGS) --out-dir target src/cargo/mod.rs
|
||||
touch $(LIBCARGO)
|
||||
|
||||
libcargo: $(LIBCARGO)
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 894fdd9db6c50b9a70d1fc7d4e49c76e86921016
|
||||
Subproject commit 1389ceb42b2ae04dac40c8b2d4af8fe21823ecbc
|
@ -1,3 +1,4 @@
|
||||
#[crate_id="cargo"];
|
||||
#[crate_type="rlib"];
|
||||
|
||||
extern crate serialize;
|
1
src/cargo/util/mod.rs
Normal file
1
src/cargo/util/mod.rs
Normal file
@ -0,0 +1 @@
|
||||
pub use self::process::process;
|
25
src/cargo/util/process.rs
Normal file
25
src/cargo/util/process.rs
Normal file
@ -0,0 +1,25 @@
|
||||
use std::os;
|
||||
use std::io::process::{Process,ProcessConfig,InheritFd};
|
||||
|
||||
pub struct ProcessBuilder {
|
||||
program: ~str,
|
||||
args: ~[~str],
|
||||
path: ~[~str]
|
||||
}
|
||||
|
||||
impl ProcessBuilder {
|
||||
fn args(mut self, arguments: &[~str]) -> ProcessBuilder {
|
||||
self.args = arguments.clone();
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
pub fn process(cmd: &str) -> ProcessBuilder {
|
||||
ProcessBuilder { program: cmd.to_owned(), args: ~[], path: get_curr_path() }
|
||||
}
|
||||
|
||||
fn get_curr_path() -> ~[~str] {
|
||||
os::getenv("PATH").map(|path| {
|
||||
path.split(std::path::SEP).collect()
|
||||
}).or(~[])
|
||||
}
|
@ -13,7 +13,7 @@ test!(cargo_compile_with_explicit_manifest_path {
|
||||
version = "0.5.0"
|
||||
authors = ["wycats@example.com"]
|
||||
|
||||
[[lib]]
|
||||
[[bin]]
|
||||
|
||||
name = "foo"
|
||||
"#)
|
||||
@ -23,6 +23,12 @@ test!(cargo_compile_with_explicit_manifest_path {
|
||||
}"#)
|
||||
.build();
|
||||
|
||||
cargo::util::process("cargo-compile")
|
||||
.args([]);
|
||||
// //.extra_path("target/")
|
||||
// //.cwd("/foo/bar")
|
||||
// //.exec_with_output()
|
||||
|
||||
fail!("not implemented");
|
||||
// 1) Setup project
|
||||
// 2) Run cargo-compile --manifest-path /tmp/bar/zomg
|
||||
|
Loading…
x
Reference in New Issue
Block a user