Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Mon tout premier pull request ;) #1

Merged
merged 3 commits into from

2 participants

@alexvictoor
Collaborator

No description provided.

@grozeille
Owner

Bravo!

@grozeille grozeille merged commit 3106ae5 into grozeille:master
@grozeille grozeille was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 26, 2012
  1. @alexvictoor

    target dotnet fwk v2

    alexvictoor authored
  2. @alexvictoor

    first test

    alexvictoor authored
Commits on Mar 31, 2012
  1. @alexvictoor
This page is out of date. Refresh to see the latest.
View
82 DependencyParser.Test/DependencyParser.Test.csproj
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{F2D48840-011D-40D3-8CE9-6796A2FB237F}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>DependencyParser.Test</RootNamespace>
+ <AssemblyName>DependencyParser.Test</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile>
+ </TargetFrameworkProfile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <PlatformTarget>x86</PlatformTarget>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="nunit.core">
+ <HintPath>..\lib\test\nunit.core.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit.core.interfaces">
+ <HintPath>..\lib\test\nunit.core.interfaces.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit.framework">
+ <HintPath>..\lib\test\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="DependencyParserTest.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\DependencyParser\DependencyParser.csproj">
+ <Project>{AE47EF64-9F61-463A-9088-79907968A1FE}</Project>
+ <Name>DependencyParser</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="testdata\Example.Core.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="testdata\Example.Core.pdb">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ <Content Include="testdata\test.xml">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
View
6 DependencyParser.Test/DependencyParser.Test.csproj.user
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectView>ShowAllFiles</ProjectView>
+ </PropertyGroup>
+</Project>
View
26 DependencyParser.Test/DependencyParserTest.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using NUnit.Framework;
+
+namespace DependencyParser.Test {
+
+ [NUnit.Framework.TestFixture]
+ class DependencyParserTest {
+
+ [Test]
+ public void Should_Create_An_XML_Report()
+ {
+ File.Delete("test.xml");
+ Program.Main(new string[] { "-a=testdata/Example.Core.dll", "-o=test.xml" });
+ string expected = File.ReadAllText("testdata/test.xml");
+ string result = File.ReadAllText("test.xml");
+
+ Assert.AreEqual(expected, result);
+
+
+ }
+ }
+}
View
36 DependencyParser.Test/Properties/AssemblyInfo.cs
@@ -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("DependencyParser.Test")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("DependencyParser.Test")]
+[assembly: AssemblyCopyright("Copyright © 2012")]
+[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("6186db05-5bd9-4106-9fe1-cf5b0a84ad5d")]
+
+// 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")]
View
BIN  DependencyParser.Test/testdata/Example.Core.dll
Binary file not shown
View
BIN  DependencyParser.Test/testdata/Example.Core.pdb
Binary file not shown
View
28 DependencyParser.Test/testdata/test.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Dependencies name="Example.Core" version="1.0.0.0">
+ <Assembly name="Example.Core" version="1.0.0.0">
+ <References>
+ <Reference name="mscorlib" fullName="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="2.0.0.0" />
+ </References>
+ <TypeReferences>
+ <From fullname="Example.Core.IMoney">
+ <To fullname="Example.Core.Money" assemblyname="Example.Core" assemblyversion="1.0.0.0" />
+ <To fullname="Example.Core.MoneyBag" assemblyname="Example.Core" assemblyversion="1.0.0.0" />
+ </From>
+ <From fullname="Example.Core.Model.SubType/Alex3" />
+ <From fullname="Example.Core.Model.SubType" />
+ <From fullname="Example.Core.Money/Alex2" />
+ <From fullname="Example.Core.Money">
+ <To fullname="Example.Core.IMoney" assemblyname="Example.Core" assemblyversion="1.0.0.0" />
+ <To fullname="Example.Core.MoneyBag" assemblyname="Example.Core" assemblyversion="1.0.0.0" />
+ </From>
+ <From fullname="Example.Core.Alex" />
+ <From fullname="Example.Core.MoneyBag">
+ <To fullname="Example.Core.IMoney" assemblyname="Example.Core" assemblyversion="1.0.0.0" />
+ <To fullname="Example.Core.Money" assemblyname="Example.Core" assemblyversion="1.0.0.0" />
+ </From>
+ <From fullname="Example.Core.SampleMeasure/Possible" />
+ <From fullname="Example.Core.SampleMeasure" />
+ </TypeReferences>
+ </Assembly>
+</Dependencies>
View
22 DependencyParser.sln
@@ -3,16 +3,38 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DependencyParser", "DependencyParser\DependencyParser.csproj", "{AE47EF64-9F61-463A-9088-79907968A1FE}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DependencyParser.Test", "DependencyParser.Test\DependencyParser.Test.csproj", "{F2D48840-011D-40D3-8CE9-6796A2FB237F}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {AE47EF64-9F61-463A-9088-79907968A1FE}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {AE47EF64-9F61-463A-9088-79907968A1FE}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+ {AE47EF64-9F61-463A-9088-79907968A1FE}.Debug|Mixed Platforms.Build.0 = Debug|x86
{AE47EF64-9F61-463A-9088-79907968A1FE}.Debug|x86.ActiveCfg = Debug|x86
{AE47EF64-9F61-463A-9088-79907968A1FE}.Debug|x86.Build.0 = Debug|x86
+ {AE47EF64-9F61-463A-9088-79907968A1FE}.Release|Any CPU.ActiveCfg = Release|x86
+ {AE47EF64-9F61-463A-9088-79907968A1FE}.Release|Mixed Platforms.ActiveCfg = Release|x86
+ {AE47EF64-9F61-463A-9088-79907968A1FE}.Release|Mixed Platforms.Build.0 = Release|x86
{AE47EF64-9F61-463A-9088-79907968A1FE}.Release|x86.ActiveCfg = Release|x86
{AE47EF64-9F61-463A-9088-79907968A1FE}.Release|x86.Build.0 = Release|x86
+ {F2D48840-011D-40D3-8CE9-6796A2FB237F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F2D48840-011D-40D3-8CE9-6796A2FB237F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F2D48840-011D-40D3-8CE9-6796A2FB237F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {F2D48840-011D-40D3-8CE9-6796A2FB237F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {F2D48840-011D-40D3-8CE9-6796A2FB237F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {F2D48840-011D-40D3-8CE9-6796A2FB237F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F2D48840-011D-40D3-8CE9-6796A2FB237F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F2D48840-011D-40D3-8CE9-6796A2FB237F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {F2D48840-011D-40D3-8CE9-6796A2FB237F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {F2D48840-011D-40D3-8CE9-6796A2FB237F}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
56 DependencyParser/DependencyParser.csproj
@@ -10,9 +10,24 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DependencyParser</RootNamespace>
<AssemblyName>DependencyParser</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
@@ -34,26 +49,22 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Mono.Cecil, Version=0.9.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
- <HintPath>..\packages\Mono.Cecil.0.9.5.2\lib\net40\Mono.Cecil.dll</HintPath>
+ <Reference Include="Mono.Cecil">
+ <HintPath>..\lib\Mono.Cecil.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil.Mdb">
- <HintPath>..\packages\Mono.Cecil.0.9.5.2\lib\net40\Mono.Cecil.Mdb.dll</HintPath>
+ <HintPath>..\lib\Mono.Cecil.Mdb.dll</HintPath>
</Reference>
- <Reference Include="Mono.Cecil.Pdb, Version=0.9.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
- <HintPath>..\packages\Mono.Cecil.0.9.5.2\lib\net40\Mono.Cecil.Pdb.dll</HintPath>
- </Reference>
- <Reference Include="Mono.Cecil.Rocks">
- <HintPath>..\packages\Mono.Cecil.0.9.5.2\lib\net40\Mono.Cecil.Rocks.dll</HintPath>
+ <Reference Include="Mono.Cecil.Pdb">
+ <HintPath>..\lib\Mono.Cecil.Pdb.dll</HintPath>
</Reference>
<Reference Include="NDesk.Options">
- <HintPath>..\packages\NDesk.Options.0.2.1\lib\NDesk.Options.dll</HintPath>
+ <HintPath>..\lib\NDesk.Options.dll</HintPath>
</Reference>
<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.Xml" />
</ItemGroup>
@@ -62,8 +73,31 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
+ <None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
+ <Visible>False</Visible>
+ <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
View
52 DependencyParser/Program.cs
@@ -6,34 +6,32 @@
using System.IO;
using System.Xml;
using Mono.Cecil.Pdb;
-using Mono.Cecil.Rocks;
using NDesk.Options;
namespace DependencyParser
{
- class Program
+ public class Program
{
- private static readonly List<string> parsed = new List<string>();
+ private static readonly List<string> Parsed = new List<string>();
- private static readonly List<string> toParse = new List<string>();
+ private static readonly List<string> ToParse = new List<string>();
- static void Main(string[] args)
+ public static void Main(string[] args)
{
- bool show_help = false;
- string assemblyName = @"C:\Users\mathias\Documents\visual studio 2010\Projects\chiffrage\Chiffrage\bin\Debug\Chiffrage.exe";
+ bool showHelp = false;
+ string assemblyName = "ASSEMBLY.DLL";
string outputPath = "output.xml";
var p = new OptionSet()
{
{ "a|assembly=", "the name of the assembly to scan", v => assemblyName = v },
{ "o|output=", "the path to the output XML", v => outputPath = v },
- { "h|help", "show this message and exit", v => show_help = v != null },
+ { "h|help", "show this message and exit", v => showHelp = v != null },
};
- List<string> extra;
- try
+ try
{
- extra = p.Parse(args);
+ p.Parse(args);
}
catch (OptionException e)
{
@@ -43,6 +41,14 @@ static void Main(string[] args)
return;
}
+ if (showHelp)
+ {
+ Console.WriteLine("Use -a=[ASSSEMBLY] where ASSEMBLY is an assembly file");
+ Console.WriteLine("and -o=[OUTPUT] where OUTPUT is the xml report file that will be generated");
+ return;
+ }
+
+
var targetFolder = Path.GetDirectoryName(assemblyName);
using (var stream = new FileStream(outputPath, FileMode.Create))
{
@@ -58,11 +64,11 @@ static void Main(string[] args)
Analysis(writer, definition.MainModule, assemblyName, true);
- while (toParse.Count > 0)
+ while (ToParse.Count > 0)
{
definition = null;
- var fullName = toParse.First();
- var assemblyNameDef = AssemblyNameDefinition.Parse(fullName);
+ var fullName = ToParse.First();
+ var assemblyNameDef = AssemblyNameReference.Parse(fullName);
var name = assemblyNameDef.Name;
// find that file
@@ -88,8 +94,8 @@ static void Main(string[] args)
if (!definition.FullName.Equals(fullName))
{
Console.WriteLine("The existing file {0} doesn't match the fullName {1}, skip it", name, fullName);
- toParse.Remove(fullName);
- parsed.Add(fullName);
+ ToParse.Remove(fullName);
+ Parsed.Add(fullName);
}
else
{
@@ -102,8 +108,8 @@ static void Main(string[] args)
// how to do for the GAC?
//definition = AssemblyDefinition.ReadAssembly()
Console.WriteLine("Skip {0}... maybe in the GAC?", name);
- toParse.Remove(fullName);
- parsed.Add(fullName);
+ ToParse.Remove(fullName);
+ Parsed.Add(fullName);
}
}
@@ -140,9 +146,9 @@ static void Analysis(XmlTextWriter writer, ModuleDefinition module, string fullP
writer.WriteAttributeString("version", item.Version.ToString());
writer.WriteEndElement();
- if (!parsed.Contains(item.FullName) && !toParse.Contains(item.FullName))
+ if (!Parsed.Contains(item.FullName) && !ToParse.Contains(item.FullName))
{
- toParse.Add(item.FullName);
+ ToParse.Add(item.FullName);
}
}
writer.WriteEndElement();
@@ -160,12 +166,12 @@ static void Analysis(XmlTextWriter writer, ModuleDefinition module, string fullP
writer.WriteEndElement();
- if (toParse.Contains(module.Assembly.Name.FullName))
+ if (ToParse.Contains(module.Assembly.Name.FullName))
{
- toParse.Remove(module.Assembly.Name.FullName);
+ ToParse.Remove(module.Assembly.Name.FullName);
}
- parsed.Add(module.Assembly.Name.FullName);
+ Parsed.Add(module.Assembly.Name.FullName);
}
public static void ParseType(XmlTextWriter writer, TypeDefinition t)
View
3  DependencyParser/app.config
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<configuration>
+<startup><supportedRuntime version="v2.0.50727" sku="Client"/></startup></configuration>
View
BIN  lib/Mono.Cecil.Mdb.dll
Binary file not shown
View
BIN  lib/Mono.Cecil.Pdb.dll
Binary file not shown
View
BIN  lib/Mono.Cecil.dll
Binary file not shown
View
BIN  lib/NDesk.Options.dll
Binary file not shown
View
BIN  lib/test/nunit.core.dll
Binary file not shown
View
BIN  lib/test/nunit.core.interfaces.dll
Binary file not shown
View
BIN  lib/test/nunit.framework.dll
Binary file not shown
Something went wrong with that request. Please try again.