Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[ci] Use new DevDiv/android-platform-support repo #9366

Merged
merged 19 commits into from
Nov 21, 2024
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
2 changes: 1 addition & 1 deletion .external
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xamarin/monodroid:main@6b27528406d556322328d1dae19a384fff074f66
DevDiv/android-platform-support:main@cdef164e7eef35128f74fa1f3ecbd7a878953a43
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ apk-sizes-*.txt
*.binlog
*.ProjectImports.zip
*~
external/android-platform-support/
external/monodroid/
external/mono/
tests/api-compatibility/reference/*/*.dll
Expand Down
8 changes: 4 additions & 4 deletions build-tools/automation/azure-pipelines-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ resources:
name: xamarin/yaml-templates
ref: refs/heads/main
endpoint: xamarin
- repository: monodroid
type: github
name: xamarin/monodroid
endpoint: xamarin
- repository: android-platform-support
type: git
name: DevDiv/android-platform-support
ref: refs/heads/main
- repository: maui
type: github
name: dotnet/maui
Expand Down
9 changes: 4 additions & 5 deletions build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ resources:
name: xamarin/sdk-insertions
ref: refs/heads/main
endpoint: xamarin
- repository: monodroid
type: github
name: xamarin/monodroid
- repository: android-platform-support
type: git
name: DevDiv/android-platform-support
ref: refs/heads/main
endpoint: xamarin
- repository: maui
type: github
name: dotnet/maui
Expand Down Expand Up @@ -90,7 +89,7 @@ extends:
sourceRepositoriesToScan:
include:
- ${{ if ne(variables['System.PullRequest.IsFork'], 'True') }}:
- repository: monodroid
- repository: android-platform-support
exclude:
- repository: yaml-templates
- repository: maui
Expand Down
8 changes: 2 additions & 6 deletions build-tools/automation/yaml-templates/build-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,12 @@ stages:
- checkout: maui

- ${{ if ne(variables['System.PullRequest.IsFork'], 'True') }}:
- checkout: monodroid
- checkout: android-platform-support
clean: true
submodules: recursive
path: s/xamarin-android/external/monodroid
path: s/xamarin-android/external/android-platform-support
persistCredentials: true

- script: rm -rf external/monodroid/external/xamarin-android
workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-android
displayName: delete external xamarin-android submodule

- script: make prepare-external-git-dependencies PREPARE_CI=1 CONFIGURATION=$(XA.Build.Configuration)
workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-android
displayName: make prepare-external-git-dependencies
Expand Down
19 changes: 2 additions & 17 deletions build-tools/automation/yaml-templates/commercial-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,11 @@ steps:
- checkout: maui

- ${{ if ne(variables['System.PullRequest.IsFork'], 'True') }}:
# Clone 'monodroid' without submodules
- checkout: monodroid
clean: true
path: s/xamarin-android/external/monodroid

# Tell git to ignore the 'xamarin-android' submodule, which is large and unneeded
- script: git config submodule."external/xamarin-android".update none
workingDirectory: xamarin-android/external/monodroid
displayName: Ignore XA submodule

# Clone 'monodroid' with the rest of the submodules
- checkout: monodroid
- checkout: android-platform-support
submodules: recursive
path: s/xamarin-android/external/monodroid
path: s/xamarin-android/external/android-platform-support
persistCredentials: true

- script: rm -rf external/monodroid/external/xamarin-android
workingDirectory: ${{ parameters.xaSourcePath }}
displayName: delete legacy xamarin-android submodule

- script: make prepare-external-git-dependencies PREPARE_CI=1 CONFIGURATION=$(XA.Build.Configuration)
workingDirectory: ${{ parameters.xaSourcePath }}
displayName: make prepare-external-git-dependencies
Expand Down
2 changes: 1 addition & 1 deletion build-tools/installers/create-installers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<LibExtension Condition=" '$(HostOS)' == 'Windows' ">dll</LibExtension>
<UseCommercialInstallerName Condition="'$(UseCommercialInstallerName)' == ''">False</UseCommercialInstallerName>
<_HasCommercialFiles Condition="Exists('$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Common.Debugging.targets')">True</_HasCommercialFiles>
<_MonoDroidPath Condition=" '$(_MonoDroidPath)' == '' ">..\..\external\monodroid</_MonoDroidPath>
<_MonoDroidPath Condition=" '$(_MonoDroidPath)' == '' ">..\..\external\android-platform-support</_MonoDroidPath>
</PropertyGroup>
<Target Name="_FindFrameworkDirs">
<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions build-tools/scripts/BuildEverything.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ ifeq ($(PREPARE_CI_PR)$(PREPARE_CI),00)
else
$(MAKE) prepare
endif
ifneq ("$(wildcard $(topdir)/external/monodroid/Makefile)","")
cd $(topdir)/external/monodroid && ./configure --with-xamarin-android='$(topdir)'
$(call DOTNET_BINLOG,build-commercial) $(SOLUTION) -t:BuildExternal
ifneq ("$(wildcard $(topdir)/external/android-platform-support/src/Xamarin.Android.Build.Debugging.Tasks/Xamarin.Android.Build.Debugging.Tasks.csproj)","")
$(call SYSTEM_DOTNET_BINLOG,build-commercial,msbuild) $(SOLUTION) -t:BuildExternal
endif
$(MAKE) leeroy

Expand Down
4 changes: 2 additions & 2 deletions build-tools/scripts/DotNet.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

<Target Name="BuildExternal">
<Exec
Command="&quot;$(DotNetPreviewTool)&quot; build monodroid.proj -c $(Configuration) -p:XamarinAndroidSourcePath=$(_Root) -p:DebuggingToolsOutputDirectory=$(MicrosoftAndroidSdkOutDir) -p:CompatTargetsOutputDirectory=$(XAInstallPrefix)xbuild/Novell -bl:$(_BinlogPathPrefix)-build-monodroid.binlog"
WorkingDirectory="$(_Root)external\monodroid"
Command="&quot;$(DotNetPreviewTool)&quot; build monodroid.proj -c $(Configuration) -p:XamarinAndroidSourcePath=$(_Root) -p:XAIntegrationBuild=true -bl:$(_BinlogPathPrefix)-build-monodroid.binlog"
WorkingDirectory="$(_Root)external\android-platform-support\build-tools"
/>
</Target>

Expand Down
2 changes: 1 addition & 1 deletion build-tools/scripts/msbuild.mk
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ endef

# $(call DOTNET_BINLOG,name,build=$(DOTNET_VERB),dotnet=$(DOTNET_TOOL))
define DOTNET_BINLOG
$(if $(3),,PATH="$(DOTNET_ROOT):$(PATH)") $(if $(3),$(3),$(DOTNET_TOOL)) $(if $(2),$(2),$(DOTNET_VERB)) -c $(CONFIGURATION) -v:n $(MSBUILD_ARGS) \
$(if $(3),,PATH="$(DOTNET_ROOT):$(PATH)") $(if $(3),$(3),$(DOTNET_TOOL)) $(if $(2),$(2),$(DOTNET_VERB)) -p:Configuration=$(CONFIGURATION) -v:n $(MSBUILD_ARGS) \
-bl:"$(dir $(realpath $(firstword $(MAKEFILE_LIST))))/bin/Build$(CONFIGURATION)/msbuild-`date +%Y%m%dT%H%M%S`-$(1).binlog"
endef

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ protected override async Task<bool> Execute (Context context)
};
foreach (ExternalGitDependency egd in externalDependencies) {
Log.StatusLine ($" {context.Characters.Bullet} {egd.Name}");

var egdUrl = await GetGitHubURL (egd, git);
string destDir = Path.Combine (Configurables.Paths.ExternalGitDepsDestDir, egd.Name);
if (!Directory.Exists (destDir)) {
var egdUrl = await GetGitHubURL (egd, git);
if (egd.Owner == "DevDiv") {
egdUrl = GetDevDivUrl (egd);
}
Log.StatusLine ($" {context.Characters.Link} cloning from {egd.Owner}/{egd.Name}");
if (!await git.Clone (egdUrl, destDir)) {
Log.ErrorLine ($"Failed to clone {egd.Name}");
Expand All @@ -49,22 +51,20 @@ protected override async Task<bool> Execute (Context context)
continue;
}

//
// Commented out for now because we only have monodroid in .external and its submodules are updated
// elsewhere and there's no need to duplicate the (time-consuming) work. However, it might be a good
// idea to re-enable this code for the benefit of future .external additions (and, possibly, monodroid
// itself after its integration code is updated to not initialize submodules)
//
string gitModules = Path.Combine (destDir, ".gitmodules");
if (!Utilities.FileExists (gitModules))
continue;

// string gitModules = Path.Combine (destDir, ".gitmodules");
// if (!Utilities.FileExists (gitModules))
// continue;
Log.StatusLine ($" {context.Characters.Bullet} updating submodules");
if (!await git.SubmoduleUpdate (destDir)) {
Log.ErrorLine ($"Failed to update submodules for {egd.Name}");
failed = true;
}

// Log.StatusLine ($" {context.Characters.Bullet} updating submodules");
// if (!await git.SubmoduleUpdate (destDir)) {
// Log.ErrorLine ($"Failed to update submodules for {egd.Name}");
// failed = true;
// }
if (failed) {
Log.WarningLine ($"If an attempt to clone or update a private repo failed you may need to refresh your credentials."
+ $" Please install https://github.com/microsoft/artifacts-credprovider, or navigate to {egdUrl} and click the 'Generate Git Credentials' button and attempt to clone manually.");
}
}

return !failed;
Expand All @@ -83,5 +83,10 @@ async Task<string> GetGitHubURL (ExternalGitDependency egd, GitRunner git)
}
}
}

string GetDevDivUrl (ExternalGitDependency egd)
{
return $"https://devdiv.visualstudio.com/{egd.Owner}/_git/{egd.Name}";
}
}
}
Loading