Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
c52f1258
Commit
c52f1258
authored
Apr 22, 2015
by
stijn
Browse files
msvc: Update genhdr script to emit MicroPython version numbers
parent
dea853d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
windows/msvc/genhdr.targets
View file @
c52f1258
...
...
@@ -55,11 +55,23 @@
<DestFile>
$(DestDir)py-version.h
</DestFile>
<TmpFile>
$(DestFile).tmp
</TmpFile>
</PropertyGroup>
<PropertyGroup>
<Ver>
$([System.Text.RegularExpressions.Regex]::Match($(GitTag), `^v[0-9\.]{5}`))
</Ver>
<Ver
Condition=
"'$(Ver)'==''"
>
v0.0.1
</Ver>
<Ver>
$(Ver.Remove(0, 1))
</Ver>
<VerMajor>
$(Ver.Split(`.`)[0])
</VerMajor>
<VerMinor>
$(Ver.Split(`.`)[1])
</VerMinor>
<VerMicro>
$(Ver.Split(`.`)[2])
</VerMicro>
</PropertyGroup>
<ItemGroup>
<Lines
Include=
"// This file was generated by $([System.IO.Path]::GetFileName(`$(MsBuildThisFile)`))"
/>
<Lines
Include=
"#define MICROPY_GIT_TAG "$(GitTag)""
/>
<Lines
Include=
"#define MICROPY_GIT_HASH "$(GitHash)""
/>
<Lines
Include=
"#define MICROPY_BUILD_DATE "$([System.DateTime]::Now.ToString(`yyyy-MM-dd`))""
/>
<Lines
Include=
"#define MICROPY_VERSION_MAJOR ($(VerMajor))"
/>
<Lines
Include=
"#define MICROPY_VERSION_MINOR ($(VerMinor))"
/>
<Lines
Include=
"#define MICROPY_VERSION_MICRO ($(VerMicro))"
/>
<Lines
Include=
"#define MICROPY_VERSION_STRING "$(Ver)""
/>
</ItemGroup>
<WriteLinesToFile
Lines=
"@(Lines)"
File=
"$(TmpFile)"
Overwrite=
"true"
/>
<MSBuild
Projects=
"$(MSBuildThisFileFullPath)"
Targets=
"CopyFileIfDifferent"
Properties=
"SourceFile=$(TmpFile);DestFile=$(DestFile)"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment