From 1bcc92609ae6d7081cbede29ee7ac06b55f03e90 Mon Sep 17 00:00:00 2001 From: pentamassiv Date: Mon, 7 Aug 2023 03:21:09 +0200 Subject: [PATCH] Exclude tests folder and Gir.toml, versions.txt files from being published --- src/codegen/sys/cargo_toml.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/codegen/sys/cargo_toml.rs b/src/codegen/sys/cargo_toml.rs index 44ce52239..9cb9975ff 100644 --- a/src/codegen/sys/cargo_toml.rs +++ b/src/codegen/sys/cargo_toml.rs @@ -102,6 +102,16 @@ fn fill_in(root: &mut Table, env: &Env) { let package = upsert_table(root, "package"); set_string(package, "build", "build.rs"); // set_string(package, "version", "0.2.0"); + + if let toml::map::Entry::Vacant(_) = package.entry("include") { + package.entry("exclude").or_insert_with(|| { + Value::Array(vec![ + Value::String("tests".to_string()), + Value::String("Gir.toml".to_string()), + Value::String("versions.txt".to_string()), + ]) + }); + } } {