Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ trigger:
variables:
BUILD_NUMBER: $(Build.BuildNumber)
BUILD_COMMIT: $(Build.SourceVersion)
PRE_RESTORE_PROJECTS: true # Windows is having an issue on CI right now
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so the WORKAROUND is temporary :)

# XAMARIN_ANDROID_PATH: <path to Xamarin.Android>

resources:
Expand Down
18 changes: 15 additions & 3 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,20 @@ Task ("binderate")
Task("libs")
.Does(() =>
{
if (bool.TryParse(EnvironmentVariable("PRE_RESTORE_PROJECTS") ?? "false", out var restore) && restore) {
var restoreSettings = new MSBuildSettings()
.SetConfiguration(CONFIGURATION)
.SetVerbosity(VERBOSITY)
.SetMaxCpuCount(0)
.WithProperty("DesignTimeBuild", "false")
.WithProperty("AndroidSdkBuildToolsVersion", "28.0.3")
.WithTarget("Restore");

foreach (var csproj in GetFiles("./generated/**/*.csproj")) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, a global restore is broken. So, just restore each project be fore building.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

MSBuild(csproj, restoreSettings);
}
}

var settings = new MSBuildSettings()
.SetConfiguration(CONFIGURATION)
.SetVerbosity(VERBOSITY)
Expand All @@ -153,11 +167,9 @@ Task("nuget")
.SetConfiguration(CONFIGURATION)
.SetVerbosity(VERBOSITY)
.SetMaxCpuCount(0)
.WithRestore()
.WithProperty("NoBuild", "true")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't build on the Pack - speeds things up as it doesn't have to check for Restore and Build.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool trick

.WithProperty("PackageRequireLicenseAcceptance", "true")
.WithProperty("PackageOutputPath", MakeAbsolute ((DirectoryPath)"./output/").FullPath)
.WithProperty("DesignTimeBuild", "false")
.WithProperty("AndroidSdkBuildToolsVersion", "28.0.3")
.WithTarget("Pack");

MSBuild("./generated/AndroidX.sln", settings);
Expand Down
16 changes: 14 additions & 2 deletions source/AndroidXProject.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,26 @@
{
// Disabled as this build task doesn't really do anything anymore but we may use it again in the future
<ItemGroup>
<None Include="..\..\source\buildtasks\annotation\bin\$(Configuration)\Xamarin.AndroidX.Annotation.BuildTasks.dll" Pack="True" PackagePath="build\$(TargetFramework)" />
<ProjectReference Include="..\..\source\buildtasks\annotation\Annotation-BuildTasks.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<OutputItemType>None</OutputItemType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Pack>true</Pack>
<PackagePath>build\$(TargetFramework)</PackagePath>
</ProjectReference>
</ItemGroup>
}

@if (@Model.NuGetPackageId == "Xamarin.AndroidX.VectorDrawable")
{
<ItemGroup>
<None Include="..\..\source\buildtasks\vectordrawable\bin\$(Configuration)\Xamarin.AndroidX.VectorDrawable.BuildTasks.dll" Pack="True" PackagePath="build\$(TargetFramework)" />
<ProjectReference Include="..\..\source\buildtasks\vectordrawable\VectorDrawable-BuildTasks.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<OutputItemType>None</OutputItemType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Pack>true</Pack>
<PackagePath>build\$(TargetFramework)</PackagePath>
</ProjectReference>
</ItemGroup>
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\xunit.runner.visualstudio.2.4.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\packages\xunit.runner.visualstudio.2.4.0\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="..\..\packages\xunit.core.2.4.0\build\xunit.core.props" Condition="Exists('..\..\packages\xunit.core.2.4.0\build\xunit.core.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -29,8 +27,8 @@
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" version="2.4.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" version="2.4.1" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down