Deps
Signed-off-by: Luca Fulchir <luca.fulchir@runesauth.com>
This commit is contained in:
parent
09cef1ff93
commit
82d43e2829
@ -271,7 +271,7 @@ pub fn impl_package(_attrs: TokenStream, input: TokenStream) -> TokenStream {
|
||||
write!(&mut pkg_vars,
|
||||
"{:?}",
|
||||
self,
|
||||
);
|
||||
).ok();
|
||||
hasher.update(&pkg_vars);
|
||||
hasher.update(self.to_string());
|
||||
let hash = hasher.finalize();
|
||||
@ -290,6 +290,9 @@ pub fn impl_package(_attrs: TokenStream, input: TokenStream) -> TokenStream {
|
||||
|
||||
for mut impl_item in ast.items.iter_mut() {
|
||||
if let ::syn::ImplItem::Fn(ref mut fn_impl) = &mut impl_item {
|
||||
if fn_impl.sig.ident.to_string() == "dependencies_set" {
|
||||
continue;
|
||||
}
|
||||
let fn_with_code: ::syn::ImplItemFn = ::syn::parse_quote! {
|
||||
#[::bok::pkg_fn_to_code]
|
||||
#fn_impl
|
||||
|
@ -43,4 +43,12 @@ impl ::bok::Pkg for One {
|
||||
fn build(&self) -> ::core::result::Result<(), ()> {
|
||||
ret = ::core::result::Result::Ok(());
|
||||
}
|
||||
fn dependencies_set(
|
||||
&self,
|
||||
_repo: ::std::sync::Arc<dyn ::bok::Repository>,
|
||||
_build: &::bok::deps::Build,
|
||||
_runtime: &::bok::deps::Runtime,
|
||||
) -> Result<(), ()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
@ -42,4 +42,12 @@ impl ::bok::Pkg for Three {
|
||||
fn build(&self) -> ::core::result::Result<(), ()> {
|
||||
ret = ::core::result::Result::Ok(());
|
||||
}
|
||||
fn dependencies_set(
|
||||
&self,
|
||||
_repo: ::std::sync::Arc<dyn ::bok::Repository>,
|
||||
_build: &::bok::deps::Build,
|
||||
_runtime: &::bok::deps::Runtime,
|
||||
) -> Result<(), ()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
@ -38,4 +38,13 @@ impl ::std::default::Default for Two {
|
||||
}
|
||||
}
|
||||
#[::bok::impl_package]
|
||||
impl ::bok::Pkg for Two {}
|
||||
impl ::bok::Pkg for Two {
|
||||
fn dependencies_set(
|
||||
&self,
|
||||
_repo: ::std::sync::Arc<dyn ::bok::Repository>,
|
||||
_build: &::bok::deps::Build,
|
||||
_runtime: &::bok::deps::Runtime,
|
||||
) -> Result<(), ()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
@ -16,11 +16,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
use ::std::sync::Arc;
|
||||
|
||||
mod collection;
|
||||
mod names;
|
||||
pub use collection::Collection;
|
||||
pub use names::{Path, PkgName, RepoName};
|
||||
mod deps {
|
||||
pub mod deps {
|
||||
pub struct Build(pub crate::Collection);
|
||||
pub struct Runtime(pub crate::Collection);
|
||||
}
|
||||
@ -123,14 +125,12 @@ pub trait Pkg:
|
||||
fn base_mut(&mut self) -> ::core::option::Option<&mut dyn Pkg>;
|
||||
fn as_any(&self) -> &dyn ::std::any::Any;
|
||||
fn as_any_mut(&mut self) -> &mut dyn ::std::any::Any;
|
||||
/*
|
||||
fn dependencies_set(
|
||||
&self,
|
||||
repo: Arc<dyn Repository>,
|
||||
build: &deps::Build,
|
||||
runtime: &deps::Runtime,
|
||||
) -> Result<(), ()>;
|
||||
*/
|
||||
fn prepare(&self) -> ::core::result::Result<(), ()> {
|
||||
self.base().unwrap().prepare()
|
||||
}
|
||||
@ -245,6 +245,14 @@ impl Pkg for PkgEmpty {
|
||||
fn as_any_mut(&mut self) -> &mut dyn ::std::any::Any {
|
||||
self
|
||||
}
|
||||
fn dependencies_set(
|
||||
&self,
|
||||
_repo: Arc<dyn Repository>,
|
||||
_build: &deps::Build,
|
||||
_runtime: &deps::Runtime,
|
||||
) -> Result<(), ()> {
|
||||
Ok(())
|
||||
}
|
||||
fn prepare(&self) -> ::core::result::Result<(), ()> {
|
||||
::core::result::Result::Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user