Add pipeline
This commit is contained in:
Родитель
408a5c21c8
Коммит
ea942dd8fd
|
@ -0,0 +1,33 @@
|
|||
<Project>
|
||||
<Import Project="eng\Version.props" />
|
||||
<PropertyGroup>
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
<ProduceReferenceAssembly Condition="'$(UsingMicrosoftNETSdk)' == 'True' AND '$(Configuration)' == 'Debug'">True</ProduceReferenceAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<GitDefaultBranch>main</GitDefaultBranch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<Summary>Library to draw MAUI controls.</Summary>
|
||||
<PackageTag>xamarin,ios,android,uwp,xamarin.forms,controls,watchos,tvos,tizen,draw</PackageTag>
|
||||
<Description>Library to draw MAUI controls.</Description>
|
||||
<Company>Microsoft</Company>
|
||||
<Product>Microsoft MAUI Graphics Controls</Product>
|
||||
<Authors>Microsoft</Authors>
|
||||
<Owners>microsoft</Owners>
|
||||
<NeutralLanguage>en</NeutralLanguage>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<RepositoryUrl>https://github.com/dotnet/Microsoft.Maui.Graphics.Controls.git</RepositoryUrl>
|
||||
<ProjectUrl>https://github.com/dotnet/Microsoft.Maui.Graphics.Controls</ProjectUrl>
|
||||
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
|
||||
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
|
||||
<PackageOutputPath>$(MSBuildThisFileDirectory)artifacts</PackageOutputPath>
|
||||
</PropertyGroup>
|
||||
<!-- This target is replaced by GitInfo when restored. Allows Version.targets to rely on it before restore. -->
|
||||
<Target Name="GitVersion" />
|
||||
<Target Name="GitInfo" />
|
||||
<Import Condition="'$(EnvironmentBuildPropsImported)' != 'True'" Project="$(MSBuildThisFileDirectory)eng\Environment.Build.props" />
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
<Project>
|
||||
<Import Project="eng\Git.Build.targets" />
|
||||
<Import Project="eng\Version.targets" />
|
||||
</Project>
|
|
@ -0,0 +1 @@
|
|||
6.0.100-preview.4
|
|
@ -0,0 +1,20 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<EnvironmentBuildPropsImported>true</EnvironmentBuildPropsImported>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(CI)' == ''">
|
||||
<CI>false</CI>
|
||||
<CI Condition="'$(TF_BUILD)' == 'true'">true</CI>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Auto install any missing Android SDKs -->
|
||||
<PropertyGroup Condition="'$(CI)' == 'true'">
|
||||
<AndroidRestoreOnBuild Condition="'$(AndroidRestoreOnBuild)' == ''">False</AndroidRestoreOnBuild>
|
||||
<AcceptAndroidSDKLicenses Condition="'$(AcceptAndroidSDKLicenses)' == ''">True</AcceptAndroidSDKLicenses>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,6 @@
|
|||
<Project>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="GitInfo" Version="2.1.2" PrivateAssets="All" />
|
||||
<PackageReference Include="MSBuilder.GenerateAssemblyInfo" Version="0.2.2" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,9 @@
|
|||
<Project>
|
||||
<!--Package versions-->
|
||||
<PropertyGroup>
|
||||
<MicrosoftNETSdkPackageVersion>6.0.100-preview.2.21155.3</MicrosoftNETSdkPackageVersion>
|
||||
<MicrosoftAndroidSdkPackageVersion>11.0.200-ci.main.148</MicrosoftAndroidSdkPackageVersion>
|
||||
<MicrosoftMacCatalystSdkPackageVersion>14.3.100-ci.main.337</MicrosoftMacCatalystSdkPackageVersion>
|
||||
<MicrosoftiOSSdkPackageVersion>14.4.100-ci.main.1192</MicrosoftiOSSdkPackageVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,115 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<NightlyTag>nightly</NightlyTag>
|
||||
<RegexTag>[a-z]+\.[0-9]</RegexTag>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<GitBranch Condition="'$(SYSTEM_PULLREQUEST_TARGETBRANCH)' != ''">$(SYSTEM_PULLREQUEST_TARGETBRANCH)</GitBranch>
|
||||
<GitBranch Condition="'$(SYSTEM_PULLREQUEST_TARGETBRANCH)' == '' and '$(BUILD_SOURCEBRANCHNAME)' != ''">$(BUILD_SOURCEBRANCHNAME)</GitBranch>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<CoreCompileDependsOn>
|
||||
SetVersions;
|
||||
VersionInfoReport;
|
||||
$(CoreCompileDependsOn);
|
||||
</CoreCompileDependsOn>
|
||||
<GenerateNuspecDependsOn>
|
||||
SetVersions;
|
||||
VersionInfoReport;
|
||||
$(GenerateNuspecDependsOn);
|
||||
</GenerateNuspecDependsOn>
|
||||
<GetPackageVersionDependsOn>
|
||||
SetVersions;
|
||||
VersionInfoReport;
|
||||
$(GetPackageVersionDependsOn);
|
||||
</GetPackageVersionDependsOn>
|
||||
<SetVersionsBefore>
|
||||
GetAssemblyVersion;
|
||||
$(SetVersionsBefore);
|
||||
</SetVersionsBefore>
|
||||
<SetVersionsDependsOn>
|
||||
GitInfo;
|
||||
GitVersion;
|
||||
$(SetVersionsDependsOn);
|
||||
</SetVersionsDependsOn>
|
||||
<SetGitInfoPropsBefore>
|
||||
GitInfo;
|
||||
GitVersion;
|
||||
</SetGitInfoPropsBefore>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="SetGitInfoProps" BeforeTargets="$(SetGitInfoPropsBefore)">
|
||||
<PropertyGroup>
|
||||
<GitDefaultBranch>main</GitDefaultBranch>
|
||||
<GitIgnoreBranchVersion>true</GitIgnoreBranchVersion>
|
||||
<GitIgnoreTagVersion>true</GitIgnoreTagVersion>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
<Target Name="SetVersions" BeforeTargets="$(SetVersionsBefore)" DependsOnTargets="$(SetVersionsDependsOn)" Returns="$(Version)">
|
||||
<PropertyGroup>
|
||||
<SemVerLabel>$([System.Text.RegularExpressions.Regex]::Match($(GitTag), $(RegexTag)))</SemVerLabel>
|
||||
<GitDefaultBranch>main</GitDefaultBranch>
|
||||
<GitIgnoreBranchVersion>true</GitIgnoreBranchVersion>
|
||||
<GitIgnoreTagVersion>true</GitIgnoreTagVersion>
|
||||
<GitSemVerLabel Condition=" '$(GitTag)' != '' and $([System.Text.RegularExpressions.Regex]::IsMatch('$(GitTag)', $(RegexTag))) ">$(SemVerLabel)</GitSemVerLabel>
|
||||
<GitSemVerLabel Condition="$(CI) and '$(BUILD_REASON)' == 'Schedule'">$(NightlyTag)</GitSemVerLabel>
|
||||
<GitSemVerDashLabel Condition="'$(GitSemVerLabel)' != ''" >-$(GitSemVerLabel)</GitSemVerDashLabel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<VersionMetadata Include="$(GitCommits)" Condition="'$(GitSemVerDashLabel)' == ''" />
|
||||
|
||||
<VersionMetadata Condition="$(CI) and '$(BUILD_REASON)' == 'PullRequest'"
|
||||
Include="pr.$(SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)"/>
|
||||
|
||||
<VersionMetadata Include="sha.$(GitCommit)"/>
|
||||
|
||||
<VersionMetadata Condition="$(CI)"
|
||||
Include="azdo.$(BUILD_BUILDID)"/>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<VersionMetadataLabel>@(VersionMetadata -> '%(Identity)', '-')</VersionMetadataLabel>
|
||||
<VersionMetadataPlusLabel Condition="'$(VersionMetadataLabel)' != ''">+$(VersionMetadataLabel)</VersionMetadataPlusLabel>
|
||||
<Version>$(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitBaseVersionPatch)</Version>
|
||||
<PackageVersion>$(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)$(GitSemVerDashLabel)$(VersionMetadataPlusLabel)</PackageVersion>
|
||||
|
||||
<PackageVersion Condition="$(CI)">$(GitSemVerMajor).$(GitSemVerMinor).$(GitBaseVersionPatch)$(GitSemVerDashLabel).$(BUILDVERSION)$(VersionMetadataPlusLabel)</PackageVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<InformationalVersion>$(PackageVersion)</InformationalVersion>
|
||||
<FileVersion>$(Version).$(GitCommits)</FileVersion>
|
||||
<AssemblyVersion>1.0.0.0</AssemblyVersion> <!-- THIS SHALL REMAIN 1.0.0.0 -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AssemblyAttribute Include="System.Reflection.AssemblyMetadata">
|
||||
<_Parameter1>Version</_Parameter1>
|
||||
<_Parameter2>1.0.0.0</_Parameter2> <!-- THIS SHALL REMAIN 1.0.0.0 -->
|
||||
</AssemblyAttribute>
|
||||
<AssemblyAttribute Include="System.Reflection.AssemblyMetadata">
|
||||
<_Parameter1>PackageVersion</_Parameter1>
|
||||
<_Parameter2>$(PackageVersion)</_Parameter2>
|
||||
</AssemblyAttribute>
|
||||
</ItemGroup>
|
||||
|
||||
<Message Condition="$(CI) and '$(BUILD_REASON)' == 'Schedule'" Importance="high" Text="##vso[build.addbuildtag]$(NightlyTag)"/>
|
||||
<Message Condition="$(CI)" Importance="high" Text="##vso[build.updatebuildnumber]$(PackageVersion)"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="VersionInfoReport" DependsOnTargets="SetVersions">
|
||||
<ItemGroup>
|
||||
<Message Importance="$(GitInfoReportImportance)" Text="Version Info:
|
||||
AssemblyVersion: $(AssemblyVersion)
|
||||
FileVersion: $(FileVersion)
|
||||
InformationalVersion: $(InformationalVersion)
|
||||
PackageVersion: $(PackageVersion)
|
||||
Version: $(Version)
|
||||
VersionPrefix: $(VersionPrefix)
|
||||
VersionSuffix: $(VersionSuffix)
|
||||
"/>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"tool": "Credential Scanner",
|
||||
"suppressions": [
|
||||
{
|
||||
"file": "\\debug.keystore",
|
||||
"_justification": "Dummy debug store file used for testing."
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
<FirstParty Include="GraphicsControls.dll" />
|
||||
<FirstParty Include="Microsoft.Maui.dll" />
|
||||
<FirstParty Include="Microsoft.Maui.*.dll" />
|
||||
<FirstParty Include="FormsViewGroup.dll" />
|
||||
<FirstParty Include="Xamarin.Forms.*.dll" />
|
||||
<FirstParty Include="Microsoft.AspNetCore.Components.WebView.Maui.dll" />
|
||||
|
||||
<!-- SkiaSharp -->
|
||||
<FirstParty Include="SkiaSharp*.dll" />
|
||||
<FirstParty Include="HarfBuzzSharp*.dll" />
|
||||
<!-- native -->
|
||||
<FirstParty Include="libSkiaSharp.dll" />
|
||||
<FirstParty Include="libHarfBuzzSharp.dll" />
|
||||
<!-- ANGLE -->
|
||||
<FirstParty Include="libEGL.dll" />
|
||||
<FirstParty Include="libGLESv2.dll" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ThirdParty Include="GMap.NET.Core.dll" />
|
||||
<ThirdParty Include="GMap.NET.GTK.dll" />
|
||||
<ThirdParty Include="webkit-sharp.dll" />
|
||||
<ThirdParty Include="Mono.Cecil.dll" />
|
||||
<ThirdParty Include="Mono.Cecil.*.dll" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ThirdParty Include="Svg.*.dll" />
|
||||
<ThirdParty Include="Fizzler.dll" />
|
||||
<ThirdParty Include="Newtonsoft.Json.dll;" />
|
||||
<ThirdParty Include="Svg2VectorDrawable.Net.dll" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Skip Include="System.*.dll" />
|
||||
<Skip Include="NuGet.*.dll" />
|
||||
<Skip Include="Mono.*.dll" />
|
||||
<Skip Include="Microsoft.Build.*.dll" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,151 @@
|
|||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- release/*
|
||||
tags:
|
||||
include:
|
||||
- '*'
|
||||
paths:
|
||||
include:
|
||||
- '*'
|
||||
exclude:
|
||||
- .github/*
|
||||
- docs/*
|
||||
- CODE-OF-CONDUCT.md
|
||||
- CONTRIBUTING.md
|
||||
- LICENSE.TXT
|
||||
- PATENTS.TXT
|
||||
- README.md
|
||||
- SECURITY.md
|
||||
- THIRD-PARTY-NOTICES.TXT
|
||||
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- release/*
|
||||
paths:
|
||||
include:
|
||||
- '*'
|
||||
exclude:
|
||||
- .github/*
|
||||
- docs/*
|
||||
- CODE-OF-CONDUCT.md
|
||||
- CONTRIBUTING.md
|
||||
- LICENSE.TXT
|
||||
- PATENTS.TXT
|
||||
- README.md
|
||||
- SECURITY.md
|
||||
- THIRD-PARTY-NOTICES.TXT
|
||||
|
||||
schedules:
|
||||
- cron: "0 0 * * *"
|
||||
displayName: Daily midnight build
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
|
||||
variables:
|
||||
- template: /eng/pipelines/common/variables.yml
|
||||
|
||||
parameters:
|
||||
- name: BuildEverything
|
||||
type: boolean
|
||||
default: false
|
||||
- name: BuildConfigurations
|
||||
type: object
|
||||
default:
|
||||
- Debug
|
||||
- Release
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: xamarin-templates
|
||||
type: github
|
||||
name: xamarin/yaml-templates
|
||||
endpoint: xamarin
|
||||
ref: refs/heads/main
|
||||
|
||||
stages:
|
||||
|
||||
- stage: win_build
|
||||
displayName: Build Windows
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- ${{ each BuildCondition in parameters.BuildConfigurations }}:
|
||||
- job: win_hosted_${{ BuildCondition }}
|
||||
workspace:
|
||||
clean: all
|
||||
displayName: Build Windows Phase (${{ BuildCondition }})
|
||||
timeoutInMinutes: 60
|
||||
pool:
|
||||
name: $(winVmPool)
|
||||
vmImage: $(winVmImage)
|
||||
demands: [ msbuild ]
|
||||
variables:
|
||||
buildConfiguration : '${{ BuildCondition }}'
|
||||
steps:
|
||||
- task: NuGetCommand@2
|
||||
inputs:
|
||||
command: 'restore'
|
||||
restoreSolution: $(GraphicsControlsSln)
|
||||
|
||||
- task: MSBuild@1
|
||||
displayName: 'Build sln'
|
||||
inputs:
|
||||
solution: $(GraphicsControlsSln)
|
||||
configuration: $(BuildConfiguration)
|
||||
msbuildArguments: -bl:$(build.artifactstagingdirectory)/${{BuildCondition}}/win_build_${{ BuildCondition }}.binlog
|
||||
|
||||
- task: MSBuild@1
|
||||
displayName: 'Pack sln'
|
||||
inputs:
|
||||
solution: $(GraphicsControlsLibraryProject)
|
||||
configuration: $(BuildConfiguration)
|
||||
msbuildArguments: -t:pack /p:PackageOutputPath="$(build.artifactstagingdirectory)/nuget/${{ BuildCondition }}"
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy Files dlls'
|
||||
inputs:
|
||||
Contents: src/**/bin/**/*.dll
|
||||
TargetFolder: '$(build.artifactstagingdirectory)/${{ BuildCondition }}'
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy nupkg'
|
||||
inputs:
|
||||
Contents: artifacts/*.nupkg
|
||||
flattenFolders: true
|
||||
TargetFolder: '$(build.artifactstagingdirectory)/nuget/${{ BuildCondition }}/'
|
||||
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy SignList.xml Files'
|
||||
inputs:
|
||||
Contents: eng/automation/SignList.xml
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)/nuget/${{ BuildCondition }}'
|
||||
flattenFolders: true
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: win_build'
|
||||
condition: always()
|
||||
inputs:
|
||||
ArtifactName: win_build
|
||||
|
||||
|
||||
# only sign using the private server
|
||||
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
|
||||
- stage: nuget_signing
|
||||
dependsOn: win_build
|
||||
displayName: Sign Nuget
|
||||
jobs:
|
||||
- template: sign-artifacts/jobs/v2.yml@xamarin-templates
|
||||
parameters:
|
||||
teamName: Maui
|
||||
usePipelineArtifactTasks: false
|
||||
artifactName: win_build
|
||||
artifactPath: nuget/Release
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)/nuget/signed
|
||||
signedArtifactName: nuget
|
||||
signedArtifactPath: signed
|
||||
displayName: Sign Phase
|
||||
condition: and(succeeded(), or(eq(variables['Sign'], 'true'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'],'refs/tags/'))))
|
|
@ -0,0 +1,13 @@
|
|||
variables:
|
||||
- name: BuildVersion
|
||||
value: $[counter('nuget-counter', 1)]
|
||||
- name: NUGET_VERSION
|
||||
value: 5.8.1
|
||||
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
|
||||
value: true
|
||||
- name: DOTNET_VERSION
|
||||
value: 5.0.102
|
||||
- name: GraphicsControlsSln
|
||||
value: '**/GraphicsControls.Windows.sln'
|
||||
- name: GraphicsControlsLibraryProject
|
||||
value: '**/GraphicsControls.csproj'
|
|
@ -0,0 +1,117 @@
|
|||
if (IsMac)
|
||||
{
|
||||
System.Net.Http.HttpClient client = new System.Net.Http.HttpClient (new System.Net.Http.HttpClientHandler { AllowAutoRedirect = true });
|
||||
if (!Directory.Exists ("/Library/Frameworks/Mono.framework/Versions/Current/Commands/"))
|
||||
{
|
||||
Item ("Mono", "6.12.0.127")
|
||||
.Source (_ => "https://download.mono-project.com/archive/6.12.0/macos-10-universal/MonoFramework-MDK-6.12.0.107.macos10.xamarin.universal.pkg");
|
||||
}
|
||||
ForceJavaCleanup();
|
||||
OpenJDK ("1.8.0-40");
|
||||
|
||||
string releaseChannel = Environment.GetEnvironmentVariable ("CHANNEL");
|
||||
Console.WriteLine ("ANDROID_SDK_MAC: {0}", Environment.GetEnvironmentVariable ("ANDROID_SDK_MAC"));
|
||||
Console.WriteLine ("IOS_SDK_MAC: {0}", Environment.GetEnvironmentVariable ("IOS_SDK_MAC"));
|
||||
Console.WriteLine ("MONO_SDK_MAC: {0}", Environment.GetEnvironmentVariable ("MONO_SDK_MAC"));
|
||||
Console.WriteLine ("MAC_SDK_MAC: {0}", Environment.GetEnvironmentVariable ("MAC_SDK_MAC"));
|
||||
Console.WriteLine ("releaseChannel: {0}", releaseChannel);
|
||||
|
||||
bool specificSdkSet = false;
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("MONO_SDK_MAC")))
|
||||
{
|
||||
await ResolveUrl (Environment.GetEnvironmentVariable ("MONO_SDK_MAC"));
|
||||
specificSdkSet = true;
|
||||
}
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("ANDROID_SDK_MAC")))
|
||||
{
|
||||
await ResolveUrl (Environment.GetEnvironmentVariable ("ANDROID_SDK_MAC"));
|
||||
specificSdkSet = true;
|
||||
}
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("IOS_SDK_MAC")))
|
||||
{
|
||||
await ResolveUrl (Environment.GetEnvironmentVariable ("IOS_SDK_MAC"));
|
||||
specificSdkSet = true;
|
||||
}
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("MAC_SDK_MAC")))
|
||||
{
|
||||
await ResolveUrl (Environment.GetEnvironmentVariable ("MAC_SDK_MAC"));
|
||||
specificSdkSet = true;
|
||||
}
|
||||
|
||||
if(!specificSdkSet)
|
||||
{
|
||||
if(releaseChannel == "Beta")
|
||||
{
|
||||
Console.WriteLine ("Beta channel doesn't exist on provisionator");
|
||||
}
|
||||
else if(releaseChannel == "Preview")
|
||||
{
|
||||
XamarinChannel("Preview");
|
||||
}
|
||||
else if(releaseChannel == "Stable")
|
||||
{
|
||||
XamarinChannel("Stable");
|
||||
}
|
||||
}
|
||||
|
||||
async System.Threading.Tasks.Task ResolveUrl (string url)
|
||||
{
|
||||
// When downloading a package using the xamci we have to use the following code to
|
||||
// install updates otherwise provionator can't tell the difference between a new package or an old one
|
||||
try
|
||||
{
|
||||
using (var response = await client.GetAsync (url, System.Net.Http.HttpCompletionOption.ResponseHeadersRead)) {
|
||||
response.EnsureSuccessStatusCode ();
|
||||
Item(response.RequestMessage.RequestUri.ToString());
|
||||
}
|
||||
}
|
||||
catch{
|
||||
Item(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("ANDROID_SDK_WINDOWS")))
|
||||
Item ("Xamarin.Android")
|
||||
.Source (_ => Environment.GetEnvironmentVariable ("ANDROID_SDK_WINDOWS"));
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("IOS_SDK_WINDOWS")))
|
||||
Item ("Xamarin.iOS")
|
||||
.Source (_ => Environment.GetEnvironmentVariable ("IOS_SDK_WINDOWS"));
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("MONO_SDK_WINDOWS")))
|
||||
Item ("Mono")
|
||||
.Source (_ => Environment.GetEnvironmentVariable ("MONO_SDK_WINDOWS"));
|
||||
|
||||
if(!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable ("MAC_SDK_WINDOWS")))
|
||||
Item ("Xamarin.Mac")
|
||||
.Source (_ => Environment.GetEnvironmentVariable ("MAC_SDK_WINDOWS"));
|
||||
|
||||
}
|
||||
|
||||
string ANDROID_API_SDKS = Environment.GetEnvironmentVariable ("ANDROID_API_SDKS");
|
||||
|
||||
if(String.IsNullOrWhiteSpace(ANDROID_API_SDKS))
|
||||
{
|
||||
AndroidSdk()
|
||||
.ApiLevel((AndroidApiLevel)24)
|
||||
.ApiLevel((AndroidApiLevel)28)
|
||||
.ApiLevel((AndroidApiLevel)29)
|
||||
.ApiLevel((AndroidApiLevel)30)
|
||||
.SdkManagerPackage ("build-tools;29.0.3");
|
||||
}
|
||||
else{
|
||||
|
||||
var androidSDK = AndroidSdk();
|
||||
foreach(var sdk in ANDROID_API_SDKS.Split(','))
|
||||
{
|
||||
Console.WriteLine("Installing SDK: {0}", sdk);
|
||||
androidSDK = androidSDK.SdkManagerPackage (sdk);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
#r "_provisionator/provisionator.dll"
|
||||
|
||||
using static Xamarin.Provisioning.ProvisioningScript;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
var desiredXcode = Environment.GetEnvironmentVariable ("REQUIRED_XCODE");
|
||||
if (string.IsNullOrEmpty (desiredXcode)) {
|
||||
Console.WriteLine ("The environment variable 'REQUIRED_XCODE' must be exported and the value must be a valid value from the 'XreItem' enumeration.");
|
||||
return;
|
||||
}
|
||||
|
||||
desiredXcode = desiredXcode.Replace("Xcode_", "").Replace("_", ".");
|
||||
|
||||
Item item;
|
||||
|
||||
if(desiredXcode == "Latest")
|
||||
{
|
||||
item = XcodeBeta();
|
||||
|
||||
if(item.Version.StartsWith("12.0.0-beta."))
|
||||
{
|
||||
Console.WriteLine ("CheckInstalledDevOpsBetaXcodeAndSymlink");
|
||||
int expectedBeta = Convert.ToInt32(item.Version.Replace("12.0.0-beta.", ""));
|
||||
CheckInstalledDevOpsBetaXcodeAndSymlink("17200.1", expectedBeta: expectedBeta);
|
||||
}
|
||||
}
|
||||
else if (desiredXcode == "Stable")
|
||||
item = XcodeStable();
|
||||
else
|
||||
item = Xcode(desiredXcode);
|
||||
|
||||
Console.WriteLine ("InstallPath: {0}", item.Version);
|
||||
item.XcodeSelect ();
|
||||
|
||||
LogInstalledXcodes();
|
||||
|
||||
var appleSdkOverride = Path.Combine(Environment.GetFolderPath (Environment.SpecialFolder.Personal), "Library", "Preferences", "Xamarin", "Settings.plist");
|
||||
Item("Override Apple SDK Settings")
|
||||
.Condition(item => !File.Exists(appleSdkOverride) || GetSettingValue(appleSdkOverride, "AppleSdkRoot") != GetSelectedXcodePath())
|
||||
.Action (item => {
|
||||
DeleteSafe(appleSdkOverride);
|
||||
CreateSetting(appleSdkOverride, "AppleSdkRoot", GetSelectedXcodePath ());
|
||||
Console.WriteLine($"New VSMac iOS SDK Location: {GetSelectedXcodePath ()}");
|
||||
});
|
||||
|
||||
|
||||
|
||||
void DeleteSafe(string file)
|
||||
{
|
||||
if (File.Exists(file))
|
||||
File.Delete(file);
|
||||
}
|
||||
|
||||
void CreateSetting(string settingFile, string key, string value)
|
||||
{
|
||||
Exec("defaults", "write", settingFile, key, value);
|
||||
}
|
||||
|
||||
string GetSettingValue(string settingFile, string keyName)
|
||||
{
|
||||
return Exec("defaults", "read", settingFile, keyName).FirstOrDefault();
|
||||
}
|
||||
|
||||
bool CheckInstalledDevOpsBetaXcodeAndSymlink (string expectedBundleVersion, int expectedBeta)
|
||||
{
|
||||
var devOpsXcodeBetaPath = "/Applications/Xcode_12_beta.app";
|
||||
if (!Directory.Exists (devOpsXcodeBetaPath))
|
||||
return false;
|
||||
|
||||
var infoPlist = Plist (devOpsXcodeBetaPath);
|
||||
var bundleVersion = (string)infoPlist.CFBundleVersion;
|
||||
if (bundleVersion != expectedBundleVersion)
|
||||
return false;
|
||||
|
||||
if (RunningInCI) {
|
||||
SafeSymlink (devOpsXcodeBetaPath, $"/Applications/Xcode_12.0.0-beta{expectedBeta}.app");
|
||||
SafeSymlink (devOpsXcodeBetaPath, $"/Applications/Xcode_12_beta_{expectedBeta}.app");
|
||||
}
|
||||
|
||||
Console.WriteLine ($"CFBundleVersion found: {bundleVersion}");
|
||||
return true;
|
||||
}
|
||||
|
||||
void SafeSymlink (string source, string destination)
|
||||
{
|
||||
if (Directory.Exists (destination) || Config.DryRun)
|
||||
return;
|
||||
|
||||
Console.WriteLine ($"ln -sf {source} {destination}");
|
||||
Exec ("/bin/ln", "-sf", source, destination);
|
||||
Console.WriteLine ($"Symlink created: '{source}' links to '{destination}'");
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
@ -57,7 +57,6 @@
|
|||
<ItemGroup>
|
||||
<Compile Include="MainActivity.cs" />
|
||||
<Compile Include="Resources\Resource.designer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="MainApplication.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -108,5 +107,5 @@
|
|||
<Name>Compatibility.Android.FormsViewGroup</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
</Project>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
|
||||
</Project>
|
|
@ -1,30 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Android.App;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("GraphicsControls.Sample.Android")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("GraphicsControls.Sample.Android")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
||||
// Add some common permissions, these can be removed if not needed
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
|
||||
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -67,7 +67,6 @@
|
|||
<Compile Include="AppDelegate.cs" />
|
||||
<None Include="Entitlements.plist" />
|
||||
<None Include="Info.plist" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
|
||||
|
@ -138,10 +137,15 @@
|
|||
<ProjectReference Include="..\maui\src\Compatibility\Core\src\iOS\Compatibility.iOS.csproj">
|
||||
<Project>{271193C1-6E7C-429C-A36D-3F1BE5267231}</Project>
|
||||
<Name>Compatibility.iOS</Name>
|
||||
<IsAppExtension>false</IsAppExtension>
|
||||
<IsWatchApp>false</IsWatchApp>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\image.jpg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
</Project>
|
|
@ -1,36 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("GraphicsControls.Sample.iOS")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("GraphicsControls.Sample.iOS")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
Загрузка…
Ссылка в новой задаче