Skip to content

Commit

Permalink
Rename master to main. (dotnet#8851)
Browse files Browse the repository at this point in the history
* Fix links that point to master to point to main instead.
* Implement support in the sample tester for specifying the default branch for
  each sample repo.
* Fix various text / documentation to say 'main' instead of 'master.'
* Push to 'main' instead of 'master' in xamarin-macios-data.
* Fix xharness to make 'main' the special branch with regards to documentation tests as opposed to 'master'.
* Fix various CI to use 'main' instead of 'master'.
* Bump maccore

    New commits in xamarin/maccore:

    * xamarin/maccore@ed6d146822 Rename 'master' to 'main'. (dotnet#2233)

    Diff: https://github.com/xamarin/maccore/compare/424fa2614873c7415cf0407d2389335cba0b6c79..ed6d1468221f2220cd3f39294427160f0d3fbced
  • Loading branch information
rolfbjarne authored Jun 16, 2020
1 parent f236e2f commit 95e42b9
Show file tree
Hide file tree
Showing 25 changed files with 84 additions and 60 deletions.
2 changes: 1 addition & 1 deletion Make.versions
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# WATCHOS_NUGET_VERSION (major/minor/patch #)
# MACOS_NUGET_VERSION (major/minor/patch #)
#
# Update version numbers on master as well, to the next version
# Update version numbers on main as well, to the next version
#

#
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This repository is where we do development for the Xamarin.iOS and Xamarin.Mac S
If you are interested in fixing issues and contributing directly to the code base, please see the document [How to Contribute](https://github.com/xamarin/xamarin-macios/wiki/How-to-Contribute), which covers the following:

- How to [build and run](https://github.com/xamarin/xamarin-macios/wiki/Build-&-Run) from source
- The [development workflow](https://github.com/xamarin/xamarin-macios/wiki/How-to-Contribute#work-branches), including [debugging](https://github.com/xamarin/xamarin-macios/wiki/Build-&-Run#debugging-applications-from-source) and [running tests](https://github.com/xamarin/xamarin-macios/blob/master/tests/README.md)
- The [development workflow](https://github.com/xamarin/xamarin-macios/wiki/How-to-Contribute#work-branches), including [debugging](https://github.com/xamarin/xamarin-macios/wiki/Build-&-Run#debugging-applications-from-source) and [running tests](https://github.com/xamarin/xamarin-macios/blob/main/tests/README.md)
- [Coding Guidelines](https://github.com/xamarin/xamarin-macios/wiki/How-to-Contribute#coding-guidelines)
- [Submitting pull requests](https://github.com/xamarin/xamarin-macios/wiki/How-to-Contribute#pull-requests)

Expand Down Expand Up @@ -61,4 +61,4 @@ However, we provide links to older Xamarin.iOS and Mac packages for macOS downgr
## License

Copyright (c) .NET Foundation Contributors. All rights reserved.
Licensed under the [MIT](https://github.com/xamarin/xamarin-macios/blob/master/LICENSE) License.
Licensed under the [MIT](https://github.com/xamarin/xamarin-macios/blob/main/LICENSE) License.
2 changes: 1 addition & 1 deletion docs/website/binding_objc_libs.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Mac bindings are very similar.
**Sample Code for iOS**

You can use the
[iOS Binding Sample](https://github.com/xamarin/monotouch-samples/tree/master/BindingSample)
[iOS Binding Sample](https://github.com/xamarin/monotouch-samples/tree/main/BindingSample)
project to experiment with bindings.

<a name="Getting_Started" />
Expand Down
4 changes: 2 additions & 2 deletions docs/website/binding_types_reference_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2062,7 +2062,7 @@ If the value of `doAdd` is true, then the parameter is added to the
`listName`. You must declare this backing field in your complementary partial
class to the API.

For an example see [foundation.cs](https://github.com/mono/maccore/blob/master/src/foundation.cs) and [NSNotificationCenter.cs](https://github.com/mono/maccore/blob/master/src/Foundation/NSNotificationCenter.cs)
For an example see [foundation.cs](https://github.com/mono/maccore/blob/main/src/foundation.cs) and [NSNotificationCenter.cs](https://github.com/mono/maccore/blob/main/src/Foundation/NSNotificationCenter.cs)

### TransientAttribute
Expand Down Expand Up @@ -2288,7 +2288,7 @@ public class LinkWithAttribute : Attribute {
```

This attribute is applied at the assembly level, for example, this is what
the [CorePlot bindings](https://github.com/mono/monotouch-bindings/tree/master/CorePlot) use:
the [CorePlot bindings](https://github.com/mono/monotouch-bindings/tree/main/CorePlot) use:
```csharp
[assembly: LinkWith ("libCorePlot-CocoaTouch.a", LinkTarget.ArmV7 | LinkTarget.ArmV7s | LinkTarget.Simulator, Frameworks = "CoreGraphics QuartzCore", ForceLoad = true)]
Expand Down
4 changes: 2 additions & 2 deletions docs/website/generator-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: "Xamarin.iOS/Xamarin.Mac binding errors"
dateupdated: 2017-06-26
---

[//]: # (The original file resides under https://github.com/xamarin/xamarin-macios/tree/master/docs/website/)
[//]: # (The original file resides under https://github.com/xamarin/xamarin-macios/tree/main/docs/website/)
[//]: # (This allows all contributors (including external) to submit, using a PR, updates to the documentation that match the tools changes)
[//]: # (Modifications outside of xamarin-macios/master will be lost on future updates)
[//]: # (Modifications outside of xamarin-macios/main will be lost on future updates)

# BI0xxx: binding error messages

Expand Down
6 changes: 3 additions & 3 deletions docs/website/mtouch-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ E.g. parameters, environment, missing tools.

<!--
MT0xxx mtouch itself, e.g. parameters, environment (e.g. missing tools)
https://github.com/xamarin/xamarin-macios/blob/master/tools/mtouch/error.cs
https://github.com/xamarin/xamarin-macios/blob/main/tools/mtouch/error.cs
-->

<a name="MT0000" />
Expand Down Expand Up @@ -676,7 +676,7 @@ For further information see bug #[51634](https://bugzilla.xamarin.com/show_bug.c

### MT0112: Native code sharing has been disabled because *

There are multiple reasons [native code sharing](https://github.com/xamarin/xamarin-macios/blob/master/docs/code-sharing-with-user-frameworks.md) can be disabled:
There are multiple reasons [native code sharing](https://github.com/xamarin/xamarin-macios/blob/main/docs/code-sharing-with-user-frameworks.md) can be disabled:

* because the container app's deployment target is earlier than iOS 8.0 (it's *)).

Expand All @@ -694,7 +694,7 @@ Native code sharing requires is not supported for projects that use custom xml d

### MT0113: Native code sharing has been disabled for the extension '*' because *.

There are multiple reasons [native code sharing](https://github.com/xamarin/xamarin-macios/blob/master/docs/code-sharing-with-user-frameworks.md) can be disabled:
There are multiple reasons [native code sharing](https://github.com/xamarin/xamarin-macios/blob/main/docs/code-sharing-with-user-frameworks.md) can be disabled:

* because the bitcode options differ between the container app (\*) and the extension (\*).

Expand Down
2 changes: 1 addition & 1 deletion docs/website/optimizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -775,4 +775,4 @@ The default behavior can be overridden by passing
`--optimize=[+|-]force-rejected-types-removal` to `mtouch`.

The exact list of types might change over time and is best read directly from
the [source code](https://github.com/xamarin/xamarin-macios/blob/master/tools/linker/RemoveRejectedTypesStep.cs).
the [source code](https://github.com/xamarin/xamarin-macios/blob/main/tools/linker/RemoveRejectedTypesStep.cs).
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ static void GenerateAnalysisDoc (string path)
section += "title: Xamarin.iOS Analysis Rules\n";
section += "dateupdated: " + DateTime.Now.ToString("yyyy-MM-dd") + "\n";
section += "---\n\n";
section += "[//]: # (The original file resides under https://github.com/xamarin/xamarin-macios/tree/master/docs/website/)\n";
section += "[//]: # (The original file resides under https://github.com/xamarin/xamarin-macios/tree/main/docs/website/)\n";
section += "[//]: # (This allows all contributors (including external) to submit, using a PR, updates to the documentation that match the tools changes)\n";
section += "[//]: # (Modifications outside of xamarin-macios/master will be lost on future updates)\n\n";
section += "[//]: # (Modifications outside of xamarin-macios/main will be lost on future updates)\n\n";
section += "Xamarin.iOS analysis is a set of rules that check your project settings to help you determine if better/more optimized settings are available.\n\n";
section += "Run the analysis rules as often as possible to find possible improvements early on and save development time.\n\n";
section += "To run the rules, in Visual Studio for Mac's menu, select **Project > Run Code Analysis**.\n\n";
Expand Down
4 changes: 2 additions & 2 deletions dotnet/VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This is the scheme: `OsMajor.OsMinor.InternalRelease[-prereleaseX]+sha.1b2c3d4`.
* For CI we use a `ci` prefix + the branch name (cleaned up to only be
alphanumeric) + the commit distance (number of commits since any of the
major.minor.patch versions changed).
* Example: `iOS 15.0.100-ci.master.1234`
* Example: `iOS 15.0.100-ci.main.1234`
* Alphanumeric means `a-zA-Z0-9-`: any character not in this range
will be replaced with a `-`.
* Pull requests have `pr` prefix, followed by `gh`+ PR number + commit
Expand All @@ -38,7 +38,7 @@ This is the scheme: `OsMajor.OsMinor.InternalRelease[-prereleaseX]+sha.1b2c3d4`.
cumbersome. This leaves the complete version open for duplication,
but this is extremely unlikely.
* Example: `iOS 14.0.100+sha.1a2b3c`
* Example (CI build): `iOS 15.0.100-ci.master.1234+sha.1a2b3c`
* Example (CI build): `iOS 15.0.100-ci.main.1234+sha.1a2b3c`
* Since the build metadata is required for all builds, we're able to
recognize incomplete version numbers and determine if a particular
version string refers to a stable version or not.
Expand Down
6 changes: 3 additions & 3 deletions jenkins/custom-labels.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# Each label must go on a separate line.
# Lines starting with a hash are comments.
#
# ⚠️ Important: Do not merge this file into master (or any other release branch) if it has any labels in it ⚠️
# ⚠️ Important: Do not merge this file into main (or any other release branch) if it has any labels in it ⚠️
#
# This is used when building in CI to adjust what we build when we're building
# a branch (since we can't apply labels to branches), but if any labels are
# merged into master, that adjustment will be permanent, and that's most likely
# merged into main, that adjustment will be permanent, and that's most likely
# not what we want. For this reason, replace any empty comment line with labels,
# so that a merge attempt into master will fail with conflicts.
# so that a merge attempt into main will fail with conflicts.
#
# ℹ️ Remove any empty comment lines with labels ℹ️
#
Expand Down
2 changes: 1 addition & 1 deletion mk/xamarin.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MONO_BRANCH := $(shell cd $(MONO_PATH) 2> /dev/null && git symbolic-ref --sho
endif

ifdef ENABLE_XAMARIN
NEEDED_MACCORE_VERSION := 424fa2614873c7415cf0407d2389335cba0b6c79
NEEDED_MACCORE_VERSION := ed6d1468221f2220cd3f39294427160f0d3fbced
NEEDED_MACCORE_BRANCH := main

MACCORE_DIRECTORY := maccore
Expand Down
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ corresponding profile.
Two special `make` targets can be used to compare the generated code (.g.cs files) changes between two branches.
This is **required** when making changes to the generator.

1. Checkout the clean base branch (e.g master's HEAD) the feature (target) branch is based on.
1. Checkout the clean base branch (e.g main's HEAD) the feature (target) branch is based on.
2. Do `make generator-reference` in `xamarin-macios/src`.
3. Checkout the feature branch that requires the diff.
4. Do `make generator-diff`.
Expand Down
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Con

### Xamarin.Mac

Many tests when run for macOS use a integration [hack](https://github.com/xamarin/xamarin-macios/blob/master/tests/common/mac/MacTestMain.cs) which helps handle a number of issues:
Many tests when run for macOS use a integration [hack](https://github.com/xamarin/xamarin-macios/blob/main/tests/common/mac/MacTestMain.cs) which helps handle a number of issues:

- Allowing command line arguments to tests while excluding "psn" arguments passed in while debugging with Visual Studio for Mac
- Optionally integrating with the macOS message loop for tests that require it (anything that uses most Cocoa primitives).
Expand Down
13 changes: 13 additions & 0 deletions tests/sampletester/BaseTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ protected set {
}
}

string default_branch;
public virtual string DefaultBranch {
get {
if (default_branch == null)
default_branch = (string) GetType ().GetField ("DEFAULT_BRANCH", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static)?.GetValue (null);
return default_branch;

}
set {
default_branch = value;
}
}

protected BaseTester ()
{
}
Expand Down
14 changes: 7 additions & 7 deletions tests/sampletester/GitHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
using Xamarin.Tests;

public static class GitHub {
public static string [] GetProjects (string user, string repo, string hash)
public static string [] GetProjects (string user, string repo, string hash, string default_branch)
{
IEnumerable<string> files;

var dir = CloneRepository (user, repo, hash);
var dir = CloneRepository (user, repo, hash, default_branch);
files = Directory.GetFiles (dir, "*.*", SearchOption.AllDirectories);
files = files.Select ((v) => v.Substring (dir.Length).TrimStart ('/'));

Expand All @@ -23,7 +23,7 @@ public static string [] GetProjects (string user, string repo, string hash)
}).ToArray ();
}

public static string CloneRepository (string org, string repo, string hash, bool clean = true)
public static string CloneRepository (string org, string repo, string hash, string default_branch, bool clean = true)
{
var repo_dir = Path.Combine (Configuration.SampleRootDirectory, repo);

Expand All @@ -36,14 +36,14 @@ public static string CloneRepository (string org, string repo, string hash, bool
Assert.AreEqual (0, ExecutionHelper.Execute ("git", new string [] { "checkout", "-b", "temporary-sample-testing-branch", hash }, working_directory: repo_dir, timeout: TimeSpan.FromMinutes (1)), "git checkout");
Assert.AreEqual (0, ExecutionHelper.Execute ("git", new string [] { "submodule", "update", "--init", "--recursive" }, working_directory: repo_dir, timeout: TimeSpan.FromMinutes (10)), "git submodule update");

ExecutionHelper.Execute ("git", new string [] { "log", "--oneline", "--pretty=* @%h %s", "HEAD", "^origin/master" }, out var output1, working_directory: repo_dir, timeout: TimeSpan.FromSeconds (10));
ExecutionHelper.Execute ("git", new string [] { "log", "--oneline", "--pretty=* @%h %s", "HEAD", $"^origin/{default_branch}" }, out var output1, working_directory: repo_dir, timeout: TimeSpan.FromSeconds (10));
if (output1.Length > 0) {
Console.WriteLine ("Commits not in origin/master:");
Console.WriteLine ($"Commits not in origin/{default_branch}:");
Console.WriteLine (output1.ToString ().TrimEnd ('\n'));
}
ExecutionHelper.Execute ("git", new string [] { "log", "--oneline", "--pretty=* %h %s", "origin/master", "^HEAD" }, out var output2, working_directory: repo_dir, timeout: TimeSpan.FromSeconds (10));
ExecutionHelper.Execute ("git", new string [] { "log", "--oneline", "--pretty=* %h %s", $"origin/{default_branch}", "^HEAD" }, out var output2, working_directory: repo_dir, timeout: TimeSpan.FromSeconds (10));
if (output2.Length > 0) {
Console.WriteLine ("Commits in origin/master not being tested:");
Console.WriteLine ($"Commits in origin/{default_branch} not being tested:");
Console.WriteLine (output2.ToString ().TrimEnd ('\n'));
}

Expand Down
4 changes: 2 additions & 2 deletions tests/sampletester/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ projects, and build all the relevant projects in those repositories.

It is executed automatically in [Azure DevOps][1] every [Saturday][2] for the listed branches. This includes:

* `master`
* `main`
* `d16-x` - i.e. one or many active release branches
* `xcodeY` - i.e. the current xcode *beta* feature branch
* `mono-202z-zz` - i.e. the mono integration branches (new one every two months)

where `x`, `Y` and `z` needs to be periodically updated as new branches are created (e.g. `d16-x`) and old ones are merged into `master` (e.g. `xcodeY` and `mono-202z-zz`).
where `x`, `Y` and `z` needs to be periodically updated as new branches are created (e.g. `d16-x`) and old ones are merged into `main` (e.g. `xcodeY` and `mono-202z-zz`).

It can also be triggered manually, but have in mind that the commit in
question must already have packages (as GitHub statuses).
Expand Down
12 changes: 6 additions & 6 deletions tests/sampletester/SampleTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ public void BuildSample ([ValueSource ("GetSampleData")] SampleTestData sampleTe
}

static Dictionary<string, ProjectInfo []> projects = new Dictionary<string, ProjectInfo []> ();
protected static ProjectInfo [] GetExecutableProjects (string org, string repo, string hash)
protected static ProjectInfo [] GetExecutableProjects (string org, string repo, string hash, string default_branch)
{
if (!projects.TryGetValue (repo, out var rv)) {
var project_paths = GitHub.GetProjects (org, repo, hash);
var project_paths = GitHub.GetProjects (org, repo, hash, default_branch);

// We can filter out project we don't care about.
rv = project_paths.
Select ((v) => GetProjectInfo (v, Path.Combine (GitHub.CloneRepository (org, repo, hash, false), v))).
Select ((v) => GetProjectInfo (v, Path.Combine (GitHub.CloneRepository (org, repo, hash, default_branch, false), v))).
Where ((v) => v.IsApplicable (false)).
ToArray ();

Expand All @@ -199,7 +199,7 @@ protected static ProjectInfo [] GetExecutableProjects (string org, string repo,
return rv;
}

protected static IEnumerable<SampleTestData> GetSampleTestData (Dictionary<string, SampleTest> samples, string org, string repo, string hash, TimeSpan timeout)
protected static IEnumerable<SampleTestData> GetSampleTestData (Dictionary<string, SampleTest> samples, string org, string repo, string hash, string default_branch, TimeSpan timeout)
{
var defaultDebugConfigurations = new string [] { "Debug" };
var defaultReleaseConfigurations = new string [] { "Release" };
Expand All @@ -212,7 +212,7 @@ protected static IEnumerable<SampleTestData> GetSampleTestData (Dictionary<strin

// If a project's filename is unique in this repo, use the filename (without extension) as the name of the test.
// Otherwise use the project's relative path.
var executable_projects = GetExecutableProjects (org, repo, hash);
var executable_projects = GetExecutableProjects (org, repo, hash, default_branch);
var duplicateProjects = executable_projects.GroupBy ((v) => Path.GetFileNameWithoutExtension (v.RelativePath)).Where ((v) => v.Count () > 1);
foreach (var group in duplicateProjects) {
foreach (var proj in group) {
Expand Down Expand Up @@ -276,7 +276,7 @@ IEnumerable<T> filter<T> (string name, string proj, IEnumerable<T> input, string

string CloneRepo ()
{
return GitHub.CloneRepository (Org, Repository, Hash);
return GitHub.CloneRepository (Org, Repository, Hash, DefaultBranch);
}
}

Expand Down
Loading

0 comments on commit 95e42b9

Please sign in to comment.