Skip to content

Commit

Permalink
incorporating PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
shahabhijeet committed Jan 25, 2017
1 parent 52d276b commit 876bdb3
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ UpgradeLog*.XML
# NuGet
packages
packages/repositories.config
testPackages

# Mac development
.DS_Store
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<LibrarySourceFolder Condition="'$(PublishTestProjects)' == 'true'">$(LibraryToolsFolder)\Microsoft.WindowsAzure.Build.Tasks\Build.Tasks.Tests\TestPublishProjects</LibrarySourceFolder>
<LibraryNugetPackageFolder>$(LibraryRoot)\packages</LibraryNugetPackageFolder>
<FxTargetList>portable;net40;net45</FxTargetList>
<NuGetPublishingSource Condition="'$(NuGetPublishingSource)' == ''">$(LibraryRoot)\packages\nugetPublish</NuGetPublishingSource>
<NuGetPublishingSource Condition="'$(NuGetPublishingSource)' == ''">$(LibraryRoot)\testPackages\nugetPublish</NuGetPublishingSource>
<NuGetKey>1234</NuGetKey>
</PropertyGroup>
<PropertyGroup>
Expand Down Expand Up @@ -85,6 +85,7 @@
-->
<!-- Use Case:
msbuild build.proj /p:PublishTestProjects=true /t:Publish_MultipleSelectedPackage /p:Scope=MultiProjectSingleSln /p:PackageName="Sdk RP1_MgmtPlane"
msbuild build.proj /t:Build;Package;Publish /p:PublishTestProjects=true /p:Scope=MultiProjectSingleSln /p:PackageName="Sdk RP1_MgmtPlane"
-->
<Target Name="Publish_MultipleSelectedPackage" DependsOnTargets="MultiSelectedPackagesInit;$(TestInit)">
<Message Text="'Publish_MultipleSelectedPackage' completed"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ namespace CSProjTestPublish
{
public class Class1
{
public void TestMethod1() { }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ namespace NetCoreTestPublish
public class Class1
{
public Class1()
{
{
}

public void TestMethod1() { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ public class Class1
public Class1()
{
}

public void TestMethod1() { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ public class Class1
public Class1()
{
}

public void TestMethod1() { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ public class Class1
public Class1()
{
}

public void TestMethod1() { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ public class Class1
public Class1()
{
}

public void TestMethod1() { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ public class FilterOutAutoRestLibraries : Task
public string AutoRestMark { get; set; }

/// <summary>
/// Name of packages that needs to be published. Currently for ease of user, it will be space delimited list of NetCore projects
/// Name of packages that needs to be published. Currently for ease for the user, it will be space delimited list of NetCore projects
/// Non-NetCore projects cannot be published more than one package due to MSBuild limitation as well as our existing architecture of nuget.proj files
/// Plus once we are very limited set of non-netCore projects, so the effort is not worth. Worse case, each job to publish 1 package at a time
/// E.g. /p:PackageName="PackageName1 PackageName2" string can be passed to publish PacakgeName1 and PackageName2
/// Plus as we have very limited set of non-netCore projects, so the effort is not worth it. Worse case for publishing non-netCore projects, each job
/// to publish 1 package at a time
///
/// E.g. for NetCore projects /p:PackageName="PackageName1 PackageName2" string can be passed to publish PacakgeName1 and PackageName2
/// </summary>
public string NugetPackagesToPublish { get; set; }

Expand All @@ -56,14 +58,9 @@ public override bool Execute()

List<string> nPkgsList = null;

if (NugetPackagesToPublish != null)
if (!string.IsNullOrWhiteSpace(NugetPackagesToPublish))
{
NugetPackagesToPublish = NugetPackagesToPublish.Trim();

if (!string.IsNullOrEmpty(NugetPackagesToPublish))
{
nPkgsList = NugetPackagesToPublish.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).ToList<string>();
}
nPkgsList = NugetPackagesToPublish.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).ToList<string>();
}

foreach (ITaskItem solution in AllLibraries)
Expand Down Expand Up @@ -102,7 +99,9 @@ public override bool Execute()
string projectDirName = Path.GetFileName(projectDirPath);
string match = nPkgsList.Find((pn) => pn.Equals(projectDirName, System.StringComparison.OrdinalIgnoreCase));
if (!string.IsNullOrEmpty(match))
{
nonNetCoreAutoRestLibraries.Add(solution);
}
}
else
{
Expand Down Expand Up @@ -161,6 +160,15 @@ public override bool Execute()
}
}

if(nPkgsList != null)
{
if (nPkgsList.Any<string>())
{
string pkgNames = string.Join(",", nPkgsList);
Log.LogMessage(MessageImportance.High, "Trying to publish packages: {0}", pkgNames);
}
}

Log.LogMessage(MessageImportance.High, "We have found {0} non netcore autorest libraries.", nonNetCoreAutoRestLibraries.Count);
Log.LogMessage(MessageImportance.High, "We have found {0} netcore autorest libraries.", netCoreAutoRestLibraries.Count);
Log.LogMessage(MessageImportance.High, "we have found {0} Non autorest libraries.", others.Count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
</ItemGroup>
<ItemGroup>
<None Include="Build.Tasks.Tests\BuildTasksTest.BuildProjectTemplates.proj" />
<None Include="Build.Tasks.Tests\PublishNugetPackageTests.proj">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down

0 comments on commit 876bdb3

Please sign in to comment.