Skip to content

Commit

Permalink
Replace vergen (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Sep 8, 2024
1 parent 5d34792 commit 8fece6c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 112 deletions.
108 changes: 21 additions & 87 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions crates/kitsune-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ authors.workspace = true
edition.workspace = true
version.workspace = true
license.workspace = true
build = "build.rs"

[dependencies]
async-trait = "0.1.82"
const_format = "0.2.33"
git-version = "0.3.9"
kitsune-db = { workspace = true }
kitsune-error = { workspace = true }
paste = "1.0.15"
Expand All @@ -17,8 +17,5 @@ triomphe = { workspace = true }
typed-builder = "0.20.0"
unsize = "1.1.0"

[build-dependencies]
vergen-gitcl = { version = "1.0.0", features = ["build"] }

[lints]
workspace = true
19 changes: 0 additions & 19 deletions crates/kitsune-core/build.rs

This file was deleted.

19 changes: 17 additions & 2 deletions crates/kitsune-core/src/consts.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
use const_format::concatcp;
use git_version::git_version;

pub const API_MAX_LIMIT: usize = 40;
pub const MAX_EMOJI_SHORTCODE_LENGTH: usize = 64;
pub const MAX_MEDIA_DESCRIPTION_LENGTH: usize = 5000;
pub const PROJECT_IDENTIFIER: &str = env!("CARGO_PRIMARY_PACKAGE");

pub const PROJECT_IDENTIFIER: &str = const {
const FALLBACK_NAME: &str = "kitsune";

if let Some(package_name) = option_env!("CARGO_PRIMARY_PACKAGE") {
package_name
} else {
FALLBACK_NAME
}
};

pub const USER_AGENT: &str = concatcp!(PROJECT_IDENTIFIER, "/", VERSION);
pub const VERSION: &str = concatcp!(env!("CARGO_PKG_VERSION"), "-", env!("VERGEN_GIT_SHA"));
pub const VERSION: &str = concatcp!(
env!("CARGO_PKG_VERSION"),
"-",
git_version!(fallback = "unknown")
);

0 comments on commit 8fece6c

Please sign in to comment.