Summary: Electron 12 broke packing again because one file was renamed. I'm now setting up a separate mode for using globs and ignores to create artifact bundles. This will work like a reverse gitignore file. However, to keep the logic simple, I'll keep the old mode for MacOS where the folder structure lends itself to comprehensive, exact lists. **This doesn't actually change anything just yet apart from the "packfile" format. The next diff will add the new packing mode. Feedback is always welcome but there's no need for super close scrutiny.** Reviewed By: mweststrate Differential Revision: D27191506 fbshipit-source-id: 663cef8b93eef6c2dbb56ef66de51ea9551412dd
69 lines
1.3 KiB
Rust
69 lines
1.3 KiB
Rust
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
use clap::arg_enum;
|
|
use std::fmt::{self, Display};
|
|
|
|
arg_enum! {
|
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, serde::Deserialize)]
|
|
#[serde(rename_all = "lowercase")]
|
|
pub enum Platform {
|
|
Mac,
|
|
Linux,
|
|
Windows
|
|
}
|
|
}
|
|
|
|
#[derive(
|
|
Debug,
|
|
Clone,
|
|
Copy,
|
|
PartialEq,
|
|
Eq,
|
|
PartialOrd,
|
|
Ord,
|
|
serde::Deserialize,
|
|
serde::Serialize
|
|
)]
|
|
#[serde(rename_all = "lowercase")]
|
|
pub enum PackType {
|
|
Frameworks,
|
|
Core,
|
|
}
|
|
|
|
#[derive(
|
|
Debug,
|
|
Clone,
|
|
Copy,
|
|
PartialEq,
|
|
Eq,
|
|
PartialOrd,
|
|
Ord,
|
|
serde::Deserialize,
|
|
serde::Serialize
|
|
)]
|
|
#[serde(rename_all = "lowercase")]
|
|
pub enum PackMode {
|
|
/// All paths need to be specified.
|
|
Exact,
|
|
/// Can use `*` and `!` syntax to specify patterns for inclusion and exclusion.
|
|
/// Only works on the root folder level.
|
|
Glob,
|
|
}
|
|
|
|
impl Display for PackType {
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
match *self {
|
|
Self::Frameworks => write!(f, "frameworks"),
|
|
Self::Core => write!(f, "core"),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Eq, PartialEq, Debug, serde::Serialize)]
|
|
pub struct HashSum(pub String);
|