Skip to content

Commit

Permalink
[Broken] Add windows bootstrap and use SASS_LIBSASS_PATH consistently
Browse files Browse the repository at this point in the history
Relative path resolution in the scripts isn't working correctly. Then
this should get called as a a PreBuild step in the vcxproj to setup the
expexted layout if none is found
[skip ci]
  • Loading branch information
nschonni committed Sep 7, 2016
1 parent 02cab88 commit 71293f7
Show file tree
Hide file tree
Showing 3 changed files with 161 additions and 112 deletions.
43 changes: 43 additions & 0 deletions script/boostrap.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@echo off
setlocal

if not defined SASS_LIBSASS_PATH (
pushd .
cd "%~dp0..\..\"
set SASS_LIBSASS_PATH="%CD%"
popd
)
echo SASS_LIBSASS_PATH variable is %SASS_LIBSASS_PATH%

if NOT EXIST "%SASS_LIBSASS_PATH%" (
echo Make Dir "%SASS_LIBSASS_PATH%"
REM mkdir "%SASS_LIBSASS_PATH%"
)
if NOT EXIST "%SASS_LIBSASS_PATH%\.git\" (
echo Clone to "%SASS_LIBSASS_PATH%"
REM git clone https://github.com/sass/libsass.git "%SASS_LIBSASS_PATH%"
) ELSE (
echo "LibSass already exists, skiping Git Clone"
)

if not defined "%SASS_SPEC_PATH%" (
pushd .
cd "%~dp0..\..\sass-spec"
set SASS_SPEC_PATH="%CD%"
popd
REM echo "SASS_SPEC_PATH variable is missing, so using "%SASS_SPEC_PATH%"
)
echo SASS_SPEC_PATH variable is %SASS_SPEC_PATH%

if NOT EXIST "%SASS_SPEC_PATH%" (
echo Make Dir "%SASS_SPEC_PATH%"
)

if NOT EXIST "%SASS_SPEC_PATH%\.git" (
echo Clone to "%SASS_SPEC_PATH%"
REM git clone https://github.com/sass/sass-spec.git "$SASS_SPEC_PATH"
) ELSE (
echo "sass-spec already exists, skiping Git Clone"
)
git -C "%SASS_SPEC_PATH%" describe --abbrev=4 --dirty --always --tags
REM exit 0
18 changes: 12 additions & 6 deletions win/sassc.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
<PropertyGroup>
<SASSC_VERSION>[NA]</SASSC_VERSION>
<LIBSASS_VERSION>[NA]</LIBSASS_VERSION>
<LIBSASS_DIR>..\..\libsass</LIBSASS_DIR>
<LIBSASS_SRC_DIR>$(LIBSASS_DIR)\src</LIBSASS_SRC_DIR>
<LIBSASS_HEADERS_DIR>$(LIBSASS_DIR)\src</LIBSASS_HEADERS_DIR>
<LIBSASS_INCLUDES_DIR>$(LIBSASS_DIR)\include</LIBSASS_INCLUDES_DIR>
<SASS_LIBSASS_PATH Condition="'$(SASS_LIBSASS_PATH)'==''">..\..\libsass</SASS_LIBSASS_PATH>
</PropertyGroup>
<Target Name="GitVersion">
<Exec Command="git -C .. describe --abbrev=4 --dirty --always --tags" LogStandardErrorAsError="true" ContinueOnError="true" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="SASSC_VERSION" />
</Exec>
<Exec Command="git -C $(LIBSASS_DIR) describe --abbrev=4 --dirty --always --tags" LogStandardErrorAsError="true" ContinueOnError="true" ConsoleToMSBuild="true">
<Exec Command="git -C $(SASS_LIBSASS_PATH) describe --abbrev=4 --dirty --always --tags" LogStandardErrorAsError="true" ContinueOnError="true" ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="LIBSASS_VERSION" />
</Exec>
</Target>
Expand Down Expand Up @@ -98,13 +95,22 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|Win32' Or '$(Configuration)|$(Platform)' == 'Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEventUseInBuild>true</PreBuildEventUseInBuild>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..;posix;$(LIBSASS_INCLUDES_DIR);$(LIBSASS_HEADERS_DIR);$(LIBSASS_INCLUDES_DIR)\sass;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AssemblerListingLocation>$(IntDir)/%(RelativeDir)/</AssemblerListingLocation>
<ObjectFileName>$(IntDir)/%(RelativeDir)/</ObjectFileName>
<XMLDocumentationFileName>$(IntDir)/%(RelativeDir)/</XMLDocumentationFileName>
</ClCompile>
<PreBuildEvent>
<Command>call "$(SolutionDir)..\script\bootstrap.cmd"</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Set and print the environmental variables we care about</Message>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down Expand Up @@ -166,7 +172,7 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(LIBSASS_DIR)\win\libsass.targets" />
<Import Project="$(SASS_LIBSASS_PATH)\win\libsass.targets" />
<ItemGroup>
<ClCompile Include="posix\getopt.c" />
<ClCompile Include="..\sassc.c" />
Expand Down
Loading

0 comments on commit 71293f7

Please sign in to comment.