Commit 3e998b2
[build] Add support for commercial builds (#2845)
Fixes: https://github.com/xamarin/monodroid/issues/800
Context: https://github.com/xamarin/monodroid/commit/bee5f69a0b41aaeb88fad86ce4d65960a959def9
When the Mono team works on a PR to bump mono (e.g. [PR 1536][0]),
they need to deal with two different build systems:
1. The xamarin-android build system, and
2. The monodroid build system.
Shocking as this may sound, the OSS xamarin-android build system gets
more love from the Xamarin.Android team than the commercial monodroid
build system. As such, the monodroid build system is "baroque", not
well tested off of a limited number of machines, prone to peculiar
breakages, and otherwise adds a level of complexity and annoyance
that everyone would rather do without.
Unfortunately, *because* the monodroid repo is private, we can't have
the xamarin-android repo contain a "proper" git submodule to it, as
that would break all external contributors. Thus, historically, the
monodroid repo instead had a git submodule reference to the
xamarin-android repo, which brings a *different* set of problems,
e.g. the commercial builds are *always* older than the OSS builds,
and accidental breakage is caught much later than we'd like.
The solution? For commercial builds, instead of "starting with" the
monodroid repo, which submodules xamarin-android and (not-always-
correctly) builds xamarin-android, we instead have the
xamarin-android repo "reference" the monodroid repo, and have "hooks"
in the xamarin-android build system so that monodroid can be built
*from xamarin-android*. This will simplify life for the Mono team,
allow for (hopefully) easier and more frequent commercial builds,
simplify integration testing of commercial builds, and hopefully
result in fewer apologies from @jonpryor about monodroid builds.
Now, about that "reference": if we can't use git submodules to link
the monodroid repo to the xamarin-android repo, how do we maintain
that reference?
~~ .external ~~
There is a (seldom-used) convention among some Xamarin projects: the
[`.external`][1] file. This is a plain-text file which allows
specifying external dependencies. Blank lines and lines beginning
with `#` are ignored, as well as lines which don't match a valid
format. The external dependency reference format is:
$(RepoOwner)/$(RepoName):$(BranchName)@$(CommitHash)
We will use the `.external` file in order to link a specific
monodroid commit to the xamarin-android build.
This file *may* be used in the future for mono, as part of the
[Mono Archive][2] work.
The new `make prepare-external-git-dependencies` rule will clone all
git submodule references listed in the `.external` file. This rule
indirectly uses the new `external-git-dependencies.targets` MSBuild
file, which exposes two new targets:
* `ParseExternalFile`: Parses `.external` and creates the
`@(Externals)` item group, which contains item metadata:
* `%(Owner)`: The GitHub owner/organization
* `%(Name)`: The git repo name
* `%(Branch)`: The git repo branch
* `%(Identity)`: The git commit in the repo
* `CheckoutExternalGitDependency`: Clones or updates the git repos
specified in `@(Externals)` into
`$(ExternalSourceDependencyDirectory)`, which defaults to the
top-level `external` directory.
The new `<ParseExternalGitDependencies/>` task which is used by the
`ParseExternalFile` target, while the new
`<CheckoutExternalGitDependency/>` task is used by the
`CheckoutExternalGitDependency` target.
`external-git-dependencies.target` is `<Import/>`ed by
`xa-prep-tasks.csproj` to allow us to easily checkout, download, and
process the `.external` file.
~~ Build system hooks ~~
The `make jenkins` target has been turned into a
[double-colon rule][3], which allows the `make jenkins` target to be
specified multiple times, in multiple files, separately.
There is also now an optional [**make** `include`][4] to
`external/monodroid/xa-integration.mk`.
`monodroid/xa-integration.mk` overrides the `make jenkins` target so
that it can integrate it's build into the xamarin-android build.
~~ Installers ~~
`OpenTK.dll` and it's related files have been removed from the
installers, in an effort to start reducing the interdependencies
between the monodroid & xamarin-android repos.
Finally, add a way to override a portion of our installer filenames,
while still using version information from xamarin-android, by
setting `$(UseCommercialInstallerName)`=True.
[0]: #1836
[1]: https://github.com/xamarin/external
[2]: https://github.com/xamarin/xamarin-android/projects/10
[3]: https://www.gnu.org/software/make/manual/html_node/Double_002dColon.html
[4]: https://www.gnu.org/software/make/manual/html_node/Include.html1 parent 09d8c58 commit 3e998b2
File tree
18 files changed
+227
-22
lines changed- Documentation/building
- unix
- windows
- build-tools
- Xamarin.Android.Tools.BootstrapTasks
- Xamarin.Android.Tools.BootstrapTasks
- create-pkg
- create-vsix
- installers
- scripts
- xa-prep-tasks
- Xamarin.Android.BuildTools.PrepTasks
18 files changed
+227
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
| |||
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
29 | | - | |
| 37 | + | |
30 | 38 | | |
31 | 39 | | |
32 | 40 | | |
| |||
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
49 | 68 | | |
50 | 69 | | |
51 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
28 | 34 | | |
29 | | - | |
| 35 | + | |
30 | 36 | | |
31 | 37 | | |
32 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
206 | 217 | | |
207 | 218 | | |
208 | 219 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | | - | |
| 11 | + | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
| 42 | + | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| 137 | + | |
136 | 138 | | |
137 | 139 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
0 commit comments