Skip to content

Commit

Permalink
Create CoreCLR Project based on .NET Core Beta5
Browse files Browse the repository at this point in the history
  • Loading branch information
MattGal committed Jul 30, 2015
1 parent 3b9517d commit 9a13cd2
Show file tree
Hide file tree
Showing 525 changed files with 35,976 additions and 287 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ _ReSharper*

*.orig
*~
artifacts
*.lock.json
packages
.vs
33 changes: 33 additions & 0 deletions Castle.Core-NetCore.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Castle.Core.NetCore", "src\Castle.Core.NetCore\Castle.Core.NetCore.csproj", "{9C846611-F9BF-455D-A92F-5092657DB944}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Castle.Core.NetCore.UnitTests", "src\Castle.Core.NetCore.UnitTests\src\Castle.Core.NetCore.UnitTests.xproj", "{24BB4B22-103D-48BB-BD5C-905B9B5EA149}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EFFD4CEA-0C67-4B36-B2FE-CDADBACE1C5C}"
ProjectSection(SolutionItems) = preProject
src\Castle.Core.NetCore.UnitTests\global.json = src\Castle.Core.NetCore.UnitTests\global.json
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9C846611-F9BF-455D-A92F-5092657DB944}.Debug|Any CPU.ActiveCfg = NetCore-Debug|Any CPU
{9C846611-F9BF-455D-A92F-5092657DB944}.Debug|Any CPU.Build.0 = NetCore-Debug|Any CPU
{9C846611-F9BF-455D-A92F-5092657DB944}.Release|Any CPU.ActiveCfg = NetCore-Release|Any CPU
{9C846611-F9BF-455D-A92F-5092657DB944}.Release|Any CPU.Build.0 = NetCore-Release|Any CPU
{24BB4B22-103D-48BB-BD5C-905B9B5EA149}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24BB4B22-103D-48BB-BD5C-905B9B5EA149}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24BB4B22-103D-48BB-BD5C-905B9B5EA149}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24BB4B22-103D-48BB-BD5C-905B9B5EA149}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
53 changes: 1 addition & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1 @@
# Castle Core

<img align="right" src="docs/images/castle-logo.png">

Castle Core provides common Castle Project abstractions including logging services. It also features **Castle DynamicProxy** a lightweight runtime proxy generator, and **Castle DictionaryAdapter**.

See the [documentation](docs/README.md).

## Releases

See the [Releases](https://github.com/castleproject/Core/releases).

## License

Castle Core is &copy; 2004-2015 Castle Project. It is free software, and may be redistributed under the terms of the [Apache 2.0](http://opensource.org/licenses/Apache-2.0) license.

## Building

### .NET Framework and Silverlight

```
msbuild /p:Configuration=NET45-Release /t:RunAllTests buildscripts/Build.proj
msbuild /p:Configuration=NET40-Release /t:RunAllTests buildscripts/Build.proj
msbuild /p:Configuration=NET35-Release /t:RunAllTests buildscripts/Build.proj
msbuild /p:Configuration=SL50-Release /t:RunAllTests buildscripts/Build.proj
msbuild /p:Configuration=SL40-Release /t:RunAllTests buildscripts/Build.proj
```

### Mono

Castle Core supports Mono 4.0.2+, previous 4.x releases have serious runtime bugs that cause runtime crashes. Mono 3.x releases used to work well, but are not supported.

```
xbuild /p:Configuration=NET45-Release /t:RunAllTests buildscripts/Build.proj
```

### Conditional Compilation Symbols

The following conditional compilation symbols (vertical) are currently defined for each of the build configurations (horizontal):

Symbol | NET35 | NET40 | NET45 | SL40 | SL50
------------------------------- | ------------------ | ------------------ | ------------------ | ------------------ | ------------------
`FEATURE_LEGACY_REFLECTION_API` | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :white_check_mark: | :white_check_mark:
`FEATURE_SERIALIZATION` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :no_entry_sign:
`DOTNET35` | :white_check_mark: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign:
`DOTNET40` | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :no_entry_sign:
`DOTNET45` | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :no_entry_sign: | :no_entry_sign:
`SILVERLIGHT` | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark:
`SL4` | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :no_entry_sign:
`SL5` | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :white_check_mark:

The `__MonoCS__` symbol is used only in unit tests when compiled on Mono to work around Mono defects and non-Windows differences, however we are trying to move away from platform specific symbols as much as possible.
# Castle Core<img align="right" src="docs/images/castle-logo.png">Castle Core provides common Castle Project abstractions including logging services. It also features **Castle DynamicProxy** a lightweight runtime proxy generator, and **Castle DictionaryAdapter**.See the [documentation](docs/README.md).## ReleasesSee the [Releases](https://github.com/castleproject/Core/releases).## LicenseCastle Core is &copy; 2004-2015 Castle Project. It is free software, and may be redistributed under the terms of the [Apache 2.0](http://opensource.org/licenses/Apache-2.0) license.## Building### .NET Framework and Silverlight```msbuild /p:Configuration=NET45-Release /t:RunAllTests buildscripts/Build.projmsbuild /p:Configuration=NET40-Release /t:RunAllTests buildscripts/Build.projmsbuild /p:Configuration=NET35-Release /t:RunAllTests buildscripts/Build.projmsbuild /p:Configuration=SL50-Release /t:RunAllTests buildscripts/Build.projmsbuild /p:Configuration=SL40-Release /t:RunAllTests buildscripts/Build.proj```### MonoCastle Core supports Mono 4.0.2+, previous 4.x releases have serious runtime bugs that cause runtime crashes. Mono 3.x releases used to work well, but are not supported.```xbuild /p:Configuration=NET45-Release /t:RunAllTests buildscripts/Build.proj```### .NET Core Castle Core supports .NET Core 5.0 in an experimental state currently. ```msbuild /p:Configuration=NetCore-Release src\Castle.Core.NetCore\Castle.Core.NetCore.csproj```### Conditional Compilation SymbolsThe following conditional compilation symbols (vertical) are currently defined for each of the build configurations (horizontal):Symbol | NET35 | NET40 | NET45 | SL40 | SL50------------------------------- | ------------------ | ------------------ | ------------------ | ------------------ | ------------------`FEATURE_LEGACY_REFLECTION_API` | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :white_check_mark: | :white_check_mark:`FEATURE_SERIALIZATION` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :no_entry_sign:`DOTNET35` | :white_check_mark: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign:`DOTNET40` | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :no_entry_sign:`DOTNET45` | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :no_entry_sign: | :no_entry_sign:`SILVERLIGHT` | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark:`SL4` | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :no_entry_sign:`SL5` | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :white_check_mark:The `__MonoCS__` symbol is used only in unit tests when compiled on Mono to work around Mono defects and non-Windows differences, however we are trying to move away from platform specific symbols as much as possible.
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ limitations under the License.

<Target Name="CheckRequiredProperties">
<Error Condition="'$(ProjectName)' == ''" Text="The ProjectName property has not been set, please set it in Settings.proj." />
<Error Text="The tools version &quot;$(MSBuildToolsVersion)&quot; is not supported, MSBuild 4.0 or newer is required to build." Condition="'$(MSBuildToolsVersion)' != '4.0'" />
<Error Text="The tools version &quot;$(MSBuildToolsVersion)&quot; is not supported, MSBuild 4.0 or newer is required to build." Condition="$(MSBuildToolsVersion) &lt; 4.0" />

<Error Condition="'$(Project_Major)' == ''" Text="The Project_Major property has not been set, please set it in Settings.proj." />
<Error Condition="'$(Project_Minor)' == ''" Text="The Project_Minor property has not been set, please set it in Settings.proj." />
Expand Down
2 changes: 2 additions & 0 deletions buildscripts/Castle.Core.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
<file src="build/SL5/SL5-Release/pkg/bin/Castle.Core.dll" target="lib/sl5" />
<file src="build/SL5/SL5-Release/pkg/bin/Castle.Core.pdb" target="lib/sl5" />
<file src="build/SL5/SL5-Release/pkg/bin/Castle.Core.xml" target="lib/sl5" />
<file src="build/NetCore/NetCore-Release/pkg/bin/Castle.Core.dll" target="lib/dotnet" />
<file src="build/NetCore/NetCore-Release/pkg/bin/Castle.Core.pdb" target="lib/dotnet" />
<file src="buildscripts/ASL - Apache Software Foundation License.txt" />
<file src="buildscripts/readme.txt" />
<file src="src/Castle.Core/**/*.cs" />
Expand Down
10 changes: 10 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"projects": [
"wrap"
],
"sdk": {
"version": "1.0.0-beta5",
"runtime": "coreclr",
"architecture": "x86"
}
}
11 changes: 11 additions & 0 deletions src/Castle.Core.NetCore.UnitTests/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"projects": [
"src",
"wrapper"
],
"sdk": {
"version": "1.0.0-beta5",
"runtime": "coreclr",
"architecture": "x86"
}
}
91 changes: 91 additions & 0 deletions src/Castle.Core.NetCore.UnitTests/src/AccessLevelTestCase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// Copyright 2004-2010 Castle Project - http://www.castleproject.org/
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Castle.DynamicProxy.Tests
{
using Castle.DynamicProxy.Tests.Classes;
using Castle.DynamicProxy.Tests.Interceptors;

using System.Collections.Generic;

using Xunit;

using System.Reflection;

public class AccessLevelTestCase : BasePEVerifyTestCase
{
[Fact]
public void ProtectedConstructor()
{
NonPublicConstructorClass proxy =
generator.CreateClassProxy(
typeof(NonPublicConstructorClass), new StandardInterceptor())
as NonPublicConstructorClass;

Assert.NotNull(proxy);

proxy.DoSomething();
}

[Fact]
public void ProtectedInternalConstructor()
{
ProtectedInternalConstructorClass proxy =
generator.CreateClassProxy(
typeof(ProtectedInternalConstructorClass), new StandardInterceptor())
as ProtectedInternalConstructorClass;

Assert.NotNull(proxy);

proxy.DoSomething();
}

[Fact]
public void ProtectedMethods()
{
LogInvocationInterceptor logger = new LogInvocationInterceptor();

NonPublicMethodsClass proxy = (NonPublicMethodsClass)
generator.CreateClassProxy(typeof(NonPublicMethodsClass), logger);

proxy.DoSomething();
Assert.Equal(2, logger.Invocations.Count);
Assert.Equal("DoSomething", logger.Invocations[0]);
Assert.Equal("DoOtherThing", logger.Invocations[1]);
}

[Fact]
public void InternalConstructorIsNotReplicated()
{
object proxy = generator.CreateClassProxy(typeof(Dictionary<int, object>), new StandardInterceptor());
Assert.Null(proxy.GetType().GetConstructor(new[] { typeof(IInterceptor[]), typeof(bool) }));
}

internal class InternalClass
{
internal InternalClass()
{
}
}

#if !MONO && !SILVERLIGHT && !NETCORE
[Fact]
public void InternalConstructorIsReplicatedWhenInternalsVisibleTo()
{
object proxy = generator.CreateClassProxy(typeof(InternalClass), new StandardInterceptor());
Assert.NotNull(proxy.GetType().GetConstructor(new[] { typeof(IInterceptor[]) }));
}
#endif
}
}
Loading

0 comments on commit 9a13cd2

Please sign in to comment.