Skip to content
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
4 changes: 2 additions & 2 deletions spkl/SparkleXrm.Tasks/SparkleXrm.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.23\lib\net462\Microsoft.Crm.Sdk.Proxy.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Extensions.FileSystemGlobbing, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.FileSystemGlobbing.3.1.0\lib\netstandard2.0\Microsoft.Extensions.FileSystemGlobbing.dll</HintPath>
<Reference Include="Microsoft.Extensions.FileSystemGlobbing, Version=3.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.FileSystemGlobbing.3.1.1\lib\netstandard2.0\Microsoft.Extensions.FileSystemGlobbing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.4\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion spkl/SparkleXrm.Tasks/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<package id="Microsoft.CrmSdk.Deployment" version="9.0.2.23" targetFramework="net462" />
<package id="Microsoft.CrmSdk.Workflow" version="9.0.2.23" targetFramework="net462" />
<package id="Microsoft.CrmSdk.XrmTooling.CoreAssembly" version="9.1.0.38" targetFramework="net462" />
<package id="Microsoft.Extensions.FileSystemGlobbing" version="3.1.0" targetFramework="net462" />
<package id="Microsoft.Extensions.FileSystemGlobbing" version="3.1.1" targetFramework="net462" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="5.2.4" targetFramework="net462" />
<package id="Microsoft.Rest.ClientRuntime" version="2.3.20" targetFramework="net462" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net462" />
Expand Down
1 change: 1 addition & 0 deletions spkl/spkl/Package/spkl.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@
<file src="..\bin\Release\spkl.CrmSvcUtilExtensions.dll" target="tools\spkl.CrmSvcUtilExtensions.dll" />
<file src="..\bin\Release\spkl.exe" target="tools\spkl.exe" />
<file src="..\bin\Release\spkl.exe.config" target="tools\spkl.exe.config" />
<file src="spkl.targets" target="build\spkl.targets" />
</files>
</package>
88 changes: 88 additions & 0 deletions spkl/spkl/Package/spkl.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Target Name="ProjectCheck" BeforeTargets="Build">

<PropertyGroup>

<IsSdk>false</IsSdk>
<IsSdk Condition="'$(UsingNETSdkDefaults)' == 'true'">true</IsSdk>

<ProjFile>$([System.IO.File]::ReadAllText($(MSBuildProjectFullPath)))</ProjFile>
<PackageRefRegex>(&lt;PackageReference\s+Include=&quot;|&lt;RestoreProjectStyle&gt;PackageReference&lt;&#47;RestoreProjectStyle&gt;)</PackageRefRegex>
<IsPackageRef>$([System.Text.RegularExpressions.Regex]::IsMatch($(ProjFile), $(PackageRefRegex)))</IsPackageRef>

</PropertyGroup>

<Message Text="Is SDK-style project: $(IsSdk)" />
<Message Text="Using package reference: $(IsPackageRef)" />

</Target>

<Target Name="CopySpklArtefacts" BeforeTargets="Build" Condition="$(IsPackageRef)">

<ItemGroup>
<SpklArtefacts Include="$(MSBuildThisFileDirectory)..\content\**\*.*" />
</ItemGroup>

<Copy Condition="!Exists('%(RecursiveDir)%(Filename)%(Extension)')"
SourceFiles="@(SpklArtefacts)"
DestinationFolder="$(MSBuildProjectDirectory)\%(RecursiveDir)"
SkipUnchangedFiles="true"/>

</Target>

<Target Name="CopySpklTools" BeforeTargets="Build" Condition="$(IsPackageRef)">

<PropertyGroup>
<SpklVersion>$(MSBuildThisFileDirectory.Substring($(MSBuildThisFileDirectory.IndexOf('\spkl\'))).Replace('\spkl\','').Replace('\build\',''))</SpklVersion>
</PropertyGroup>

<ItemGroup>
<SpklTools Include="$(MSBuildThisFileDirectory)..\tools\*.*" />
</ItemGroup>

<Message Text="spkl version: $(SpklVersion)" />

<Copy
SourceFiles="@(SpklTools)"
DestinationFolder="$(MSBuildProjectDirectory)\..\packages\spkl.$(SpklVersion)\tools\"
SkipUnchangedFiles="true"/>
</Target>

<Target Name="CopyCoreTools" BeforeTargets="Build" Condition="$(IsPackageRef)">

<PropertyGroup>
<NugetVersionRegex>\d+.\d+.\d+(.\d+)?(-\w*)?</NugetVersionRegex>
<CoreToolsRegex>(?i)(?&lt;=&lt;PackageReference\s+Include=&quot;Microsoft.CrmSdk.CoreTools&quot;(\s*&gt;\s*&lt;Version&gt;|\s+Version=&quot;))($(NugetVersionRegex))(?=(&lt;&#47;Version&gt;\s*&lt;&#47;PackageReference&gt;|&quot;\s*&#47;&gt;))</CoreToolsRegex>
<CoreToolsVersion>$([System.Text.RegularExpressions.Regex]::Match($(ProjFile), $(CoreToolsRegex)))</CoreToolsVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(CoreToolsVersion)' == ''">
<NuspecFile>$([System.IO.File]::ReadAllText($(MSBuildThisFileDirectory)..\spkl.nuspec))</NuspecFile>
<CoreToolsRegex>(?i)(?&lt;=&lt;dependency\s+id=&quot;Microsoft.CrmSdk.CoreTools&quot;\s+version=&quot;)($(NugetVersionRegex))(?=&quot;\s+&#47;&gt;)</CoreToolsRegex>
<CoreToolsVersion>$([System.Text.RegularExpressions.Regex]::Match($(NuspecFile), $(CoreToolsRegex)))</CoreToolsVersion>
</PropertyGroup>

<Message Text="CoreTools version: $(CoreToolsVersion)" />

<ItemGroup>
<CoreTools Include="$(MSBuildThisFileDirectory)..\..\..\microsoft.crmsdk.coretools\$(CoreToolsVersion)\content\bin\coretools\*.*" />
</ItemGroup>

<Copy
SourceFiles="@(CoreTools)"
DestinationFolder="$(MSBuildProjectDirectory)\..\packages\Microsoft.CrmSdk.CoreTools.$(CoreToolsVersion)\content\bin\coretools"
SkipUnchangedFiles="true"/>

</Target>

<Target Name="CleanOldCoreTools" BeforeTargets="Build" Condition="$(IsPackageRef)">

<ItemGroup>
<OldCoreTools Include="$([System.IO.Directory]::GetDirectories($(MSBuildProjectDirectory)\..\packages\, Microsoft.CrmSdk.CoreTools.*))" Exclude="$([System.IO.Directory]::GetDirectories($(MSBuildProjectDirectory)\..\packages\, Microsoft.CrmSdk.CoreTools.$(CoreToolsVersion)))" />
</ItemGroup>
<RemoveDir Directories="@(OldCoreTools)" />

</Target>

</Project>
1 change: 1 addition & 0 deletions spkl/spkl/spkl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="Package\spkl.targets" />
<None Include="Package\spkl\download-webresources.bat" />
<None Include="Package\spkl\instrument-plugin-code.bat" />
<None Include="Package\spkl\earlybound.bat" />
Expand Down