bok/bok-utils/src/main.rs

71 lines
2.3 KiB
Rust
Raw Normal View History

/*
* Copyright 2024 Luca Fulchir <luca.fulchir@runesauth.com>
*
* 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
*
* 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.
*/
mod conf;
mod repos;
fn main() {
//let one = repos::pkgs::one::One::default();
use ::std::sync::Arc;
let pkgs1 = Arc::new(repos::R1::default());
let pkgs2 = Arc::new(repos::R2::default());
use ::bok::Repository;
println!("pkgs1: {}", pkgs1.name());
println!("pkgs2: {}", pkgs2.name());
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;
let res = one.dependencies_set(pkgs1, &build_deps, &run_deps);
println!("{:?}", res);
let two = pkgs2.two();
let res = two.dependencies_set(pkgs2, &build_deps, &run_deps);
println!("{:?}", res);
/*
let mut pb: pkgs::one::OneBuilder = pkgs1.one();
let b = pb.as_builder();
let a = pb.as_any_mut();
let m_pb2: Option<&mut pkgs::one::OneBuilder> = a.downcast_mut();
use ::bok::{Pkg, PkgBuilder};
println!("m_pb2: {:?}", m_pb2);
let m_pkg = pb.default_unused().build();
println!("m_pb2: {:?}", m_pkg);
if let Ok(pkg) = m_pkg {
println!("one: {}: {:?}", pkg.name(), pkg);
println!("hash one: {}", pkg.hash());
println!("hash one code: {}", pkg.hash_code());
}
*/
/*
println!("pkgs1 - 1:{}", pkgs1.one().default_unused().build().my_attr);
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);
println!("pkgs2-1:\n{}", pkgs2.one());
println!("pkgs2-2:\n{}", pkgs2.two());
println!("pkgs2-3:\n{}", pkgs2.three());
*/
}