-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved bp3d-tracing to its own workspace member to prepare for new mul…
…ti-crate design
- Loading branch information
Showing
18 changed files
with
112 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,2 @@ | ||
[package] | ||
name = "bp3d-tracing" | ||
version = "1.0.0-rc.2.1.0" | ||
authors = ["Yuri Edward <[email protected]>"] | ||
edition = "2021" | ||
description = "Tracing subscriber implementations for use with BP3D software. Supports traditional logging through bp3d-logger and supports remote profiling through TCP." | ||
license = "BSD-3-Clause" | ||
repository = "https://gitlab.com/bp3d/tracing/tracing" | ||
readme = "./README.MD" | ||
keywords = ["bp3d", "tracing"] | ||
categories = ["development-tools", "development-tools::debugging", "development-tools::profiling"] | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
bp3d-logger = "2.0.0-rc.2.0.0" | ||
|
||
[build-dependencies] | ||
semver = "1.0.7" | ||
[workspace] | ||
members = ["tracing"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright (c) 2024, BlockProject 3D | ||
// | ||
// All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without modification, | ||
// are permitted provided that the following conditions are met: | ||
// | ||
// * Redistributions of source code must retain the above copyright notice, | ||
// this list of conditions and the following disclaimer. | ||
// * Redistributions in binary form must reproduce the above copyright notice, | ||
// this list of conditions and the following disclaimer in the documentation | ||
// and/or other materials provided with the distribution. | ||
// * Neither the name of BlockProject 3D nor the names of its contributors | ||
// may be used to endorse or promote products derived from this software | ||
// without specific prior written permission. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
use semver::Version; | ||
use std::fs::File; | ||
use std::io::BufWriter; | ||
use std::io::Write; | ||
use std::path::PathBuf; | ||
|
||
const WRITE_FAIL: &str = "Failed to write verision_inject file"; | ||
|
||
fn main() { | ||
let path = std::env::var_os("OUT_DIR") | ||
.map(PathBuf::from) | ||
.expect("Couldn't obtain cargo OUT_DIR") | ||
.join("version_inject.rs"); | ||
let file = File::create(path).expect("Couldn't create version_inject file"); | ||
let mut writer = BufWriter::new(file); | ||
let version = std::env::var("CARGO_PKG_VERSION").expect("Unable to read package version"); | ||
let version = Version::parse(&version).expect("Failed to parse package version"); | ||
if !version.pre.is_empty() { | ||
write!(&mut writer, "const VERSION_DATA: [u8; 24] = [").expect(WRITE_FAIL); | ||
let len = std::cmp::min(24, version.pre.as_bytes().len()); | ||
for v in 0..len { | ||
write!(&mut writer, "0x{:X}, ", version.pre.as_bytes()[v]).expect(WRITE_FAIL); | ||
} | ||
for _ in 0..24 - len { | ||
write!(&mut writer, "0x0, ").expect(WRITE_FAIL); | ||
} | ||
writeln!(&mut writer, "];").expect(WRITE_FAIL); | ||
writeln!( | ||
&mut writer, | ||
"pub const HELLO_PACKET: Hello = Hello::new({}, Some(VERSION_DATA));", | ||
version.major | ||
) | ||
.expect(WRITE_FAIL); | ||
} else { | ||
writeln!( | ||
&mut writer, | ||
"pub const HELLO_PACKET: Hello = Hello::new({}, None);", | ||
version.major | ||
) | ||
.expect(WRITE_FAIL); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "bp3d-tracing" | ||
version = "1.0.0-rc.2.1.0" | ||
authors = ["Yuri Edward <[email protected]>"] | ||
edition = "2021" | ||
description = "Tracing subscriber implementations for use with BP3D software. Supports traditional logging through bp3d-logger and supports remote profiling through TCP." | ||
license = "BSD-3-Clause" | ||
repository = "https://gitlab.com/bp3d/tracing/tracing" | ||
readme = "./README.MD" | ||
keywords = ["bp3d", "tracing"] | ||
categories = ["development-tools", "development-tools::debugging", "development-tools::profiling"] | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
bp3d-logger = "2.0.0-rc.2.0.0" | ||
|
||
[build-dependencies] | ||
semver = "1.0.7" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.