Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linked DLL references and remove copying #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions LibSass.NET.Tests/LibSass.NET.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
<AssemblyName>LibSass.NET.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>bin\$(Configuration)\obj\</IntermediateOutputPath>
<IntermediateOutputPath>obj\$(Configuration)</IntermediateOutputPath>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional to keep everything under bin/.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for that? This is the usual layout for projects.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just better to have one output folder with all the intermediate stuff as normally happens in case of Unix. That's the reason I moved obj in bin during the rewrite. Otherwise, I have no strong preference. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'm going to leave it for now, but I'll start to look at some of the Core stuff to see what they're doing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, regarding that, I have been using DNX/Core for over an year now and have survived at least 5 era of upgrades (starting from DNX beta7) 😬. One thing you might notice that there is a lot of stuff already deprecated. So just skip whatever is older than a month or max two months old.

From tooling point of view, the key elements are:

https://github.com/dotnet/cli (command line utility which user and VS are using today to compile projects)

which depends on:
https://github.com/dotnet/core-setup (dotnet.exe aka muxer utility)

and:
https://github.com/dotnet/sdk (where the real magic is happening)

which has another dependent:
https://github.com/dotnet/roslyn-project-system (the new CPS based project system written for VS2017+ and above, see readme for more info)

Note that they are not only .NET Core tools, these tools are made so that they are backward and forward compatible and provide xplat support. For instance, we can potentially configure a project targeting multiple frameworks: v2, v3, v3.5, v4, v4.5, v4.6, netstandard1.1, netstandard1.3, netstandard1.5 and netstandard1.7 and build with a single command dotnet build or msbuild mySolution.sln.

Think of SDK as an API, which CLI and RPS are implementing, but today VS2015 and command line usage, both are consuming the CLI as SDK is comparatively a new abstraction in the OSS toolset.

Also, upcoming msbuild v15 used in VS2017 is based on msbuild repo's default branch xplat instead of master. Both will be merged soon™️ but master which is windows only is irrelevant. MSBuild is not under dotnet org (but Microsoft), as it has non-dotnet usages as well.

We can further the discussion on Slack channel. Question is; are you READY? 😎

<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>512</FileAlignment>
<LibSassPath>$(SolutionDir)\bin\$(Configuration)\</LibSassPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -115,10 +114,4 @@
</PropertyGroup>
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props'))" />
</Target>
<Target Name="AfterBuild">
<Copy
SourceFiles="$(LibSassPath)libsass32.dll;$(LibSassPath)libsass64.dll"
DestinationFolder="$(OutputPath)"
SkipUnchangedFiles="true" />
</Target>
</Project>
33 changes: 27 additions & 6 deletions LibSass.NET/LibSass.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
<RootNamespace>LibSass</RootNamespace>
<AssemblyName>LibSass.NET</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<OutputPath>$(SolutionDir)bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>$(SolutionDir)bin\$(Configuration)\obj\</IntermediateOutputPath>
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>512</FileAlignment>
<LibSass32>$(SolutionDir)bin\$(Configuration)\libsass32.dll</LibSass32>
<LibSass64>$(SolutionDir)bin\$(Configuration)\libsass64.dll</LibSass64>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -66,16 +68,35 @@
</ItemGroup>
<ItemGroup>
<None Include="LibSass.Net.nuspec" />
<None Include="libsassnet.targets" />
<None Include="libsassnet.targets">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Runtime.Serialization" />
</ItemGroup>
<ItemGroup>
<Content Include="$(LibSass32)">
<Link>libsass32.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="$(LibSass64)">
<Link>libsass64.dll</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With #53, we have single libsass.dll now. However, this can be simplified to

<Content Include="$(OutputPath)\libsass.*">

* is to provide Unix extension support (.dll -> .so or .dylib etc.)

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- Build LibSass -->
<Target Name="AfterBuild">
<MSBuild Targets="Build" Projects="..\LibSass\win\libsass.sln" BuildInParallel="true" Properties="Configuration=$(Configuration);Platform=Win32;TargetName=libsass32;OutDir=$(OutputPath);IntDir=$(IntermediateOutputPath)" />
<MSBuild Targets="Build" Projects="..\LibSass\win\libsass.sln" BuildInParallel="true" Properties="Configuration=$(Configuration);Platform=Win64;TargetName=libsass64;OutDir=$(OutputPath);IntDir=$(IntermediateOutputPath)" />
<Target Name="BeforeBuild">
<MSBuild Targets="Build" Projects="..\LibSass\win\libsass.sln" BuildInParallel="true" Properties="Configuration=$(Configuration);Platform=Win32;TargetName=libsass32;OutDir=$(SolutionDir)bin\$(Configuration)\;IntDir=$(SolutionDir)bin\$(Configuration)\obj\Win32\" Condition="!Exists('$(LibSass32)')" />
<MSBuild Targets="Build" Projects="..\LibSass\win\libsass.sln" BuildInParallel="true" Properties="Configuration=$(Configuration);Platform=Win64;TargetName=libsass64;OutDir=$(SolutionDir)bin\$(Configuration)\;IntDir=$(SolutionDir)bin\$(Configuration)\obj\Win64\" Condition="!Exists('$(LibSass64)')" />
</Target>
<Target Name="AfterClean">
<ItemGroup>
<FilesToDelete Include="$(SolutionDir)bin\$(Configuration)\**\*"/>
</ItemGroup>
<Delete Files="@(FilesToDelete)" />
<RemoveDir Directories="$(SolutionDir)bin\$(Configuration)\" />
</Target>
</Project>
6 changes: 3 additions & 3 deletions LibSass.NET/LibSass.Net.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<tags>SASS SCSS CSS LibSass</tags>
</metadata>
<files>
<file src="..\bin\$configuration$\libsass64.dll" target="build\libsass64.dll" />
<file src="..\bin\$configuration$\libsass32.dll" target="build\libsass32.dll" />
<file src="bin\$configuration$\libsass64.dll" target="build\libsass64.dll" />
<file src="bin\$configuration$\libsass32.dll" target="build\libsass32.dll" />
<file src="libsassnet.targets" target="build\libsassnet.targets" />
<file src="..\bin\$configuration$\LibSass.NET.dll" target="lib\net40\LibSass.NET.dll" />
<file src="bin\$configuration$\LibSass.NET.dll" target="lib\net40\LibSass.NET.dll" />
</files>
</package>
9 changes: 1 addition & 8 deletions contrib/LibSass.NET.Console/LibSass.NET.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
<AssemblyName>LibSass.NET.Console</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>bin\$(Configuration)\obj\</IntermediateOutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>512</FileAlignment>
<LibSassPath>$(SolutionDir)\bin\$(Configuration)\</LibSassPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -49,10 +48,4 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
<Copy
SourceFiles="$(LibSassPath)libsass32.dll;$(LibSassPath)libsass64.dll"
DestinationFolder="$(OutputPath)"
SkipUnchangedFiles="true" />
</Target>
</Project>
9 changes: 1 addition & 8 deletions contrib/LibSass.NET.Web/LibSass.NET.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
<AssemblyName>LibSass.NET.Web</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>bin\$(Configuration)\obj\</IntermediateOutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>512</FileAlignment>
<LibSassPath>$(SolutionDir)\bin\$(Configuration)\</LibSassPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -56,10 +55,4 @@
<None Include="web.config.transform" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
<Copy
SourceFiles="$(LibSassPath)libsass32.dll;$(LibSassPath)libsass64.dll"
DestinationFolder="$(OutputPath)"
SkipUnchangedFiles="true" />
</Target>
</Project>