Skip to content

Commit

Permalink
Add packageConfigParser
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmelsayed committed Jan 18, 2018
1 parent ea27790 commit 7646c3c
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Azure.Functions.Cli.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.15
VisualStudioVersion = 15.0.27130.2010
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{CF86C17E-5C8A-4810-87BF-10548537A771}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -21,6 +21,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{3FD809C2
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "redirectCompare", "tools\redirectCompare\redirectCompare.fsproj", "{DFE7F321-00D7-47E0-8653-6329CDE3D78C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "packageConfigParser", "packageConfigParser\packageConfigParser.csproj", "{8463BC17-B28E-4171-A5B0-EF503980334F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -39,6 +41,10 @@ Global
{DFE7F321-00D7-47E0-8653-6329CDE3D78C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DFE7F321-00D7-47E0-8653-6329CDE3D78C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DFE7F321-00D7-47E0-8653-6329CDE3D78C}.Release|Any CPU.Build.0 = Release|Any CPU
{8463BC17-B28E-4171-A5B0-EF503980334F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8463BC17-B28E-4171-A5B0-EF503980334F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8463BC17-B28E-4171-A5B0-EF503980334F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8463BC17-B28E-4171-A5B0-EF503980334F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -47,6 +53,7 @@ Global
{6608738C-3BDB-47F5-BC62-66A8BDF9D884} = {5F51C958-39C0-4E0C-9165-71D0BCE647BC}
{C57EBA1F-1C48-451A-80D6-F6AA7C881CF8} = {6EE1D011-2334-44F2-9D41-608B969DAE6D}
{DFE7F321-00D7-47E0-8653-6329CDE3D78C} = {3FD809C2-9986-4659-A82A-CE7B165530E6}
{8463BC17-B28E-4171-A5B0-EF503980334F} = {3FD809C2-9986-4659-A82A-CE7B165530E6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {15E08A4A-EF7C-4E42-BB11-DA397493F547}
Expand Down
6 changes: 6 additions & 0 deletions packageConfigParser/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
39 changes: 39 additions & 0 deletions packageConfigParser/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using System.Linq;
using System.Net;
using System.Xml.Linq;

namespace packageConfigParser
{
class Program
{
static void Main(string[] args)
{
ParsePackageConfig("https://raw.githubusercontent.com/Azure/azure-webjobs-sdk-script/v1.x/src/WebJobs.Script.WebHost/packages.config");
ParsePackageConfig("https://raw.githubusercontent.com/Azure/azure-webjobs-sdk-script/v1.x/src/WebJobs.Script/packages.config");
}

static void ParsePackageConfig(string url)
{
using (var client = new WebClient())
{
var content = client.DownloadString(new Uri(url));
var doc = XDocument.Parse(content);
var packages = doc
.Element("packages")
.Descendants()
.Select(e => new
{
Name = e.Attribute("id").Value,
Version = e.Attribute("version").Value
})
.Where(i => i.Name != "StyleCop.Analyzers");

foreach (var p in packages)
{
Console.WriteLine($"Install-Package {p.Name} -Version {p.Version}");
}
}
}
}
}
36 changes: 36 additions & 0 deletions packageConfigParser/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("packageConfigParser")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("packageConfigParser")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("8463bc17-b28e-4171-a5b0-ef503980334f")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
52 changes: 52 additions & 0 deletions packageConfigParser/packageConfigParser.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8463BC17-B28E-4171-A5B0-EF503980334F}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>packageConfigParser</RootNamespace>
<AssemblyName>packageConfigParser</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

0 comments on commit 7646c3c

Please sign in to comment.