Skip to content

Commit

Permalink
Merge pull request #17 from cake-contrib/feature/16
Browse files Browse the repository at this point in the history
Remove embedding references and update instructions
  • Loading branch information
louisfischer committed Oct 16, 2019
2 parents b492317 + 4c4eb09 commit c6c86e7
Show file tree
Hide file tree
Showing 5 changed files with 3,134 additions and 486 deletions.
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -3,6 +3,18 @@
Cake.SSRS is set of aliases for [Cake](http://cakebuild.net/) that help simplify deploying objects to SQL Server Reporting Services.
Release notes can be found [here](https://github.com/cake-contrib/Cake.SSRS/releases).

You can easily reference Cake.SSRS directly in your build script via a cake addin:

```csharp
#addin nuget:?package=System.ServiceModel.Duplex&version=4.4.4
#addin nuget:?package=System.ServiceModel.Http&version=4.4.4
#addin nuget:?package=System.ServiceModel.NetTcp&version=4.4.4
#addin nuget:?package=System.ServiceModel.Security&version=4.4.4
#addin nuget:?package=Cake.SSRS
```

NOTE: It's very important at this point in time to specify the System.ServiceModel.* packages and the version _4.4.4_ for it.

[![License](http://img.shields.io/:license-mit-blue.svg)](http://cake-contrib.mit-license.org)

## Information
Expand Down
8 changes: 4 additions & 4 deletions src/Cake.SSRS.Tests/Cake.SSRS.Tests.csproj
Expand Up @@ -77,10 +77,10 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="NSubstitute" Version="3.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="System.ServiceModel.Duplex" Version="4.4.0" />
<PackageReference Include="System.ServiceModel.Http" Version="4.4.0" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="4.4.0" />
<PackageReference Include="System.ServiceModel.Security" Version="4.4.0" />
<PackageReference Include="System.ServiceModel.Duplex" Version="4.4.4" />
<PackageReference Include="System.ServiceModel.Http" Version="4.4.4" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="4.4.4" />
<PackageReference Include="System.ServiceModel.Security" Version="4.4.4" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
43 changes: 28 additions & 15 deletions src/Cake.SSRS/Aliases/SsrsAliases.cs
@@ -1,4 +1,4 @@
using Cake.Core;
using Cake.Core;
using Cake.Core.Annotations;
using Cake.Core.IO;
using System;
Expand All @@ -10,9 +10,22 @@

namespace Cake.SSRS
{
#pragma warning disable CS1570
/// <summary>
/// Contains functionality for working with SQL Server Reporting Services (SSRS)
/// <para>SQL Server Reporting Services (SSRS) related cake aliases.</para>
/// <para>
/// In order to use aliases from this addin, you will need to also reference to several 'System.ServiceModel.* packages as an addin.
/// Here is what including Cake.SSRS in your script should look like:
/// <code>
/// #addin nuget:?package=System.ServiceModel.Duplex&version=4.4.4
/// #addin nuget:?package=System.ServiceModel.Http&version=4.4.4
/// #addin nuget:?package=System.ServiceModel.NetTcp&version=4.4.4
/// #addin nuget:?package=System.ServiceModel.Security&version=4.4.4
/// #addin nuget:?package=Cake.SSRS
/// </code>
/// </para>
/// </summary>
#pragma warning restore CS1570
[CakeAliasCategory("SSRS")]
[CakeNamespaceImport("Cake.SSRS")]
public static class SsrsAliases
Expand Down Expand Up @@ -52,7 +65,7 @@ public static CatalogItem SsrsCreateFolder(this ICakeContext context, string fol
parentFolder = "/";

var client = GetReportingService(context, settings);

var request = new FindItemRequest
{
Folder = parentFolder,
Expand Down Expand Up @@ -264,7 +277,7 @@ public static IEnumerable<CatalogItem> SsrsUploadReport(this ICakeContext contex

return SsrsUploadReport(context, pattern, folderPath, properties, settings);
}

/// <summary>
/// Uploads an SSRS Report (.rdl) to the folder specified for the given globber pattern
/// </summary>
Expand Down Expand Up @@ -293,7 +306,7 @@ public static IEnumerable<CatalogItem> SsrsUploadReport(this ICakeContext contex
var items = new List<CatalogItem>();

var filePaths = context.Globber.GetFiles(pattern);
if(filePaths == null || filePaths.Count() < 1)
if (filePaths == null || filePaths.Count() < 1)
{
context.Log.Write(Core.Diagnostics.Verbosity.Normal, Core.Diagnostics.LogLevel.Warning, "No Report files found matching the pattern '{0}'", pattern);
return items;
Expand Down Expand Up @@ -719,10 +732,10 @@ public static CatalogItem SsrsFindItem(this ICakeContext context, FindItemReques
{
if (settingsConfigurator == null)
throw new ArgumentNullException(nameof(settingsConfigurator));

var settings = new SsrsConnectionSettings();
settingsConfigurator(settings);

return SsrsFindItem(context, request, settings);
}

Expand Down Expand Up @@ -894,16 +907,16 @@ private static CatalogItem CreateOrUpdateDataSource(ICakeContext context, Report

if (rds.ConnectionProperties?.IntegratedSecurity == true)
dsd.CredentialRetrieval = CredentialRetrievalEnum.Integrated;

context.Log.Write(Core.Diagnostics.Verbosity.Normal, Core.Diagnostics.LogLevel.Information, "Uploading {0} to {1}...", rds.Name, request.FolderPath);

var dataSourceRequest = new CreateDataSourceRequest
{
DataSource = rds.Name,
Parent = request.FolderPath,
Definition = dsd,
Overwrite = true,
Properties = properties
DataSource = rds.Name,
Parent = request.FolderPath,
Definition = dsd,
Overwrite = true,
Properties = properties
};

var catalogResponse = client.CreateDataSourceAsync(dataSourceRequest).GetAwaiter().GetResult();
Expand Down Expand Up @@ -1026,7 +1039,7 @@ private static void VerifyParameters(ICakeContext context, SsrsConnectionSetting
}

private static HttpClientCredentialType GetClientCredential(ClientCredentialType clientCredentialType)
{
{
switch (clientCredentialType)
{
case ClientCredentialType.Basic:
Expand All @@ -1039,7 +1052,7 @@ private static HttpClientCredentialType GetClientCredential(ClientCredentialType
return HttpClientCredentialType.None;
}
}

private static BasicHttpSecurityMode GetHttpSecurityMode(SecurityMode securityMode)
{
switch (securityMode)
Expand Down
41 changes: 5 additions & 36 deletions src/Cake.SSRS/Cake.SSRS.csproj
Expand Up @@ -5,9 +5,8 @@
<DebugSymbols>true</DebugSymbols>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>0</WarningLevel>
<PreserveCompilationContext>true</PreserveCompilationContext>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -34,39 +33,9 @@

<ItemGroup>
<PackageReference Include="Cake.Core" Version="0.33.0" PrivateAssets="All" />
<PackageReference Include="System.ServiceModel.Duplex" Version="4.6.0" PrivateAssets="All" />
<PackageReference Include="System.ServiceModel.Http" Version="4.6.0" PrivateAssets="All" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="4.6.0" PrivateAssets="All" />
<PackageReference Include="System.ServiceModel.Security" Version="4.6.0" PrivateAssets="All" />
<PackageReference Include="ILRepack.MSBuild.Task" Version="2.0.13" PrivateAssets="All" />
<PackageReference Include="System.ServiceModel.Duplex" Version="4.4.4" />
<PackageReference Include="System.ServiceModel.Http" Version="4.4.4" />
<PackageReference Include="System.ServiceModel.NetTcp" Version="4.4.4" />
<PackageReference Include="System.ServiceModel.Security" Version="4.4.4" />
</ItemGroup>

<Target Name="ILRepack" AfterTargets="Build">
<PropertyGroup>
<WorkingDirectory>$(MSBuildThisFileDirectory)bin\$(Configuration)\$(TargetFramework)</WorkingDirectory>
</PropertyGroup>
<ItemGroup>
<InputAssemblies Include="System.ServiceModel.dll" />
<InputAssemblies Include="System.ServiceModel.Duplex.dll" />
<InputAssemblies Include="System.ServiceModel.Http.dll" />
<InputAssemblies Include="System.ServiceModel.NetTcp.dll" />
<InputAssemblies Include="System.ServiceModel.Primitives.dll" />
<InputAssemblies Include="System.ServiceModel.Security.dll" />
<InputAssemblies Include="System.Reflection.DispatchProxy.dll" />
<InputAssemblies Include="System.Private.ServiceModel.dll" />
<InputAssemblies Include="System.Security.Principal.Windows.dll" />
</ItemGroup>
<ItemGroup>
<!-- Dot not internalize any types inside this assembly -->
<InternalizeExcludeAssemblies Include="Cake.Core.dll" />
</ItemGroup>
<Message Text="MERGING: @(InputAssemblies->'%(Filename)') into $(OutputAssembly)" Importance="High" />
<ILRepack
OutputType="$(OutputType)"
MainAssembly="$(AssemblyName).dll"
OutputAssembly="$(AssemblyName).dll"
InputAssemblies="@(InputAssemblies)"
InternalizeExcludeAssemblies="@(InternalizeExcludeAssemblies)"
WorkingDirectory="$(WorkingDirectory)" />
</Target>
</Project>

0 comments on commit c6c86e7

Please sign in to comment.