Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate new sdk #527

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .travis.legacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: csharp
solution: Mono.Cecil.LegacyProject.sln
install:
- nuget restore Mono.Cecil.LegacyProject.sln
- nuget install NUnit.Runners -Version 2.6.4 -OutputDirectory testrunner
script:
- xbuild /p:Configuration=net_4_0_Debug Mono.Cecil.LegacyProject.sln
- mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe Mono.Cecil.nunit
19 changes: 16 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
language: csharp
sudo: required

dist: trusty
dotnet: 2.1.301
mono: latest
solution: Mono.Cecil.sln

before_install:
- mono --version
- ls -lh /usr/lib/mono
install:
- nuget restore Mono.Cecil.sln
- dotnet restore Mono.Cecil.sln -v m
- nuget install NUnit.Runners -Version 2.6.4 -OutputDirectory testrunner
script:
- xbuild /p:Configuration=net_4_0_Debug Mono.Cecil.sln
- mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe Mono.Cecil.nunit
- FrameworkPathOverrideForMono=/usr/lib/mono dotnet build Mono.Cecil.sln

- dotnet test Mono.Cecil.sln --no-build -f netcoreapp2.1
- mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe Mono.Cecil.net35.nunit
- mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe Mono.Cecil.net40.nunit

43 changes: 43 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<Project>
<PropertyGroup>
<EnableDefaultItems>false</EnableDefaultItems>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup>
<Configurations>Debug;Release;Debug_ReadOnly;Release_ReadOnly</Configurations>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\cecil.snk</AssemblyOriginatorKeyFile>
<DefineConstants Condition="'$(TargetFramework)'=='net35'">$(DefineConstants);NET_3_5;</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)'=='net40'">$(DefineConstants);NET_4_0;</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)'=='netstandard2.0' OR '$(TargetFramework)'=='netcoreapp2.1'">$(DefineConstants);NET_CORE;</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" $(Configuration.Contains('ReadOnly')) ">
<DefineConstants>$(DefineConstants);READ_ONLY</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net35' ">
<DefineConstants>$(DefineConstants);LEGACY</DefineConstants>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the LEGACY define used? A quick search in the code doesn't find anything.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I put this at a moment where I was using it but it's no more needed. Could be removed.

<FrameworkPathOverride Condition="'$(FrameworkPathOverrideForMono)' != ''">$([System.IO.Path]::Combine($(FrameworkPathOverrideForMono),2.0-api))</FrameworkPathOverride>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the FrameworkPathOverride needed, on Mono and not on Mono?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because net35 is not compiled with dotnet build.

<FrameworkPathOverride Condition="'$(FrameworkPathOverride)' == ''">C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net40' ">
<FrameworkPathOverride Condition="'$(FrameworkPathOverrideForMono)' != ''">$([System.IO.Path]::Combine($(FrameworkPathOverrideForMono),4.0-api))</FrameworkPathOverride>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net35' OR '$(TargetFramework)' == 'net40'">
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net35' OR '$(TargetFramework)' == 'net40'">

<Reference Include="System.Core" />
<Reference Include="System" />
</ItemGroup>

<PropertyGroup>
<CecilOverrides Condition="'$(CecilOverrides)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), Mono.Cecil.overrides))\Mono.Cecil.overrides</CecilOverrides>
</PropertyGroup>
<Import Project="$(CecilOverrides)" Condition="Exists('$(CecilOverrides)')" />


</Project>
5 changes: 5 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<Target Name="VSTestIfTestProject">
<CallTarget Targets="VSTest" Condition="'$(IsTestProject)' == 'true'" />
</Target>
</Project>
5 changes: 5 additions & 0 deletions Global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "2.1.301"
}
}
File renamed without changes.
29 changes: 29 additions & 0 deletions Mono.Cecil.Legacy.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Mono.Cecil</id>
<version>0.10.0.0</version>
<title>Mono.Cecil</title>
<authors>Jb Evain</authors>
<owners>Jb Evain</owners>
<licenseUrl>http://opensource.org/licenses/mit-license.php</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<projectUrl>http://github.com/jbevain/cecil/</projectUrl>
<summary>Cecil is a library written by Jb Evain to generate and inspect programs and libraries in the ECMA CIL format.</summary>
<description>Cecil is a library written by Jb Evain to generate and inspect programs and libraries in the ECMA CIL format. It has full support for generics, and support some debugging symbol format. In simple English, with Cecil, you can load existing managed assemblies, browse all the contained types, modify them on the fly and save back to the disk the modified assembly.</description>
<language>en-US</language>
<tags>assembly assemblies module modules il cil msil bytecode reflection injection cecil mono aop</tags>
<dependencies>
<group targetFramework=".NETFramework3.5" />
<group targetFramework=".NETFramework4.0" />
<group targetFramework=".NETStandard2.0">
<dependency id="System.Security.Permissions" version="4.5.0" />
</group>
</dependencies>
</metadata>
<files>
<file src="bin\net_3_5_Release\*.dll" target="lib/net35" />
<file src="bin\net_4_0_Release\*.dll" target="lib/net40" />
<file src="bin\netstandard_Release\netstandard2.0\*.dll" target="lib/netstandard2.0" />
</files>
</package>
20 changes: 20 additions & 0 deletions Mono.Cecil.LegacyProject.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{D68133BD-1E63-496E-9EDE-4FBDBF77B486}</ProjectGuid>
<RootNamespace>Mono.Cecil</RootNamespace>
<AssemblyName>Mono.Cecil</AssemblyName>
</PropertyGroup>
<ItemGroup>
<Compile Include="ProjectInfo.cs" />
<Compile Include="Mono\*.cs" />
<Compile Include="Mono.Cecil\*.cs" />
<Compile Include="Mono.Cecil.Cil\*.cs" />
<Compile Include="Mono.Cecil.Metadata\*.cs" />
<Compile Include="Mono.Cecil.PE\*.cs" />
<Compile Include="Mono.Collections.Generic\*.cs" />
<Compile Include="Mono.Security.Cryptography\*.cs" />
</ItemGroup>
<Import Project="Mono.Cecil.props" />
<Import Project="$(MSBuildCSharpTargets)" Condition=" ! $(NetStandard) " />
</Project>
Loading