2024-02-16 09:51:56 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2024 Luca Fulchir <luca.fulchir@runesauth.com>
|
|
|
|
*
|
2024-03-27 10:34:09 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 with LLVM exception (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License and of the exception at
|
2024-02-16 09:51:56 +00:00
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* https://spdx.org/licenses/LLVM-exception.html
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2024-12-14 16:52:06 +00:00
|
|
|
//!
|
|
|
|
//! Example of two package repositories, where one
|
|
|
|
//! extends ancd changes another
|
|
|
|
|
|
|
|
// all packages we have
|
|
|
|
pub mod pkgs;
|
|
|
|
|
|
|
|
pub mod r1;
|
|
|
|
pub mod r2;
|
|
|
|
|
|
|
|
pub use r1::R1;
|
|
|
|
pub use r2::R2;
|
2024-02-16 18:08:03 +00:00
|
|
|
|
2024-02-16 09:51:56 +00:00
|
|
|
fn main() {
|
2024-12-03 16:26:53 +00:00
|
|
|
//let one = repos::pkgs::one::One::default();
|
2024-11-29 15:59:22 +00:00
|
|
|
|
2024-12-06 15:47:32 +00:00
|
|
|
use ::std::sync::Arc;
|
2024-12-14 16:52:06 +00:00
|
|
|
let pkgs1 = Arc::new(R1::default());
|
|
|
|
let pkgs2 = Arc::new(R2::default());
|
2024-11-11 11:31:16 +00:00
|
|
|
use ::bok::Repository;
|
|
|
|
println!("pkgs1: {}", pkgs1.name());
|
|
|
|
println!("pkgs2: {}", pkgs2.name());
|
2024-12-08 17:08:20 +00:00
|
|
|
/*
|
2024-12-06 15:47:32 +00:00
|
|
|
let build_deps = ::bok::deps::Build(::bok::Collection::new());
|
|
|
|
let run_deps = ::bok::deps::Runtime(::bok::Collection::new());
|
|
|
|
|
|
|
|
let one = pkgs1.one();
|
|
|
|
use ::bok::Pkg;
|
2024-12-08 17:08:20 +00:00
|
|
|
//let res = one.dependencies_set(pkgs1, &build_deps, &run_deps);
|
|
|
|
//println!("{:?}", res);
|
2024-12-06 15:47:32 +00:00
|
|
|
|
|
|
|
let two = pkgs2.two();
|
2024-12-08 17:08:20 +00:00
|
|
|
//let res = two.dependencies_set(pkgs2, &build_deps, &run_deps);
|
|
|
|
//println!("{:?}", res);
|
|
|
|
*/
|
2024-02-16 18:08:03 +00:00
|
|
|
|
2024-11-29 15:59:22 +00:00
|
|
|
/*
|
2024-11-16 11:39:45 +00:00
|
|
|
let mut pb: pkgs::one::OneBuilder = pkgs1.one();
|
2024-11-10 18:31:48 +00:00
|
|
|
|
|
|
|
let b = pb.as_builder();
|
|
|
|
let a = pb.as_any_mut();
|
|
|
|
let m_pb2: Option<&mut pkgs::one::OneBuilder> = a.downcast_mut();
|
2024-11-10 20:06:52 +00:00
|
|
|
use ::bok::{Pkg, PkgBuilder};
|
2024-11-10 18:31:48 +00:00
|
|
|
println!("m_pb2: {:?}", m_pb2);
|
2024-11-10 20:06:52 +00:00
|
|
|
let m_pkg = pb.default_unused().build();
|
|
|
|
println!("m_pb2: {:?}", m_pkg);
|
|
|
|
if let Ok(pkg) = m_pkg {
|
2024-11-11 11:31:16 +00:00
|
|
|
println!("one: {}: {:?}", pkg.name(), pkg);
|
2024-11-10 20:06:52 +00:00
|
|
|
println!("hash one: {}", pkg.hash());
|
|
|
|
println!("hash one code: {}", pkg.hash_code());
|
|
|
|
}
|
2024-11-29 15:59:22 +00:00
|
|
|
*/
|
2024-11-10 18:31:48 +00:00
|
|
|
|
2024-11-16 11:39:45 +00:00
|
|
|
/*
|
|
|
|
println!("pkgs1 - 1:{}", pkgs1.one().default_unused().build().my_attr);
|
2024-02-16 18:34:33 +00:00
|
|
|
println!("pkgs1 - 2:{}", pkgs1.two().my_attr);
|
|
|
|
println!("pkgs2 - 1:{}", pkgs2.one().my_attr);
|
|
|
|
println!("pkgs2 - 2:{}", pkgs2.two().my_attr);
|
|
|
|
println!("pkgs2 - 3:{}", pkgs2.three().my_attr);
|
2024-03-27 10:34:09 +00:00
|
|
|
|
2024-11-10 18:31:48 +00:00
|
|
|
println!("pkgs2-1:\n{}", pkgs2.one());
|
|
|
|
println!("pkgs2-2:\n{}", pkgs2.two());
|
|
|
|
println!("pkgs2-3:\n{}", pkgs2.three());
|
2024-11-16 11:39:45 +00:00
|
|
|
*/
|
2024-02-16 09:51:56 +00:00
|
|
|
}
|