Skip to content

Commit 710f6d4

Browse files
committed
[Rust] Make Rust crate version configurable.
1 parent 7ce24c3 commit 710f6d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/rust/RustGenerator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
*/
4949
public class RustGenerator implements CodeGenerator
5050
{
51+
private static final String CRATE_VERSION = System.getProperty("sbe.rust.crate.version");
5152
static final String WRITE_BUF_TYPE = "WriteBuf";
5253
static final String READ_BUF_TYPE = "ReadBuf";
5354
static final String BUF_LIFETIME = "'a";
@@ -114,10 +115,11 @@ public void generate() throws IOException
114115
{
115116
namespace = (ir.namespaceName() + "_" + packageName).toLowerCase();
116117
}
118+
final String version = CRATE_VERSION == null ? "0.1.0" : CRATE_VERSION;
117119

118120
indent(writer, 0, "[package]\n");
119121
indent(writer, 0, "name = \"%s\"\n", namespace);
120-
indent(writer, 0, "version = \"0.1.0\"\n");
122+
indent(writer, 0, "version = \"%s\"\n", version);
121123
indent(writer, 0, "authors = [\"sbetool\"]\n");
122124
indent(writer, 0, "description = \"%s\"\n", ir.description());
123125
indent(writer, 0, "edition = \"2021\"\n\n");

0 commit comments

Comments
 (0)