mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Migrate proto build actions to ninja_gen; switch from dyn Error to anyhow
This commit is contained in:
parent
0bf4fddf40
commit
baa631c6ef
19 changed files with 76 additions and 81 deletions
|
@ -1,6 +1,7 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
use ninja_gen::action::BuildAction;
|
use ninja_gen::action::BuildAction;
|
||||||
use ninja_gen::command::RunCommand;
|
use ninja_gen::command::RunCommand;
|
||||||
use ninja_gen::copy::CopyFile;
|
use ninja_gen::copy::CopyFile;
|
||||||
|
@ -14,7 +15,6 @@ use ninja_gen::node::TypescriptCheck;
|
||||||
use ninja_gen::python::python_format;
|
use ninja_gen::python::python_format;
|
||||||
use ninja_gen::python::PythonTest;
|
use ninja_gen::python::PythonTest;
|
||||||
use ninja_gen::Build;
|
use ninja_gen::Build;
|
||||||
use ninja_gen::Result;
|
|
||||||
use ninja_gen::Utf8Path;
|
use ninja_gen::Utf8Path;
|
||||||
use ninja_gen::Utf8PathBuf;
|
use ninja_gen::Utf8PathBuf;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
use ninja_gen::action::BuildAction;
|
use ninja_gen::action::BuildAction;
|
||||||
use ninja_gen::archives::download_and_extract;
|
use ninja_gen::archives::download_and_extract;
|
||||||
use ninja_gen::archives::empty_manifest;
|
use ninja_gen::archives::empty_manifest;
|
||||||
|
@ -14,7 +15,6 @@ use ninja_gen::input::BuildInput;
|
||||||
use ninja_gen::inputs;
|
use ninja_gen::inputs;
|
||||||
use ninja_gen::python::PythonEnvironment;
|
use ninja_gen::python::PythonEnvironment;
|
||||||
use ninja_gen::Build;
|
use ninja_gen::Build;
|
||||||
use ninja_gen::Result;
|
|
||||||
use ninja_gen::Utf8Path;
|
use ninja_gen::Utf8Path;
|
||||||
|
|
||||||
use crate::anki_version;
|
use crate::anki_version;
|
||||||
|
|
|
@ -4,17 +4,20 @@
|
||||||
mod aqt;
|
mod aqt;
|
||||||
mod bundle;
|
mod bundle;
|
||||||
mod platform;
|
mod platform;
|
||||||
mod proto;
|
|
||||||
mod pylib;
|
mod pylib;
|
||||||
mod python;
|
mod python;
|
||||||
mod rust;
|
mod rust;
|
||||||
mod web;
|
mod web;
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
use aqt::build_and_check_aqt;
|
use aqt::build_and_check_aqt;
|
||||||
use bundle::build_bundle;
|
use bundle::build_bundle;
|
||||||
|
use ninja_gen::glob;
|
||||||
|
use ninja_gen::inputs;
|
||||||
|
use ninja_gen::protobuf::check_proto;
|
||||||
|
use ninja_gen::protobuf::setup_protoc;
|
||||||
use ninja_gen::python::setup_python;
|
use ninja_gen::python::setup_python;
|
||||||
use ninja_gen::Build;
|
use ninja_gen::Build;
|
||||||
use ninja_gen::Result;
|
|
||||||
use pylib::build_pylib;
|
use pylib::build_pylib;
|
||||||
use pylib::check_pylib;
|
use pylib::check_pylib;
|
||||||
use python::check_python;
|
use python::check_python;
|
||||||
|
@ -25,8 +28,6 @@ use rust::check_rust;
|
||||||
use web::build_and_check_web;
|
use web::build_and_check_web;
|
||||||
use web::check_sql;
|
use web::check_sql;
|
||||||
|
|
||||||
use crate::proto::check_proto;
|
|
||||||
|
|
||||||
fn anki_version() -> String {
|
fn anki_version() -> String {
|
||||||
std::fs::read_to_string(".version")
|
std::fs::read_to_string(".version")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -38,6 +39,9 @@ fn main() -> Result<()> {
|
||||||
let mut build = Build::new()?;
|
let mut build = Build::new()?;
|
||||||
let build = &mut build;
|
let build = &mut build;
|
||||||
|
|
||||||
|
setup_protoc(build)?;
|
||||||
|
check_proto(build, inputs![glob!["proto/**/*.proto"]])?;
|
||||||
|
|
||||||
setup_python(build)?;
|
setup_python(build)?;
|
||||||
setup_venv(build)?;
|
setup_venv(build)?;
|
||||||
|
|
||||||
|
@ -50,7 +54,7 @@ fn main() -> Result<()> {
|
||||||
check_rust(build)?;
|
check_rust(build)?;
|
||||||
check_pylib(build)?;
|
check_pylib(build)?;
|
||||||
check_python(build)?;
|
check_python(build)?;
|
||||||
check_proto(build)?;
|
|
||||||
check_sql(build)?;
|
check_sql(build)?;
|
||||||
check_minilints(build)?;
|
check_minilints(build)?;
|
||||||
|
|
||||||
|
|
|
@ -1,58 +0,0 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
||||||
|
|
||||||
use std::env;
|
|
||||||
|
|
||||||
use ninja_gen::archives::download_and_extract;
|
|
||||||
use ninja_gen::archives::with_exe;
|
|
||||||
use ninja_gen::glob;
|
|
||||||
use ninja_gen::hashmap;
|
|
||||||
use ninja_gen::inputs;
|
|
||||||
use ninja_gen::protobuf::protoc_archive;
|
|
||||||
use ninja_gen::protobuf::ClangFormat;
|
|
||||||
use ninja_gen::Build;
|
|
||||||
use ninja_gen::Result;
|
|
||||||
use ninja_gen::Utf8Path;
|
|
||||||
|
|
||||||
pub fn setup_protoc(build: &mut Build) -> Result<()> {
|
|
||||||
let protoc_binary = match env::var("PROTOC_BINARY") {
|
|
||||||
Ok(path) => {
|
|
||||||
assert!(
|
|
||||||
Utf8Path::new(&path).is_absolute(),
|
|
||||||
"PROTOC_BINARY must be absolute"
|
|
||||||
);
|
|
||||||
path.into()
|
|
||||||
}
|
|
||||||
Err(_) => {
|
|
||||||
download_and_extract(
|
|
||||||
build,
|
|
||||||
"protoc",
|
|
||||||
protoc_archive(build.host_platform),
|
|
||||||
hashmap! {
|
|
||||||
"bin" => [with_exe("bin/protoc")]
|
|
||||||
},
|
|
||||||
)?;
|
|
||||||
inputs![":extract:protoc:bin"]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
build.add_dependency("protoc_binary", protoc_binary);
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn check_proto(build: &mut Build) -> Result<()> {
|
|
||||||
build.add_action(
|
|
||||||
"check:format:proto",
|
|
||||||
ClangFormat {
|
|
||||||
inputs: inputs![glob!["proto/**/*.proto"]],
|
|
||||||
check_only: true,
|
|
||||||
},
|
|
||||||
)?;
|
|
||||||
build.add_action(
|
|
||||||
"format:proto",
|
|
||||||
ClangFormat {
|
|
||||||
inputs: inputs![glob!["proto/**/*.proto"]],
|
|
||||||
check_only: false,
|
|
||||||
},
|
|
||||||
)?;
|
|
||||||
Ok(())
|
|
||||||
}
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
use ninja_gen::action::BuildAction;
|
use ninja_gen::action::BuildAction;
|
||||||
use ninja_gen::archives::Platform;
|
use ninja_gen::archives::Platform;
|
||||||
use ninja_gen::command::RunCommand;
|
use ninja_gen::command::RunCommand;
|
||||||
|
@ -11,7 +12,6 @@ use ninja_gen::inputs;
|
||||||
use ninja_gen::python::python_format;
|
use ninja_gen::python::python_format;
|
||||||
use ninja_gen::python::PythonTest;
|
use ninja_gen::python::PythonTest;
|
||||||
use ninja_gen::Build;
|
use ninja_gen::Build;
|
||||||
use ninja_gen::Result;
|
|
||||||
|
|
||||||
use crate::anki_version;
|
use crate::anki_version;
|
||||||
use crate::platform::overriden_python_target_platform;
|
use crate::platform::overriden_python_target_platform;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
use ninja_gen::action::BuildAction;
|
use ninja_gen::action::BuildAction;
|
||||||
use ninja_gen::archives::Platform;
|
use ninja_gen::archives::Platform;
|
||||||
use ninja_gen::build::FilesHandle;
|
use ninja_gen::build::FilesHandle;
|
||||||
|
@ -15,7 +16,6 @@ use ninja_gen::python::PythonLint;
|
||||||
use ninja_gen::python::PythonTypecheck;
|
use ninja_gen::python::PythonTypecheck;
|
||||||
use ninja_gen::rsync::RsyncFiles;
|
use ninja_gen::rsync::RsyncFiles;
|
||||||
use ninja_gen::Build;
|
use ninja_gen::Build;
|
||||||
use ninja_gen::Result;
|
|
||||||
|
|
||||||
pub fn setup_venv(build: &mut Build) -> Result<()> {
|
pub fn setup_venv(build: &mut Build) -> Result<()> {
|
||||||
let platform_deps = if cfg!(windows) {
|
let platform_deps = if cfg!(windows) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
use ninja_gen::action::BuildAction;
|
use ninja_gen::action::BuildAction;
|
||||||
use ninja_gen::build::FilesHandle;
|
use ninja_gen::build::FilesHandle;
|
||||||
use ninja_gen::cargo::CargoBuild;
|
use ninja_gen::cargo::CargoBuild;
|
||||||
|
@ -14,14 +15,11 @@ use ninja_gen::glob;
|
||||||
use ninja_gen::input::BuildInput;
|
use ninja_gen::input::BuildInput;
|
||||||
use ninja_gen::inputs;
|
use ninja_gen::inputs;
|
||||||
use ninja_gen::Build;
|
use ninja_gen::Build;
|
||||||
use ninja_gen::Result;
|
|
||||||
|
|
||||||
use crate::platform::overriden_rust_target_triple;
|
use crate::platform::overriden_rust_target_triple;
|
||||||
use crate::proto::setup_protoc;
|
|
||||||
|
|
||||||
pub fn build_rust(build: &mut Build) -> Result<()> {
|
pub fn build_rust(build: &mut Build) -> Result<()> {
|
||||||
prepare_translations(build)?;
|
prepare_translations(build)?;
|
||||||
setup_protoc(build)?;
|
|
||||||
prepare_proto_descriptors(build)?;
|
prepare_proto_descriptors(build)?;
|
||||||
build_rsbridge(build)
|
build_rsbridge(build)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
use ninja_gen::action::BuildAction;
|
use ninja_gen::action::BuildAction;
|
||||||
use ninja_gen::command::RunCommand;
|
use ninja_gen::command::RunCommand;
|
||||||
use ninja_gen::glob;
|
use ninja_gen::glob;
|
||||||
|
@ -20,7 +21,6 @@ use ninja_gen::node::SvelteCheck;
|
||||||
use ninja_gen::node::TypescriptCheck;
|
use ninja_gen::node::TypescriptCheck;
|
||||||
use ninja_gen::rsync::RsyncFiles;
|
use ninja_gen::rsync::RsyncFiles;
|
||||||
use ninja_gen::Build;
|
use ninja_gen::Build;
|
||||||
use ninja_gen::Result;
|
|
||||||
|
|
||||||
pub fn build_and_check_web(build: &mut Build) -> Result<()> {
|
pub fn build_and_check_web(build: &mut Build) -> Result<()> {
|
||||||
setup_node(build)?;
|
setup_node(build)?;
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
|
|
||||||
use crate::build::FilesHandle;
|
use crate::build::FilesHandle;
|
||||||
use crate::Build;
|
use crate::Build;
|
||||||
use crate::Result;
|
|
||||||
|
|
||||||
pub trait BuildAction {
|
pub trait BuildAction {
|
||||||
/// Command line to invoke for each build statement.
|
/// Command line to invoke for each build statement.
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
use camino::Utf8Path;
|
use camino::Utf8Path;
|
||||||
use camino::Utf8PathBuf;
|
use camino::Utf8PathBuf;
|
||||||
|
|
||||||
|
@ -11,7 +12,6 @@ use crate::action::BuildAction;
|
||||||
use crate::input::BuildInput;
|
use crate::input::BuildInput;
|
||||||
use crate::inputs;
|
use crate::inputs;
|
||||||
use crate::Build;
|
use crate::Build;
|
||||||
use crate::Result;
|
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub struct OnlineArchive {
|
pub struct OnlineArchive {
|
||||||
|
|
|
@ -5,6 +5,7 @@ use std::collections::HashMap;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
use camino::Utf8PathBuf;
|
use camino::Utf8PathBuf;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
|
|
||||||
|
@ -13,7 +14,6 @@ use crate::archives::Platform;
|
||||||
use crate::configure::ConfigureBuild;
|
use crate::configure::ConfigureBuild;
|
||||||
use crate::input::space_separated;
|
use crate::input::space_separated;
|
||||||
use crate::input::BuildInput;
|
use crate::input::BuildInput;
|
||||||
use crate::Result;
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Build {
|
pub struct Build {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
use camino::Utf8Path;
|
use camino::Utf8Path;
|
||||||
use camino::Utf8PathBuf;
|
use camino::Utf8PathBuf;
|
||||||
|
|
||||||
|
@ -10,7 +11,6 @@ use crate::build::FilesHandle;
|
||||||
use crate::input::BuildInput;
|
use crate::input::BuildInput;
|
||||||
use crate::inputs;
|
use crate::inputs;
|
||||||
use crate::Build;
|
use crate::Build;
|
||||||
use crate::Result;
|
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Eq)]
|
#[derive(Debug, PartialEq, Eq)]
|
||||||
pub enum RustOutput<'a> {
|
pub enum RustOutput<'a> {
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
|
|
||||||
use crate::action::BuildAction;
|
use crate::action::BuildAction;
|
||||||
use crate::build::FilesHandle;
|
use crate::build::FilesHandle;
|
||||||
use crate::cargo::CargoBuild;
|
use crate::cargo::CargoBuild;
|
||||||
|
@ -8,7 +10,6 @@ use crate::cargo::RustOutput;
|
||||||
use crate::glob;
|
use crate::glob;
|
||||||
use crate::inputs;
|
use crate::inputs;
|
||||||
use crate::Build;
|
use crate::Build;
|
||||||
use crate::Result;
|
|
||||||
|
|
||||||
pub struct ConfigureBuild {}
|
pub struct ConfigureBuild {}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
|
@ -24,8 +24,6 @@ pub use camino::Utf8PathBuf;
|
||||||
pub use maplit::hashmap;
|
pub use maplit::hashmap;
|
||||||
pub use which::which;
|
pub use which::which;
|
||||||
|
|
||||||
pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
|
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! inputs {
|
macro_rules! inputs {
|
||||||
($($param:expr),+ $(,)?) => {
|
($($param:expr),+ $(,)?) => {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
|
use camino::Utf8Path;
|
||||||
use maplit::hashmap;
|
use maplit::hashmap;
|
||||||
|
|
||||||
use crate::action::BuildAction;
|
use crate::action::BuildAction;
|
||||||
|
@ -11,6 +15,7 @@ use crate::archives::Platform;
|
||||||
use crate::hash::simple_hash;
|
use crate::hash::simple_hash;
|
||||||
use crate::input::BuildInput;
|
use crate::input::BuildInput;
|
||||||
use crate::inputs;
|
use crate::inputs;
|
||||||
|
use crate::Build;
|
||||||
|
|
||||||
pub fn protoc_archive(platform: Platform) -> OnlineArchive {
|
pub fn protoc_archive(platform: Platform) -> OnlineArchive {
|
||||||
match platform {
|
match platform {
|
||||||
|
@ -91,7 +96,7 @@ impl BuildAction for ClangFormat {
|
||||||
let hash = simple_hash(&self.inputs);
|
let hash = simple_hash(&self.inputs);
|
||||||
build.add_output_stamp(format!("tests/clang-format.{mode}.{hash}"));
|
build.add_output_stamp(format!("tests/clang-format.{mode}.{hash}"));
|
||||||
}
|
}
|
||||||
fn on_first_instance(&self, build: &mut crate::Build) -> crate::Result<()> {
|
fn on_first_instance(&self, build: &mut crate::Build) -> anyhow::Result<()> {
|
||||||
let binary = with_exe("clang-format");
|
let binary = with_exe("clang-format");
|
||||||
download_and_extract(
|
download_and_extract(
|
||||||
build,
|
build,
|
||||||
|
@ -103,3 +108,46 @@ impl BuildAction for ClangFormat {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn setup_protoc(build: &mut Build) -> Result<()> {
|
||||||
|
let protoc_binary = match env::var("PROTOC_BINARY") {
|
||||||
|
Ok(path) => {
|
||||||
|
assert!(
|
||||||
|
Utf8Path::new(&path).is_absolute(),
|
||||||
|
"PROTOC_BINARY must be absolute"
|
||||||
|
);
|
||||||
|
path.into()
|
||||||
|
}
|
||||||
|
Err(_) => {
|
||||||
|
download_and_extract(
|
||||||
|
build,
|
||||||
|
"protoc",
|
||||||
|
protoc_archive(build.host_platform),
|
||||||
|
hashmap! {
|
||||||
|
"bin" => [with_exe("bin/protoc")]
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
inputs![":extract:protoc:bin"]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
build.add_dependency("protoc_binary", protoc_binary);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn check_proto(build: &mut Build, inputs: BuildInput) -> Result<()> {
|
||||||
|
build.add_action(
|
||||||
|
"check:format:proto",
|
||||||
|
ClangFormat {
|
||||||
|
inputs: inputs.clone(),
|
||||||
|
check_only: true,
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
build.add_action(
|
||||||
|
"format:proto",
|
||||||
|
ClangFormat {
|
||||||
|
inputs,
|
||||||
|
check_only: false,
|
||||||
|
},
|
||||||
|
)?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
use camino::Utf8Path;
|
use camino::Utf8Path;
|
||||||
use maplit::hashmap;
|
use maplit::hashmap;
|
||||||
|
|
||||||
|
@ -14,7 +15,6 @@ use crate::hash::simple_hash;
|
||||||
use crate::input::BuildInput;
|
use crate::input::BuildInput;
|
||||||
use crate::inputs;
|
use crate::inputs;
|
||||||
use crate::Build;
|
use crate::Build;
|
||||||
use crate::Result;
|
|
||||||
|
|
||||||
pub fn python_archive(platform: Platform) -> OnlineArchive {
|
pub fn python_archive(platform: Platform) -> OnlineArchive {
|
||||||
match platform {
|
match platform {
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
// Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
|
|
||||||
use crate::action::BuildAction;
|
use crate::action::BuildAction;
|
||||||
use crate::cargo::CargoInstall;
|
use crate::cargo::CargoInstall;
|
||||||
use crate::input::space_separated;
|
use crate::input::space_separated;
|
||||||
use crate::input::BuildInput;
|
use crate::input::BuildInput;
|
||||||
use crate::inputs;
|
use crate::inputs;
|
||||||
use crate::Build;
|
use crate::Build;
|
||||||
use crate::Result;
|
|
||||||
|
|
||||||
pub struct CompileSassWithGrass {
|
pub struct CompileSassWithGrass {
|
||||||
pub input: BuildInput,
|
pub input: BuildInput,
|
||||||
|
|
Loading…
Reference in a new issue