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
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PropertyGroup>
<BaseIntermediateOutputPath Condition=" '$(BaseIntermediateOutputPath)' == '' ">obj\</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' != '' And $(TargetFramework.StartsWith ('netcoreapp')) ">
<PropertyGroup Condition=" '$(TargetFramework)' != '' and '$(TargetFramework)' != 'net472' and '$(TargetFramework)' != 'netstandard2.0' ">
<XATBuildingForNetCoreApp>True</XATBuildingForNetCoreApp>
</PropertyGroup>
<PropertyGroup Condition=" '$(XATBuildingForNetCoreApp)' == 'True' ">
Expand Down
30 changes: 7 additions & 23 deletions azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pr:

# Global variables
variables:
DotNetCoreVersion: 3.1.100
DotNetCoreVersion: 6.0.x

jobs:
- job: build
Expand Down Expand Up @@ -42,22 +42,8 @@ jobs:
inputs:
version: $(DotNetCoreVersion)

- task: NuGetToolInstaller@0
displayName: 'Install NuGet'
inputs:
versionSpec: 5.x

- task: NuGetCommand@2
displayName: 'NuGet Restore'
inputs:
restoreSolution: Xamarin.Android.Tools.sln
feedsToUse: config
nugetConfigPath: NuGet.config

- task: MSBuild@1
- script: dotnet build Xamarin.Android.Tools.sln -bl:$(Build.ArtifactStagingDirectory)/build.binlog
Copy link
Member

Choose a reason for hiding this comment

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

It may be preferable to use DotNetCoreCLI@2 here, though it shouldn't make much of a difference

  - task: DotNetCoreCLI@2
    displayName: 'Build solution Xamarin.Android.Tools.sln'
    inputs:
      projects: Xamarin.Android.Tools.sln
      arguments: -bl:$(Build.ArtifactStagingDirectory)/build.binlog

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought I would also have to put command: build or command: pack.

Does it do anything extra that is helpful? Like insert warnings inline in PRs? Something else?

Otherwise a one-line script: block seems simpler?

Copy link
Member

@pjcollins pjcollins Oct 11, 2022

Choose a reason for hiding this comment

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

The command: build param is used by default, so it doesn't need to be set when building. You would need to set command: pack for packing though.

I think the only advantage to using the task over a script is that it will probe multiple locations for dotnet, but since we're using the UseDotNet task there shouldn't be a difference either way.

There may also be some improvements to the Checks tab of PRs/commits when things fail like you suggested (for instance some extra logger settings are set), though I am not positive.

displayName: 'Build solution Xamarin.Android.Tools.sln'
inputs:
solution: Xamarin.Android.Tools.sln

- task: DotNetCoreCLI@2
displayName: 'Run Tests'
Expand All @@ -73,15 +59,13 @@ jobs:
Write-Host "##vso[task.setvariable variable=xat.nuget.version]$version"
condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT'))

- task: MSBuild@1
- script: dotnet pack src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj -p:Version=$(xat.nuget.version) -p:PackageOutputPath=$(Build.ArtifactStagingDirectory) -bl:$(Build.ArtifactStagingDirectory)/pack.binlog
Copy link
Member

Choose a reason for hiding this comment

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

We could also use DotNetCoreCLI@2 here instead.

displayName: 'Build NuGet'
inputs:
solution: 'src\Xamarin.Android.Tools.AndroidSdk\Xamarin.Android.Tools.AndroidSdk.csproj'
msbuildArguments: '/t:pack /p:Version=$(xat.nuget.version) /p:OutputPath=$(Build.ArtifactStagingDirectory)'
condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT'))

- task: PublishBuildArtifacts@1
- task: PublishPipelineArtifact@1
displayName: Upload Artifacts
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT'))
path: $(Build.ArtifactStagingDirectory)
artifactName: $(vmImage)
condition: always()
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="MSBuildReferences.projitems" />

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<RootNamespace>Microsoft.Android.Build.Tasks</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SignAssembly>true</SignAssembly>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
<DefineConstants>INTERNAL_NULLABLE_ATTRIBUTES</DefineConstants>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- $(TargetFrameworks) is used to allow the $(TargetFramework) check in Directory.Build.props to work.
If $(TargetFramework) is declared here instead, it will not be evaluated before Directory.Build.props
is loaded and the wrong $(TestOutputFullPath) will be used. -->
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<RootNamespace>Microsoft.Android.Build.BaseTasks.Tests</RootNamespace>
<IsPackable>false</IsPackable>
<OutputPath>$(TestOutputFullPath)</OutputPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- $(TargetFrameworks) is used to allow the $(TargetFramework) check in Directory.Build.props to work.
If $(TargetFramework) is declared here instead, it will not be evaluated before Directory.Build.props
is loaded and the wrong $(TestOutputFullPath) will be used. -->
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
<IsPackable>false</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion tools/ls-jdks/ls-jdks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<RootNamespace>Xamarin.Android.Tools</RootNamespace>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>$(ToolOutputFullPath)</OutputPath>
Expand Down