Skip to main content

cargo_swift/
templating.rs

1use askama::Template;
2
3#[derive(Template)]
4#[template(path = "template.toml", escape = "none")]
5pub(crate) struct CargoToml<'a> {
6    pub(crate) crate_name: &'a str,
7    pub(crate) namespace: &'a str,
8    // TODO: Use LibType::identifier here
9    pub(crate) lib_type: &'a str,
10    pub(crate) macro_only: bool,
11}
12
13#[derive(Template)]
14#[template(path = "build.rs", escape = "none")]
15pub(crate) struct BuildRs {}
16
17#[derive(Template)]
18#[template(path = "lib.rs", escape = "none")]
19pub(crate) struct LibRs {
20    pub(crate) plain: bool,
21    pub(crate) macro_only: bool,
22}
23
24#[derive(Template)]
25#[template(path = "lib.udl", escape = "none")]
26pub(crate) struct LibUdl<'a> {
27    pub(crate) namespace: &'a str,
28    pub(crate) plain: bool,
29}
30
31#[derive(Template)]
32#[template(path = "Package.swift", escape = "none")]
33pub(crate) struct PackageSwift<'a> {
34    pub(crate) package_name: &'a str,
35    pub(crate) xcframework_name: &'a str,
36    pub(crate) disable_warnings: bool,
37    pub(crate) platforms: &'a str,
38    pub(crate) swift_tools_version: &'a str,
39}