Merge branch 'rel/1.0.1' into merge_rel101_into_master
* rel/1.0.1: (66 commits) Update LZMA license with correct text Bump to 2.0.0-rc5-61427-04 Remove duplicate installer suffix Add license text to LZMA SDK license notice Updating the SDK to 1.0.0-alpha-20170224-6 Updating both platform abstractions and dependency model to 1.0.3. Bump Roslyn to 2.0.0-rc5-61424-02 Update Stage0 to use the latest build. Update README with new distros. Back porting #5597 into rel/1.0.0 Fixing the exclude pattern used by the Migration to exclude WEB SDK globs. Remove RID from test package creation Disable migrate and publish web app with content because CI does not have NPM Adding an E2E test for pack with content during migration. Fixing a failing test and adding a few more E2E tests around binplace content for migrated projects. Fix debian_config.json on ubuntu16.10 Updating publish, pack and build of content to use None with Never/false/Never in their metadata for excluded items. Intermediate commit to get a WIP PR out. This adds the None Update with CopyToOutputDirectory set to Never. Switching the CopyToOutput for build and publish and the file for pack to use None Update instead of include. Also, fixed the exclude patterns for web apps. Do not migrate Content that is already included in the Web SDK for web apps. ...
This commit is contained in:
commit
3a9525b5ac
105 changed files with 1994 additions and 706 deletions
|
@ -18,6 +18,9 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
}
|
||||
|
||||
[Required]
|
||||
public string SDKVersion { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ToolPath { get; set; }
|
||||
|
||||
|
@ -75,6 +78,8 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
Directory.Delete(targetDir, true);
|
||||
}
|
||||
|
||||
dataToHash += SDKVersion;
|
||||
|
||||
Log.LogMessage($"NuGet Packages Archive Data To Hash: '{dataToHash}'");
|
||||
|
||||
var sha256 = SHA256.Create();
|
||||
|
|
|
@ -9,7 +9,12 @@ using Microsoft.Build.Framework;
|
|||
namespace Microsoft.DotNet.Cli.Build
|
||||
{
|
||||
/// <summary>
|
||||
/// Reads contents of an input file, and searches for each ReplacementPattern passed in.
|
||||
/// Reads contents of an input file, and searches for each replacement passed in.
|
||||
///
|
||||
/// When ReplacementItems is matched, it will replace the Include/ItemSpec with the corresponding
|
||||
/// ReplacementString metadata value. This can be useful if the ReplacementString is a value that
|
||||
/// cannot be represented by ITaskItem.ItemSpec (like string.Empty).
|
||||
///
|
||||
/// When a ReplacementPattern is matched it will replace it with the string of the corresponding (by index)
|
||||
/// item in ReplacementStrings.
|
||||
///
|
||||
|
@ -27,14 +32,23 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
[Required]
|
||||
public string DestinationFile { get; set; }
|
||||
|
||||
[Required]
|
||||
public ITaskItem[] ReplacementItems { get; set; }
|
||||
|
||||
public ITaskItem[] ReplacementPatterns { get; set; }
|
||||
|
||||
[Required]
|
||||
public ITaskItem[] ReplacementStrings { get; set; }
|
||||
|
||||
public override bool Execute()
|
||||
{
|
||||
if (ReplacementItems == null && ReplacementPatterns == null && ReplacementStrings == null)
|
||||
{
|
||||
throw new Exception($"ReplaceFileContents was called with no replacement values. Either pass ReplacementItems or ReplacementPatterns/ReplacementStrings properties.");
|
||||
}
|
||||
|
||||
ReplacementItems = ReplacementItems ?? Array.Empty<ITaskItem>();
|
||||
ReplacementPatterns = ReplacementPatterns ?? Array.Empty<ITaskItem>();
|
||||
ReplacementStrings = ReplacementStrings ?? Array.Empty<ITaskItem>();
|
||||
|
||||
if (ReplacementPatterns.Length != ReplacementStrings.Length)
|
||||
{
|
||||
throw new Exception($"Expected {nameof(ReplacementPatterns)} (length {ReplacementPatterns.Length}) and {nameof(ReplacementStrings)} (length {ReplacementStrings.Length}) to have the same length.");
|
||||
|
@ -57,6 +71,14 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
var outText = inputFileText;
|
||||
|
||||
foreach (var replacementItem in ReplacementItems)
|
||||
{
|
||||
var replacementPattern = replacementItem.ItemSpec;
|
||||
var replacementString = replacementItem.GetMetadata("ReplacementString");
|
||||
|
||||
outText = outText.Replace(replacementPattern, replacementString);
|
||||
}
|
||||
|
||||
for (int i=0; i<ReplacementPatterns.Length; ++i)
|
||||
{
|
||||
var replacementPattern = ReplacementPatterns[i].ItemSpec;
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<Version>$(CLI_MSBuild_Version)</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions">
|
||||
<Version>1.0.1-beta-000933</Version>
|
||||
<Version>$(PlatformAbstractionsVersion)</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
Add table
Add a link
Reference in a new issue