Skip to content

Commit

Permalink
Fixes serilog#589 - enable strong naming on CoreCLR builds (excludes …
Browse files Browse the repository at this point in the history
…tests using internal APIs)
  • Loading branch information
nblumhardt committed Jan 10, 2016
1 parent 01e3982 commit 6018f0e
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 14 deletions.
9 changes: 4 additions & 5 deletions src/Serilog/Properties/InternalsVisibleTo.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System.Runtime.CompilerServices;
using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: AssemblyVersion("2.0.0.0")]

#if DOTNET5_4 || DOTNET5_1
[assembly: InternalsVisibleTo("Serilog.Tests")]
#else
[assembly: InternalsVisibleTo("Serilog.Tests, PublicKey=" +
"0024000004800000940000000602000000240000525341310004000001000100fb8d13fd344a1c" +
"6fe0fe83ef33c1080bf30690765bc6eb0df26ebfdf8f21670c64265b30db09f73a0dea5b3db4c9" +
"d18dbf6d5a25af5ce9016f281014d79dc3b4201ac646c451830fc7e61a2dfd633d34c39f87b818" +
"94191652df5ac63cc40c77f3542f702bda692e6e8a9158353df189007a49da0f3cfd55eb250066" +
"b19485ec")]
#endif
2 changes: 2 additions & 0 deletions src/Serilog/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
},
"dotnet5.1": {
"compilationOptions": {
"keyFile": "../../assets/Serilog.snk",
"define": [ "NO_APPDOMAIN" ]
},
"dependencies": {
Expand All @@ -48,6 +49,7 @@
},
"dotnet5.4": {
"compilationOptions": {
"keyFile": "../../assets/Serilog.snk",
"define": [ "PROCESS", "FILE_IO", "PERIODIC_BATCHING", "NO_TIMER", "NO_APPDOMAIN" ]
},
"dependencies": {
Expand Down
6 changes: 5 additions & 1 deletion test/Serilog.Tests/Core/MessageTemplateTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#if INTERNAL_TESTS

using System;
using System.Globalization;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -165,3 +167,5 @@ public void MissingPositionalParametersRenderAsTextLikeStandardFormats()
}
}
}

#endif
6 changes: 5 additions & 1 deletion test/Serilog.Tests/Core/SafeAggregateSinkTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#if INTERNAL_TESTS

using System;
using Xunit;
using Serilog.Core.Sinks;
using Serilog.Tests.Support;
Expand Down Expand Up @@ -39,3 +41,5 @@ public void WhenASinkThrowsOtherSinksAreStillInvoked()
}
}
}

#endif
4 changes: 4 additions & 0 deletions test/Serilog.Tests/Events/LogEventPropertyValueTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if INTERNAL_TESTS

using System;
using System.Globalization;
using System.Linq;
Expand Down Expand Up @@ -75,3 +77,5 @@ public void WhenDestructuringAKnownLiteralTypeIsScalar()
}
}
}

#endif
6 changes: 5 additions & 1 deletion test/Serilog.Tests/LogTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#if INTERNAL_TESTS

using System;
using Xunit;
using Serilog.Core.Pipeline;
using Serilog.Tests.Support;
Expand Down Expand Up @@ -45,3 +47,5 @@ private static IDisposable SwappedLogger(ILogger logger)
}
}
}

#endif
6 changes: 5 additions & 1 deletion test/Serilog.Tests/LoggerConfigurationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public void DisposableSinksAreNotDisposedAlongWithContextualLoggers()
Assert.False(sink.IsDisposed);
}

#if INTERNAL_TESTS

[Fact]
public void AFilterPreventsMatchedEventsFromPassingToTheSink()
{
Expand All @@ -78,7 +80,9 @@ public void AFilterPreventsMatchedEventsFromPassingToTheSink()
Assert.True(events.Contains(included));
}

// ReSharper disable UnusedMember.Local, UnusedAutoPropertyAccessor.Local
#endif

// ReSharper disable UnusedMember.Local, UnusedAutoPropertyAccessor.Local
class AB
{
public int A { get; set; }
Expand Down
6 changes: 5 additions & 1 deletion test/Serilog.Tests/Parameters/PropertyValueConverterTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#if INTERNAL_TESTS

using System;
using System.Collections.Generic;
using System.Linq;
using Xunit;
Expand Down Expand Up @@ -234,3 +236,5 @@ public void ItemPropertiesNotAreIgnoredWhenDestructuring()
}
}
}

#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if PERIODIC_BATCHING
#if PERIODIC_BATCHING && INTERNAL_TESTS
using System;
using Xunit;
using Serilog.Sinks.PeriodicBatching;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if FILE_IO
#if FILE_IO && INTERNAL_TESTS

using System;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
#if INTERNAL_TESTS

using System;
using System.IO;
using System.Linq;
using Xunit;
Expand Down Expand Up @@ -126,3 +128,5 @@ public void MatchingParsesDates()
}
}
}

#endif
2 changes: 1 addition & 1 deletion test/Serilog.Tests/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dnx451": {
"compilationOptions": {
"keyFile": "../../assets/Serilog.snk",
"define": [ "APPSETTINGS", "LOGCONTEXT", "FILE_IO", "PERIODIC_BATCHING" ]
"define": [ "APPSETTINGS", "LOGCONTEXT", "FILE_IO", "PERIODIC_BATCHING", "INTERNAL_TESTS" ]
},
"frameworkAssemblies": {
"System.Configuration": ""
Expand Down

0 comments on commit 6018f0e

Please sign in to comment.