Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
Merge pull request #28 from johan-v-r/vs-file-excludes
Browse files Browse the repository at this point in the history
Add BuildingInsideVisualStudio condition check
  • Loading branch information
johan-v-r authored Aug 9, 2021
2 parents 84e2bef + 35dbf55 commit a84886f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package/LibSassBuilder.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>LibSassBuilder</id>
<version>1.6.3</version>
<version>1.6.4</version>
<title>LibSassBuilder</title>
<summary>Auto build task to compile .scss/.sass files to .css</summary>
<authors>Johan van Rensburg</authors>
Expand Down
18 changes: 14 additions & 4 deletions package/build/LibSassBuilder.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,28 @@
<EnableDefaultSassItems Condition="'$(EnableDefaultSassItems)'==''">true</EnableDefaultSassItems>
<DefaultSassExcludes>**/bin/**;**/obj/**;**/node_modules/**;**/logs/**</DefaultSassExcludes>

<DefaultItemExcludes Condition="'$(EnableDefaultSassItems)'=='true'">$(DefaultItemExcludes);**/*.scss;**/*.sass</DefaultItemExcludes>
<!--
exclude for VS - https://docs.microsoft.com/en-us/visualstudio/msbuild/visual-studio-integration-msbuild#build-solutions
required from this issue (VS bug) - https://github.com/johan-v-r/LibSassBuilder/issues/15
-->
<DefaultItemExcludes Condition="'$(EnableDefaultSassItems)'=='true' and '$(BuildingInsideVisualStudio)'=='true'">
$(DefaultItemExcludes);**/*.scss;**/*.sass
</DefaultItemExcludes>

<!-- Provide LibSassBuilderArgs to take complete control -->
<LibSassBuilderArgs Condition=" '$(LibSassBuilderArgs)'=='' "></LibSassBuilderArgs>

<!-- Add target to CustomCollectWatchItems -->
<CustomCollectWatchItems>$(CustomCollectWatchItems);_LibSass_CustomCollectWatchItems</CustomCollectWatchItems>
</PropertyGroup>

<ItemGroup Condition="'$(EnableDefaultItems)' == 'true' And '$(EnableDefaultSassItems)' == 'true'">
<SassFile Include="**/*.scss" ExcludeFromSingleFile="true" CopyToPublishDirectory="PreserveNewest" Exclude="$(DefaultSassExcludes);$(DefaultExcludesInProjectFolder);**/_*" />
<SassFile Include="**/*.sass" ExcludeFromSingleFile="true" Exclude="$(DefaultSassExcludes);$(DefaultExcludesInProjectFolder);**/_*" />
<!-- add all sass files -->
<SassFile Include="**/*.scss" ExcludeFromSingleFile="true" CopyToPublishDirectory="PreserveNewest" Exclude="$(DefaultSassExcludes);$(DefaultExcludesInProjectFolder)" />
<SassFile Include="**/*.sass" ExcludeFromSingleFile="true" Exclude="$(DefaultSassExcludes);$(DefaultExcludesInProjectFolder)" />

<!-- filter out variable files that don't get compiled -->
<SassFilesToCompile Include="@(SassFile)" Exclude="**/_*.scss;**/_*.sass"></SassFilesToCompile>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion package/build/LibSassBuilder.targets
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
BeforeTargets="BeforeBuild"
Condition="'$(_LibSassHashChanged)-$(LibSassShouldBuildBasedOnSassFiles)' == 'true-true' ">
<PropertyGroup>
<_SassFileList>@(SassFile->'&quot;%(FullPath)&quot;', ' ')</_SassFileList> <!-- all files, space seperated, surrounded with quotes -->
<_SassFileList>@(SassFilesToCompile->'&quot;%(FullPath)&quot;', ' ')</_SassFileList> <!-- all valid files, space seperated, surrounded with quotes -->
<LibSassBuilderArgs>files $(_SassFileList) --outputstyle $(LibSassOutputStyle) --level $(LibSassOutputLevel)</LibSassBuilderArgs>
</PropertyGroup>
<Message Text="Converted SassFile list to argument" Importance="$(LibSassMessageLevel)" />
Expand Down

0 comments on commit a84886f

Please sign in to comment.