Update the version of Clang used to build for Tizen (#1386)

This commit is contained in:
Matthew Leibowitz 2020-07-07 19:15:40 +02:00 коммит произвёл GitHub
Родитель a52d731dcc
Коммит c908d6d71d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
20 изменённых файлов: 233 добавлений и 61 удалений

Просмотреть файл

@ -8,6 +8,7 @@ Xamarin.Forms release 4.5.0.725
Xamarin.Forms.Platform.WPF release 4.5.0.725
Xamarin.Forms.Platform.GTK release 4.5.0.725
Tizen.NET release 4.0.0
Tizen.NET.Sdk release 1.0.9
OpenTK release 3.0.1
OpenTK.GLControl release 3.0.1
MSBuild.Sdk.Extras release 2.0.54

Просмотреть файл

@ -1,4 +1,4 @@
<Project Sdk="Tizen.NET.Sdk/1.0.8">
<Project Sdk="Tizen.NET.Sdk/1.0.9">
<PropertyGroup>
<TargetFramework>tizen40</TargetFramework>
<RootNamespace>HarfBuzzSharp</RootNamespace>

Просмотреть файл

@ -1,4 +1,4 @@
<Project Sdk="Tizen.NET.Sdk/1.0.8">
<Project Sdk="Tizen.NET.Sdk/1.0.9">
<PropertyGroup>
<TargetFramework>tizen40</TargetFramework>
<RootNamespace>SkiaSharp</RootNamespace>

2
externals/skia поставляемый

@ -1 +1 @@
Subproject commit dce303a105cd8f03cd911bd0b6d662caa830e971
Subproject commit a4fcdc89ba367251aee69d1ccde5424ff230a00d

Просмотреть файл

@ -14,66 +14,61 @@ Task("libSkiaSharp")
.IsDependentOn("git-sync-deps")
.Does(() =>
{
Build("armel", "arm");
Build("i386", "x86");
Build("armel", "arm", "mobile-4.0-device.core");
Build("i386", "x86", "mobile-4.0-emulator.core");
void Build(string arch, string skiaArch)
void Build(string arch, string skiaArch, string rootstrap)
{
if (Skip(arch)) return;
//GnNinja($"tizen/{arch}", "skia",
// $"target_os='tizen' " +
// $"target_cpu='{skiaArch}' " +
// $"is_official_build=true " +
// $"skia_enable_gpu=true " +
// $"skia_enable_tools=false " +
// $"skia_use_icu=false " +
// $"skia_use_piex=true " +
// $"skia_use_sfntly=false " +
// $"skia_use_system_expat=false " +
// $"skia_use_system_freetype2=true " +
// $"skia_use_system_libjpeg_turbo=false " +
// $"skia_use_system_libpng=false " +
// $"skia_use_system_libwebp=false " +
// $"skia_use_system_zlib=true " +
// $"extra_cflags=[ '-DSKIA_C_DLL', '-DSK_BUILD_FOR_TIZEN', '-DXML_DEV_URANDOM' ] " +
// $"ncli='{TIZEN_STUDIO_HOME}' " +
// $"ncli_version='4.0'");
GnNinja($"tizen/{arch}", "skia",
$"target_os='tizen' " +
$"target_cpu='{skiaArch}' " +
$"is_official_build=true " +
$"skia_enable_gpu=true " +
$"skia_enable_tools=false " +
$"skia_use_icu=false " +
$"skia_use_piex=true " +
$"skia_use_sfntly=false " +
$"skia_use_system_expat=false " +
$"skia_use_system_freetype2=true " +
$"skia_use_system_libjpeg_turbo=false " +
$"skia_use_system_libpng=false " +
$"skia_use_system_libwebp=false " +
$"skia_use_system_zlib=true " +
$"extra_cflags=[ '-DSKIA_C_DLL', '-DSK_BUILD_FOR_TIZEN', '-DXML_DEV_URANDOM' ] " +
$"ncli='{TIZEN_STUDIO_HOME}' " +
$"ncli_version='4.0'");
//RunProcess(tizen, new ProcessSettings {
// Arguments = $"build-native -a {skiaArch} -c llvm -C {CONFIGURATION}" ,
// WorkingDirectory = MakeAbsolute((DirectoryPath)"libSkiaSharp").FullPath,
//});
RunProcess(tizen, new ProcessSettings {
Arguments = $"build-native -a {skiaArch} -c llvm -C {CONFIGURATION} -r {rootstrap}" ,
WorkingDirectory = MakeAbsolute((DirectoryPath)"libSkiaSharp").FullPath,
});
var outDir = OUTPUT_PATH.Combine(arch);
EnsureDirectoryExists(outDir);
// CopyFile($"libSkiaSharp/{CONFIGURATION}/libskiasharp.so", outDir.CombineWithFilePath("libSkiaSharp.so"));
FileWriteText(outDir.CombineWithFilePath("libSkiaSharp.so"), "");
CopyFile($"libSkiaSharp/{CONFIGURATION}/libskiasharp.so", outDir.CombineWithFilePath("libSkiaSharp.so"));
}
});
Task("libHarfBuzzSharp")
.Does(() =>
{
var cmd = IsRunningOnWindows() ? ".cmd" : "";
var ndkbuild = TIZEN_STUDIO_HOME.CombineWithFilePath($"ndk-build{cmd}").FullPath;
Build("armel", "arm", "mobile-4.0-device.core");
Build("i386", "x86", "mobile-4.0-emulator.core");
Build("armel", "arm");
Build("i386", "x86");
void Build(string arch, string cliArch)
void Build(string arch, string cliArch, string rootstrap)
{
if (Skip(arch)) return;
// RunProcess(tizen, new ProcessSettings {
// Arguments = $"build-native -a {cliArch} -c llvm -C {CONFIGURATION}",
// WorkingDirectory = MakeAbsolute((DirectoryPath)"libHarfBuzzSharp").FullPath,
// });
RunProcess(tizen, new ProcessSettings {
Arguments = $"build-native -a {cliArch} -c llvm -C {CONFIGURATION} -r {rootstrap}" ,
WorkingDirectory = MakeAbsolute((DirectoryPath)"libHarfBuzzSharp").FullPath,
});
var outDir = OUTPUT_PATH.Combine(arch);
EnsureDirectoryExists(outDir);
// CopyFile($"libHarfBuzzSharp/{CONFIGURATION}/libharfbuzzsharp.so", outDir.CombineWithFilePath("libHarfBuzzSharp.so"));
FileWriteText(outDir.CombineWithFilePath("libHarfBuzzSharp.so"), "");
CopyFile($"libHarfBuzzSharp/{CONFIGURATION}/libharfbuzzsharp.so", outDir.CombineWithFilePath("libHarfBuzzSharp.so"));
}
});

Просмотреть файл

@ -1,4 +1,4 @@
<Project Sdk="Tizen.NET.Sdk/1.0.8">
<Project Sdk="Tizen.NET.Sdk/1.0.9">
<PropertyGroup>
<TargetFramework>tizen40</TargetFramework>

Просмотреть файл

@ -1,4 +1,4 @@
<Project Sdk="Tizen.NET.Sdk/1.0.8">
<Project Sdk="Tizen.NET.Sdk/1.0.9">
<PropertyGroup>
<TargetFramework>tizen40</TargetFramework>

Просмотреть файл

@ -1,4 +1,4 @@
<Project Sdk="Tizen.NET.Sdk/1.0.8">
<Project Sdk="Tizen.NET.Sdk/1.0.9">
<PropertyGroup>
<TargetFramework>tizen40</TargetFramework>

Просмотреть файл

@ -1,4 +1,4 @@
<Project Sdk="Tizen.NET.Sdk/1.0.8">
<Project Sdk="Tizen.NET.Sdk/1.0.9">
<PropertyGroup>
<TargetFramework>tizen40</TargetFramework>

Просмотреть файл

@ -66,6 +66,7 @@ stages:
vmImage: $(VM_IMAGE_WINDOWS)
target: externals-android
additionalArgs: --buildarch=x86
installWindowsSdk: false
- template: azure-templates-bootstrapper.yml # Build Native Android|x64 (Win)
parameters:
name: native_android_x64_windows
@ -73,6 +74,7 @@ stages:
vmImage: $(VM_IMAGE_WINDOWS)
target: externals-android
additionalArgs: --buildarch=x64
installWindowsSdk: false
- template: azure-templates-bootstrapper.yml # Build Native Android|arm (Win)
parameters:
name: native_android_arm_windows
@ -80,6 +82,7 @@ stages:
vmImage: $(VM_IMAGE_WINDOWS)
target: externals-android
additionalArgs: --buildarch=arm
installWindowsSdk: false
- template: azure-templates-bootstrapper.yml # Build Native Android|arm64 (Win)
parameters:
name: native_android_arm64_windows
@ -87,12 +90,25 @@ stages:
vmImage: $(VM_IMAGE_WINDOWS)
target: externals-android
additionalArgs: --buildarch=arm64
installWindowsSdk: false
- template: azure-templates-bootstrapper.yml # Build Native Tizen (Win)
parameters:
name: native_tizen_windows
displayName: Tizen
vmImage: $(VM_IMAGE_WINDOWS)
target: externals-tizen
installTizenSdk: false
installWindowsSdk: false
preBuildSteps:
- pwsh: |
echo "Downloading Tizen Studio..."
New-Item "$env:USERPROFILE\tizen-download-temp" -Type Directory -Force | Out-Null
curl -L -o "$env:USERPROFILE\tizen-download-temp\tizen-studio.zip" -H "Authorization: $(TIZEN_STUDIO_TOKEN)" "$(TIZEN_STUDIO_URL)"
echo "Download complete, extracting..."
Expand-Archive -Path "$env:USERPROFILE\tizen-download-temp\tizen-studio.zip" -DestinationPath "$env:USERPROFILE"
echo "TIZEN_SDK_INSTALLED_PATH=$env:USERPROFILE\tizen-studio`nTIZEN_SDK_DATA_PATH=$env:USERPROFILE\tizen-studio-data" > "$env:USERPROFILE\tizen-studio\sdk.info"
echo "Extraction complete."
displayName: Download Tizen Studio Patch
- template: azure-templates-bootstrapper.yml # Build ANGLE UWP|x86 (Win)
parameters:
name: native_uwp_angle_x86_windows
@ -285,6 +301,7 @@ stages:
vmImage: $(VM_IMAGE_LINUX)
packages: $(TIZEN_LINUX_PACKAGES)
target: externals-tizen
condition: false # TODO: TIZEN INSTALL BUGS
- stage: native_wasm
displayName: Native WASM
@ -347,7 +364,7 @@ stages:
- native_ios_macos
- native_macos_macos
# - native_tizen_macos
- native_tizen_linux
- native_tizen_windows
- native_tvos_macos
- native_watchos_macos
- template: azure-templates-bootstrapper.yml # Build Managed (Linux)
@ -367,7 +384,8 @@ stages:
- native_linux_arm64_nodeps_linux
- native_linux_x64_alpine_linux
- native_linux_x64_alpine_nodeps_linux
- native_tizen_linux
# - native_tizen_linux
- native_tizen_windows
- stage: package
displayName: Package NuGets
@ -380,6 +398,7 @@ stages:
vmImage: $(VM_IMAGE_WINDOWS)
target: nuget
additionalArgs: --packall=true --exclusive
installWindowsSdk: false
shouldPublish: true
requiredArtifacts:
- managed_linux
@ -408,6 +427,7 @@ stages:
vmImage: Hosted VS2017
target: docs-api-diff
additionalArgs: --nugetDiffPrerelease=$(NUGET_DIFF_PRERELEASE)
installWindowsSdk: false
shouldPublish: false
requiredArtifacts:
- package_windows
@ -452,6 +472,7 @@ stages:
vmImage: $(VM_IMAGE_WINDOWS)
target: tests
additionalArgs: --skipExternals="all" --throwOnTestFailure=$(THROW_ON_TEST_FAILURE) --coverage=$(ENABLE_CODE_COVERAGE)
installWindowsSdk: false
shouldPublish: false
requiredArtifacts:
- native_win32_x86_windows
@ -612,6 +633,7 @@ stages:
displayName: Windows
vmImage: $(VM_IMAGE_WINDOWS)
target: samples
installWindowsSdk: false
shouldPublish: false
requiredArtifacts:
- nuget
@ -684,6 +706,7 @@ stages:
# condition: and(always(), eq('refs/heads/master', variables['Build.SourceBranch']))
vmImage: Hosted VS2017
target: git-sync-deps
installWindowsSdk: false
shouldPublish: false
postBuildSteps:
- task: CredScan@2

Просмотреть файл

@ -19,6 +19,10 @@ parameters:
verbosity: $(VERBOSITY) # the level of verbosity to use when building
docker: '' # the Docker image to build and use
dockerArgs: '' # any additional arguments to pass to docker build
installAndroidNdk: true # whether or not to install the Android NDK
installTizenSdk: true # whether or not to install the Tizen SDK
installWindowsSdk: true # whether or not to install the Windows SDK
installLlvm: true # whether or not to install the LLVM compiler
jobs:
# - ${{ if and(ne(parameters.buildExternals, ''), startsWith(parameters.name, 'native_')) }}:
@ -79,15 +83,15 @@ jobs:
architecture: 'x64'
- ${{ if not(contains(parameters.name, '_checks_')) }}:
# install android ndk
- ${{ if contains(parameters.name, '_android_') }}:
- ${{ if and(eq(parameters.installAndroidNdk, 'true'), contains(parameters.name, '_android_')) }}:
- pwsh: .\scripts\install-android-ndk.ps1
displayName: Install the Android NDK
# install tizen
- ${{ if contains(parameters.name, '_tizen_') }}:
- ${{ if and(eq(parameters.installTizenSdk, 'true'), contains(parameters.name, '_tizen_')) }}:
- pwsh: .\scripts\install-tizen.ps1
displayName: Install the Tizen SDK
# install llvm
- ${{ if contains(parameters.name, '_win32_') }}:
- ${{ if and(eq(parameters.installLlvm, 'true'), contains(parameters.name, '_win32_')) }}:
- pwsh: .\scripts\install-llvm.ps1
displayName: Install LLVM
@ -109,7 +113,7 @@ jobs:
- ${{ if endsWith(parameters.name, '_windows') }}:
- ${{ if not(contains(parameters.name, '_checks_')) }}:
# install the older Windows SDKs
- ${{ if or(startsWith(parameters.name, 'native_'), startsWith(parameters.name, 'managed_')) }}:
- ${{ if eq(parameters.installWindowsSdk, 'true') }}:
- pwsh: |
$uri = 'https://go.microsoft.com/fwlink/p/?LinkId=619296'
.\scripts\download-file.ps1 -Uri $uri -OutFile sdksetup.exe

Просмотреть файл

@ -4,8 +4,11 @@ Param(
)
$ErrorActionPreference = 'Stop'
Add-Type -AssemblyName System.IO.Compression.FileSystem
$HOME_DIR = if ($env:HOME) { $env:HOME } else { $env:USERPROFILE }
if ($IsMacOS) {
$platform = "darwin-x86_64"
} elseif ($IsLinux) {
@ -16,13 +19,13 @@ if ($IsMacOS) {
$url = "https://dl.google.com/android/repository/android-ndk-${Version}-${platform}.zip"
$ndk = "$HOME/android-ndk"
$ndk = "$HOME_DIR/android-ndk"
if ($InstallDestination) {
$ndk = $InstallDestination
}
Write-Host "Install destination is '$ndk'..."
$ndkTemp = "$HOME/android-ndk-temp"
$ndkTemp = "$HOME_DIR/android-ndk-temp"
$install = "$ndkTemp/android-ndk.zip"
# download

Просмотреть файл

@ -4,9 +4,11 @@ Param(
$ErrorActionPreference = 'Stop'
$HOME_DIR = if ($env:HOME) { $env:HOME } else { $env:USERPROFILE }
$url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${Version}/LLVM-${Version}-win64.exe"
$llvmTemp = "$HOME/llvm-temp"
$llvmTemp = "$HOME_DIR/llvm-temp"
$install = "$llvmTemp/llvm.exe"
# download

Просмотреть файл

@ -6,6 +6,8 @@ $ErrorActionPreference = 'Stop'
Add-Type -AssemblyName System.IO.Compression.FileSystem
$HOME_DIR = if ($env:HOME) { $env:HOME } else { $env:USERPROFILE }
$version = "13.0.2"
if ($IsMacOS) {
$ext = "tar.gz"
@ -18,13 +20,13 @@ if ($IsMacOS) {
$url = "https://download.java.net/java/GA/jdk13.0.2/d4173c853231432d94f001e99d882ca7/8/GPL/openjdk-13.0.2_windows-x64_bin.zip"
}
$jdk = Join-Path "$HOME" "openjdk"
$jdk = Join-Path "$HOME_DIR" "openjdk"
if ($InstallDestination) {
$jdk = $InstallDestination
}
Write-Host "Install destination is '$jdk'..."
$jdkTemp = Join-Path "$HOME" "openjdk-temp"
$jdkTemp = Join-Path "$HOME_DIR" "openjdk-temp"
$archive = Join-Path "$jdkTemp" "openjdk.$ext"
# download

Просмотреть файл

@ -0,0 +1,48 @@
$ErrorActionPreference = 'Stop'
New-Item -ItemType Directory "C:\tizen-data" -Force | Out-Null
# install OpenJDK
$jdkUri = "https://download.java.net/java/GA/jdk13.0.2/d4173c853231432d94f001e99d882ca7/8/GPL/openjdk-13.0.2_windows-x64_bin.zip"
$zip = "C:\tizen-data\openjdk.zip"
$jdk = "C:\openjdk"
if (!(Test-Path $zip)) {
Invoke-WebRequest -Uri $jdkUri -OutFile $zip
}
if (!(Test-Path $jdk)) {
Expand-Archive -Path $zip -DestinationPath $jdk
}
$env:JAVA_HOME = "$jdk\jdk-13.0.2"
$env:PATH = "$env:JAVA_HOME\bin;$env:PATH"
# install Tizen
$tizenUri = "http://download.tizen.org/sdk/Installer/tizen-studio_3.7/web-cli_Tizen_Studio_3.7_windows-64.exe"
$installer = "C:\tizen-data\installer.exe"
$ts = "${env:USERPROFILE}\tizen-studio"
$pm = "$ts\package-manager\package-manager-cli.exe"
if (!(Test-Path $installer)) {
Invoke-WebRequest -Uri $tizenUri -OutFile $installer
}
if (!(Test-Path $ts)) {
& $installer --accept-license --no-java-check $ts
}
# & $pm install --no-java-check --accept-license --file "C:\tizen-data\packages.zip" --remove-installed-sdk `
#"MOBILE-6.0-NativeAppDevelopment,WEARABLE-6.0-NativeAppDevelopment,MOBILE-4.0-NativeAppDevelopment,WEARABLE-4.0-NativeAppDevelopment,NativeToolchain-Gcc-6.2,NativeToolchain-Gcc-9.2"
# modify internal files
$plugins = "C:\Users\AzureUser\tizen-studio\tools\smart-build-interface\plugins"
Copy-Item -Path "$plugins\llvm10.i586.core.app.xml" -Destination "$plugins\llvm10.i386.core.app.xml" -Force
[xml] $xml = (Get-Content -Path "$plugins\llvm10.i386.core.app.xml")
$xml.extension.toolchain.id = $xml.extension.toolchain.id.Replace("i586", "i386")
$xml.extension.toolchain.architecture = "i386"
$xml.Save("$plugins\llvm10.i386.core.app.xml")
exit $LASTEXITCODE

Просмотреть файл

@ -9,6 +9,8 @@ Param(
$ErrorActionPreference = 'Stop'
$HOME_DIR = if ($env:HOME) { $env:HOME } else { $env:USERPROFILE }
if ($IsMacOS) {
$platform = "macos-64"
$ext = "bin"
@ -22,13 +24,13 @@ if ($IsMacOS) {
$url = "http://download.tizen.org/sdk/Installer/tizen-studio_${Version}/web-cli_Tizen_Studio_${Version}_${platform}.${ext}"
$ts = Join-Path "$HOME" "tizen-studio"
$ts = Join-Path "$HOME_DIR" "tizen-studio"
if ($InstallDestination) {
$ts = $InstallDestination
}
Write-Host "Install destination is '$ts'..."
$tsTemp = Join-Path "$HOME" "tizen-temp"
$tsTemp = Join-Path "$HOME_DIR" "tizen-temp"
$install = Join-Path "$tsTemp" "tizen-install.$ext"
$packages = "MOBILE-4.0,MOBILE-4.0-NativeAppDevelopment"

31
scripts/merge-files.ps1 Normal file
Просмотреть файл

@ -0,0 +1,31 @@
Param(
[string] $Path
)
$ErrorActionPreference = 'Stop'
if ((!$Path) -or ($Path -eq "")) {
Write-Error "Target filename missing."
exit 1
}
$fileList = @($INPUT)
if ($fileList.Count -eq 0) {
Write-Error "Source files missing."
exit 1
}
$destFile = [System.IO.File]::Create($Path)
$fileList | ForEach-Object {
Write-Host "Appending $_ to $Path..."
$sourceFile = [System.IO.File]::OpenRead($_)
$sourceFile.CopyTo($destFile)
$sourceFile.Close()
}
$destFile.Close()
Write-Host "Merge complete."
exit $LASTEXITCODE

61
scripts/split-file.ps1 Normal file
Просмотреть файл

@ -0,0 +1,61 @@
Param(
[string] $Path,
[long] $ChunkSize = 1GB
)
$ErrorActionPreference = 'Stop'
if ($ChunkSize -le 0) {
Write-Error "Only positive sizes allowed"
exit 1
}
Write-Host "Splitting file $Path to parts of $ChunkSize byte size..."
[long] $bufferSize = 100MB
if ($bufferSize -gt $ChunkSize) {
$bufferSize = $ChunkSize
}
$buffer = New-Object byte[] $bufferSize
$sourceFile = [System.IO.File]::OpenRead($Path)
$sourceReader = New-Object System.IO.BinaryReader($sourceFile)
[int] $index = 1
do {
$filename = "$Path." + $index.ToString("000")
Write-Host "Writing $filename..."
$destFile = [System.IO.File]::Create($filename)
$destWriter = New-Object System.IO.BinaryWriter($destFile)
[long] $sizeSoFar = 0
[long] $bytesRead = 0
while ($sizeSoFar -lt $ChunkSize) {
[long] $sizeToRead = $ChunkSize - $sizeSoFar
if ($sizeToRead -gt $bufferSize) {
$sizeToRead = $bufferSize
}
Write-Verbose "Reading $sizeToRead bytes..."
$bytesRead = $sourceReader.Read($buffer, 0, $buffer.Length)
Write-Verbose "Read $bytesRead bytes."
if ($bytesRead -le 0) {
break;
}
$sizeSoFar += $bytesRead
$destWriter.Write($buffer, 0, $bytesRead)
}
$destWriter.Close()
$destFile.Close()
Write-Verbose "Wrote $bytesSoFar bytes to $filename."
$index++
} while ($bytesRead -gt 0)
$sourceReader.Close()
$sourceFile.Close()
Write-Host "Split complete."
exit $LASTEXITCODE

Просмотреть файл

@ -1,4 +1,4 @@
<Project Sdk="Tizen.NET.Sdk/1.0.8">
<Project Sdk="Tizen.NET.Sdk/1.0.9">
<PropertyGroup>
<TargetFramework>tizen40</TargetFramework>
<RootNamespace>SkiaSharp.Views.Forms</RootNamespace>

Просмотреть файл

@ -1,4 +1,4 @@
<Project Sdk="Tizen.NET.Sdk/1.0.8">
<Project Sdk="Tizen.NET.Sdk/1.0.9">
<PropertyGroup>
<TargetFramework>tizen40</TargetFramework>
<RootNamespace>SkiaSharp.Views.Tizen</RootNamespace>