use cargo::util::{CliResult, CliError, CargoError};
use cargo::util::important_paths::{find_root_manifest_for_cwd};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_no_run: bool,
flag_package: Option<String>,
use cargo::util::important_paths::{find_root_manifest_for_cwd};
use cargo::util::{CliResult, CliError};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_package: Option<String>,
flag_jobs: Option<uint>,
#![feature(phase, macro_rules)]
#![deny(warnings)]
-extern crate serialize;
+extern crate "rustc-serialize" as rustc_serialize;
#[phase(plugin, link)] extern crate log;
#[phase(plugin, link)] extern crate cargo;
use cargo::core::MultiShell;
use cargo::util::{CliError, CliResult};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Flags {
flag_list: bool,
flag_verbose: bool,
use cargo::util::{CliResult, CliError};
use cargo::util::important_paths::{find_root_manifest_for_cwd};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_package: Option<String>,
flag_target: Option<String>,
use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError, config};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct ConfigForKeyFlags {
flag_human: bool,
flag_key: String,
}
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
struct ConfigOut {
values: HashMap<String, config::ConfigValue>
}
use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError, config};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct ConfigListFlags {
flag_human: bool,
}
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
struct ConfigOut {
values: HashMap<String, config::ConfigValue>
}
use cargo::util::{CliResult, CliError};
use cargo::util::important_paths::{find_root_manifest_for_cwd};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_features: Vec<String>,
flag_jobs: Option<uint>,
use cargo::util::{CliResult, CliError};
use cargo::util::important_paths::find_root_manifest_for_cwd;
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_manifest_path: Option<String>,
flag_verbose: bool,
use cargo::util::{CliResult, CliError};
use cargo::util::important_paths::find_root_manifest_for_cwd;
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_manifest_path: Option<String>,
flag_verbose: bool,
use cargo::sources::git::{GitSource};
use cargo::util::{Config, CliResult, CliError, human, ToUrl};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_url: String,
flag_reference: String,
use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options;
pub const USAGE: &'static str = "
use cargo::util::{CliResult, CliError, human, Require};
use cargo::util::important_paths::{find_root_manifest_for_cwd};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct LocateProjectFlags {
flag_manifest_path: Option<String>,
}
-h, --help Print this message
";
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
struct ProjectLocation {
root: String
}
use cargo::sources::RegistrySource;
use cargo::util::{CliResult, CliError, Config};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_host: Option<String>,
arg_token: Option<String>,
use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_verbose: bool,
flag_bin: bool,
use cargo::core::MultiShell;
use cargo::util::{CliResult, CliError};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
arg_crate: Option<String>,
flag_token: Option<String>,
use cargo::util::{CliResult, CliError};
use cargo::util::important_paths::find_root_manifest_for_cwd;
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_verbose: bool,
flag_manifest_path: Option<String>,
use cargo::util::{CliResult, CliError};
use cargo::util::important_paths::{find_root_manifest_for_cwd};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_verbose: bool,
flag_manifest_path: Option<String>,
use cargo::util::{CliResult, CliError};
use cargo::util::important_paths::find_root_manifest_for_cwd;
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_host: Option<String>,
flag_token: Option<String>,
use cargo::util::{CliResult, CliError};
use cargo::sources::{PathSource};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_manifest_path: String,
}
use cargo::util::{CliResult, CliError, human};
use cargo::util::important_paths::{find_root_manifest_for_cwd};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_bin: Option<String>,
flag_example: Option<String>,
use cargo::core::{MultiShell};
use cargo::util::{CliResult, CliError};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
flag_host: Option<String>,
flag_verbose: bool,
use cargo::util::{CliResult, CliError, CargoError};
use cargo::util::important_paths::{find_root_manifest_for_cwd};
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
arg_args: Vec<String>,
flag_features: Vec<String>,
use cargo::util::{CliResult, CliError};
use cargo::util::important_paths::find_root_manifest_for_cwd;
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
arg_spec: Option<String>,
flag_package: Option<String>,
pub type Error = HashMap<String, String>;
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Flags {
flag_manifest_path: String,
flag_verbose: bool,
use cargo::core::MultiShell;
use cargo::util::CliResult;
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options;
pub const USAGE: &'static str = "
use cargo::util::{CliResult, CliError};
use cargo::util::important_paths::find_root_manifest_for_cwd;
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct Options {
arg_crate: Option<String>,
flag_token: Option<String>,
}
}
-#[deriving(PartialEq,Clone,Encodable)]
+#[deriving(PartialEq,Clone,RustcEncodable)]
pub struct SerializedDependency {
name: String,
req: String
use std::fmt::{mod, Show, Formatter};
use semver::Version;
-use serialize::{Encoder,Encodable};
+use rustc_serialize::{Encoder,Encodable};
use core::{Dependency, PackageId, Summary};
use core::package_id::Metadata;
pub documentation: Option<String>, // url
}
-#[deriving(PartialEq,Clone,Encodable)]
+#[deriving(PartialEq,Clone,RustcEncodable)]
pub struct SerializedManifest {
name: String,
version: String,
}
}
-#[deriving(Show, Clone, PartialEq, Hash, Encodable, Copy)]
+#[deriving(Show, Clone, PartialEq, Hash, RustcEncodable, Copy)]
pub enum LibKind {
Lib,
Rlib,
}
}
-#[deriving(Show, Clone, Hash, PartialEq, Encodable)]
+#[deriving(Show, Clone, Hash, PartialEq, RustcEncodable)]
pub enum TargetKind {
Lib(Vec<LibKind>),
Bin,
Example,
}
-#[deriving(Encodable, Decodable, Clone, PartialEq, Show)]
+#[deriving(RustcEncodable, RustcDecodable, Clone, PartialEq, Show)]
pub struct Profile {
env: String, // compile, test, dev, bench, etc.
opt_level: uint,
metadata: Option<Metadata>,
}
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
pub struct SerializedTarget {
kind: Vec<&'static str>,
name: String,
};
use core::dependency::SerializedDependency;
use util::{CargoResult, graph};
-use serialize::{Encoder,Encodable};
+use rustc_serialize::{Encoder,Encodable};
use core::source::{SourceId, Source};
/// Informations about a package that is available somewhere in the file system.
source_id: SourceId,
}
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
struct SerializedPackage {
name: String,
version: String,
use std::sync::Arc;
use std::fmt::{mod, Show, Formatter};
use std::hash;
-use serialize::{Encodable, Encoder, Decodable, Decoder};
+use rustc_serialize::{Encodable, Encoder, Decodable, Decoder};
use regex::Regex;
fn is_human(&self) -> bool { true }
}
-#[deriving(PartialEq, Hash, Clone, Encodable)]
+#[deriving(PartialEq, Hash, Clone, RustcEncodable)]
pub struct Metadata {
pub metadata: String,
pub extra_filename: String
use std::collections::{HashMap, BTreeMap};
use regex::Regex;
-use serialize::{Encodable, Encoder, Decodable, Decoder};
+use rustc_serialize::{Encodable, Encoder, Decodable, Decoder};
use core::{PackageId, SourceId};
use util::{CargoResult, Graph};
use super::Resolve;
-#[deriving(Encodable, Decodable, Show)]
+#[deriving(RustcEncodable, RustcDecodable, Show)]
pub struct EncodableResolve {
package: Option<Vec<EncodableDependency>>,
root: EncodableDependency,
}
}
-#[deriving(Encodable, Decodable, Show, PartialOrd, Ord, PartialEq, Eq)]
+#[deriving(RustcEncodable, RustcDecodable, Show, PartialOrd, Ord, PartialEq, Eq)]
pub struct EncodableDependency {
name: String,
version: String,
-use std::collections::hash_map::{HashMap, Values, MutEntries};
+use std::collections::hash_map::{HashMap, Values, IterMut};
use std::fmt::{mod, Show, Formatter};
use std::hash;
use std::mem;
use std::sync::Arc;
-use serialize::{Decodable, Decoder, Encodable, Encoder};
+use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use url::Url;
fn fingerprint(&self, pkg: &Package) -> CargoResult<String>;
}
-#[deriving(Encodable, Decodable, Show, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
+#[deriving(RustcEncodable, RustcDecodable, Show, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
enum Kind {
/// Kind::Git(<git reference>) represents a git repository
Git(String),
#![cfg_attr(test, deny(warnings))]
extern crate libc;
+extern crate "rustc-serialize" as rustc_serialize;
extern crate regex;
-extern crate serialize;
extern crate term;
extern crate time;
#[phase(plugin, link)] extern crate log;
use std::os;
use std::io::stdio::{stdout_raw, stderr_raw};
use std::io::{mod, stdout, stderr};
-use serialize::{Decoder, Encoder, Decodable, Encodable, json};
+use rustc_serialize::{Decoder, Encoder, Decodable, Encodable};
+use rustc_serialize::json;
use docopt::Docopt;
use core::{Shell, MultiShell, ShellConfig};
use std::io::File;
-use serialize::{Encodable, Decodable};
+use rustc_serialize::{Encodable, Decodable};
use toml::{mod, Encoder, Value};
use core::{Resolve, resolver, Package, SourceId};
use std::fmt::{mod, Show, Formatter};
use std::io::{USER_DIR};
use std::io::fs::{mkdir_recursive, rmdir_recursive, PathExtensions};
-use serialize::{Encodable, Encoder};
+use rustc_serialize::{Encodable, Encoder};
use url::Url;
use git2;
use util::{CargoResult, ChainError, human, ToUrl, internal, Require};
-#[deriving(PartialEq,Clone,Encodable)]
+#[deriving(PartialEq,Clone,RustcEncodable)]
pub enum GitReference {
Master,
Other(String)
}
-#[deriving(PartialEq,Clone,Encodable)]
+#[deriving(PartialEq,Clone,RustcEncodable)]
pub struct GitRevision(String);
impl GitReference {
url: Url,
}
-#[deriving(PartialEq,Clone,Encodable)]
+#[deriving(PartialEq,Clone,RustcEncodable)]
struct EncodableGitRemote {
url: String,
}
repo: git2::Repository,
}
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
pub struct EncodableGitDatabase {
remote: GitRemote,
path: String,
repo: git2::Repository,
}
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
pub struct EncodableGitCheckout {
database: EncodableGitDatabase,
location: String,
use curl::http;
use git2;
use flate2::reader::GzDecoder;
-use serialize::json;
-use serialize::hex::ToHex;
+use rustc_serialize::json;
+use rustc_serialize::hex::ToHex;
use tar::Archive;
use url::Url;
updated: bool,
}
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
pub struct RegistryConfig {
/// Download endpoint for all crates. This will be appended with
/// `/<crate>/<version>/download` and then will be hit with an HTTP GET
pub api: String,
}
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct RegistryPackage {
name: String,
vers: String,
yanked: Option<bool>,
}
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct RegistryDependency {
name: String,
req: String,
use std::io::fs::{mod, PathExtensions, File};
use std::string;
-use serialize::{Encodable,Encoder};
+use rustc_serialize::{Encodable,Encoder};
use toml;
use core::MultiShell;
use ops;
}
}
-#[deriving(Eq, PartialEq, Clone, Encodable, Decodable, Copy)]
+#[deriving(Eq, PartialEq, Clone, RustcEncodable, RustcDecodable, Copy)]
pub enum Location {
Project,
Global
}
-#[deriving(Eq,PartialEq,Clone,Decodable)]
+#[deriving(Eq,PartialEq,Clone,RustcDecodable)]
pub enum ConfigValue {
String(string::String, Path),
List(Vec<(string::String, Path)>),
use std::io::IoError;
use std::fmt::{mod, Show, Formatter};
use std::str;
-use serialize::json;
+use rustc_serialize::json;
use semver;
use curl;
use std::hash::{Hasher, Hash};
use std::hash::sip::SipHasher;
-use serialize::hex::ToHex;
+use rustc_serialize::hex::ToHex;
pub fn to_hex(num: u64) -> String {
let mut writer = MemWriter::with_capacity(8);
use std::default::Default;
use toml;
use semver;
-use serialize::{Decodable, Decoder};
+use rustc_serialize::{Decodable, Decoder};
use core::SourceId;
use core::{Summary, Manifest, Target, Dependency, PackageId};
* TODO: Make all struct fields private
*/
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
pub enum TomlDependency {
Simple(String),
Detailed(DetailedTomlDependency)
}
-#[deriving(Decodable, Clone, Default)]
+#[deriving(RustcDecodable, Clone, Default)]
pub struct DetailedTomlDependency {
version: Option<String>,
path: Option<String>,
default_features: Option<bool>,
}
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
pub struct TomlManifest {
package: Option<Box<TomlProject>>,
project: Option<Box<TomlProject>>,
target: Option<HashMap<String, TomlPlatform>>,
}
-#[deriving(Decodable, Clone, Default)]
+#[deriving(RustcDecodable, Clone, Default)]
pub struct TomlProfiles {
test: Option<TomlProfile>,
doc: Option<TomlProfile>,
release: Option<TomlProfile>,
}
-#[deriving(Decodable, Clone, Default)]
+#[deriving(RustcDecodable, Clone, Default)]
#[allow(missing_copy_implementations)]
pub struct TomlProfile {
opt_level: Option<uint>,
rpath: Option<bool>,
}
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
pub enum ManyOrOne<T> {
Many(Vec<T>),
One(T),
}
}
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
pub struct TomlProject {
name: String,
version: TomlVersion,
}
// TODO: deprecated, remove
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
pub enum BuildCommand {
Single(String),
Multiple(Vec<String>)
Ok(())
}
-#[deriving(Decodable, Show, Clone)]
+#[deriving(RustcDecodable, Show, Clone)]
struct TomlTarget {
name: String,
crate_type: Option<Vec<String>>,
harness: Option<bool>,
}
-#[deriving(Decodable, Clone)]
+#[deriving(RustcDecodable, Clone)]
enum PathValue {
String(String),
Path(Path),
}
/// Corresponds to a `target` entry, but `TomlTarget` is already used.
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
struct TomlPlatform {
dependencies: Option<HashMap<String, TomlDependency>>,
}
extern crate curl;
-extern crate serialize;
+extern crate "rustc-serialize" as rustc_serialize;
use std::fmt;
use std::io::{mod, fs, MemReader, MemWriter, File};
use curl::http;
use curl::http::handle::Method::{Put, Get, Delete};
use curl::http::handle::{Method, Request};
-use serialize::json;
+use rustc_serialize::json;
+
pub struct Registry {
host: String,
Io(io::IoError),
}
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
pub struct Crate {
pub name: String,
pub description: Option<String>,
pub max_version: String
}
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
pub struct NewCrate {
pub name: String,
pub vers: String,
pub repository: Option<String>,
}
-#[deriving(Encodable)]
+#[deriving(RustcEncodable)]
pub struct NewCrateDependency {
pub optional: bool,
pub default_features: bool,
pub kind: String,
}
-#[deriving(Decodable)]
+#[deriving(RustcDecodable)]
pub struct User {
pub id: uint,
pub login: String,
pub name: Option<String>,
}
-#[deriving(Decodable)] struct R { ok: bool }
-#[deriving(Decodable)] struct ApiErrorList { errors: Vec<ApiError> }
-#[deriving(Decodable)] struct ApiError { detail: String }
-#[deriving(Encodable)] struct OwnersReq<'a> { users: &'a [&'a str] }
-#[deriving(Decodable)] struct Users { users: Vec<User> }
-#[deriving(Decodable)] struct Crates { crates: Vec<Crate> }
+#[deriving(RustcDecodable)] struct R { ok: bool }
+#[deriving(RustcDecodable)] struct ApiErrorList { errors: Vec<ApiError> }
+#[deriving(RustcDecodable)] struct ApiError { detail: String }
+#[deriving(RustcEncodable)] struct OwnersReq<'a> { users: &'a [&'a str] }
+#[deriving(RustcDecodable)] struct Users { users: Vec<User> }
+#[deriving(RustcDecodable)] struct Crates { crates: Vec<Crate> }
impl Registry {
pub fn new(host: String, token: Option<String>) -> Registry {
use flate2::CompressionLevel::Default;
use flate2::writer::GzEncoder;
use git2;
-use serialize::hex::ToHex;
+use rustc_serialize::hex::ToHex;
use tar::Archive;
use url::Url;