Skip to content
Merged
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
6 changes: 5 additions & 1 deletion Rx.NET/Source/facades/GlobalAssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.


using System.Reflection;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.ObservableExtensions))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.AnonymousObservable<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.AnonymousObserver<>))]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.ExperimentalAttribute))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.ListObservable<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.Linq.ObservableEx))]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.IEventPatternSource<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.IEventPattern<,>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.IEventSource<>))]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.EventPatternSourceBase<,>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.EventPattern<>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.EventPattern<,>))]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.Concurrency.EventLoopScheduler))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.Concurrency.NewThreadScheduler))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.Concurrency.TaskPoolScheduler))]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.Joins.QueryablePattern))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.Joins.QueryablePattern<,,,,,,,,,>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.Joins.QueryablePattern<,,,,,,,,,,>))]
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.Linq.RemotingObservable))]
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.Concurrency.ControlScheduler))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.Linq.ControlObservable))]
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

#if WINDOWS
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.Concurrency.CoreDispatcherScheduler))]
#else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.IEventPatternSource<,>))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.Linq.AsyncInfoObservable))]
[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reactive.Linq.WindowsObservable))]
Expand Down
6 changes: 5 additions & 1 deletion Rx.NET/Source/src/System.Reactive/Linq/QueryDebugger.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

//
// This file acts as a placeholder for future extension with a debugger service
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using Xunit;
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using Xunit;
using System.Linq;
using System.Reactive;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using System.Reactive;
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using System.Reactive;
using Xunit;

namespace ReactiveTests.Tests
Expand Down
100 changes: 100 additions & 0 deletions Rx.NET/Source/tests/Tests.System.Reactive/Tests/LicenseHeaderTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;

namespace Tests.System.Reactive.Tests
{
/// <summary>
/// Verify that main classes and unit tests have a license header
/// in the source files.
/// </summary>
public class LicenseHeaderTest
{
static readonly bool fixHeaders = true;

static readonly string[] lines = {
"// Licensed to the .NET Foundation under one or more agreements.",
"// The .NET Foundation licenses this file to you under the Apache 2.0 License.",
"// See the LICENSE file in the project root for more information.",
""
};

[Fact]
public void ScanFiles()
{
var dir = Directory.GetCurrentDirectory();
var idx = dir.IndexOf("Rx.NET");
if (idx < 0)
{
Console.WriteLine($"Could not locate sources directory: {dir}");
}
else
{
var newDir = dir.Substring(0, idx) + "Rx.NET/Source";

var error = new StringBuilder();

var count = ScanPath(newDir, error);

if (error.Length != 0)
{

Assert.False(true, $"Files with no license header: {count}\r\n{error.ToString()}");
}
}
}

int ScanPath(string path, StringBuilder error)
{
var count = 0;
foreach (var file in Directory.EnumerateFiles(path, "*.cs", SearchOption.AllDirectories))
{
// exclusions
if (file.Contains("obj/Debug")
|| file.Contains(@"obj\Debug")
|| file.Contains("AssemblyInfo.cs")
|| file.Contains(".Designer.cs")
|| file.Contains(".Generated.cs")
|| file.Contains("Uwp.DeviceRunner")
|| file.Contains(@"obj\Release")
|| file.Contains("obj/Release")
)
{
continue;
}

// analysis
string content = File.ReadAllText(file);

if (!content.StartsWith(lines[0]))
{
count++;
error.Append(file).Append("\r\n");

if (fixHeaders)
{
StringBuilder newContent = new StringBuilder();
string separator = content.Contains("\r\n") ? "\r\n" : "\n";

foreach (var s in lines)
{
newContent.Append(s).Append(separator);
}
newContent.Append(content);

File.WriteAllText(file, newContent.ToString());
}
}
}
return count;
}
}
}