Skip to content

Commit 154aac6

Browse files
committed
Merge pull request #1357 from mgreter/feature/msc-git-version
Add automatic git versions for vcxproj file
2 parents 2c1af24 + 33cfb52 commit 154aac6

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

win/libsass.vcxproj

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project ToolsVersion="12.0" DefaultTargets="GitVersion;Main"
3+
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
4+
5+
<PropertyGroup>
6+
<SASSC_VERSION>[NA]</SASSC_VERSION>
7+
<LIBSASS_VERSION>[NA]</LIBSASS_VERSION>
8+
</PropertyGroup>
9+
10+
<Target Name="GitVersion">
11+
12+
<Exec Command="git -C .. describe --abbrev=4 --dirty --always --tags > libsass-version" />
13+
<Exec Command="git -C ../sassc describe --abbrev=4 --dirty --always --tags > sassc-version" />
14+
15+
<ReadLinesFromFile File="sassc-version">
16+
<Output TaskParameter="Lines" PropertyName="SASSC_VERSION" />
17+
</ReadLinesFromFile>
18+
<ReadLinesFromFile File="libsass-version">
19+
<Output TaskParameter="Lines" PropertyName="LIBSASS_VERSION" />
20+
</ReadLinesFromFile>
21+
</Target>
22+
23+
<Target Name="VersionMacros">
24+
<ItemGroup>
25+
<ClCompile><PreprocessorDefinitions>%(PreprocessorDefinitions);SASSC_VERSION="$(SASSC_VERSION)"</PreprocessorDefinitions></ClCompile>
26+
<ClCompile><PreprocessorDefinitions>%(PreprocessorDefinitions);LIBSASS_VERSION="$(LIBSASS_VERSION)"</PreprocessorDefinitions></ClCompile>
27+
</ItemGroup>
28+
</Target>
29+
30+
<Target Name="Main">
31+
<Message Text="sassc: $(SASSC_VERSION)" />
32+
<Message Text="libsass: $(LIBSASS_VERSION)" />
33+
<CallTarget Targets="VersionMacros" />
34+
<CallTarget Targets="Build" />
35+
</Target>
36+
337
<ItemGroup Label="ProjectConfigurations">
438
<ProjectConfiguration Include="Debug|Win32">
539
<Configuration>Debug</Configuration>

0 commit comments

Comments
 (0)