From 64b893b1be6906ec095b1a10d421282c5d499670 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Fri, 16 Apr 2021 19:17:20 -0700 Subject: [PATCH] windows: install Visual Studios properly for flutter --- windows/Dockerfile | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/windows/Dockerfile b/windows/Dockerfile index 4d61f5a..abc2540 100644 --- a/windows/Dockerfile +++ b/windows/Dockerfile @@ -1,29 +1,31 @@ FROM cirrusci/android-sdk:30-windowsservercore-2019 # Install VS -# https://docs.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2019 +## https://docs.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2019 -# Restore the default Windows shell for correct batch processing. +## Restore the default Windows shell for correct batch processing. SHELL ["cmd", "/S", "/C"] -# Download the Build Tools bootstrapper. -ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:/TEMP/vs_buildtools.exe +## Download the Build Tools bootstrapper. +ADD https://aka.ms/vs/16/release/channel C:/TEMP/VisualStudio.chman -# Install Build Tools with the Microsoft.VisualStudio.Workload.AzureBuildTools workload, excluding workloads and components with known issues. -RUN C:/TEMP/vs_buildtools.exe --quiet --wait --norestart --nocache \ - --installPath BuildTools \ - --add Microsoft.VisualStudio.Workload.AzureBuildTools \ - --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 \ - --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 \ - --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 \ - --remove Microsoft.VisualStudio.Component.Windows81SDK \ - || IF "%ERRORLEVEL%"=="3010" EXIT 0 +ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:/TEMP/vs_buildtools.exe +## https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2019 +RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache \ + --channelUri C:\TEMP\VisualStudio.chman \ + --installChannelUri C:\TEMP\VisualStudio.chman \ + --add Microsoft.VisualStudio.Component.Windows10SDK.19041 \ + --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ + --add Microsoft.VisualStudio.Component.VC.CMake.Project \ + --add Microsoft.VisualStudio.Workload.NativeDesktop \ + --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools \ + --add Microsoft.VisualStudio.Workload.VCTools \ + --add Microsoft.VisualStudio.Component.VC.CLI.Support \ + --installPath C:\BuildTools \ + || IF "%ERRORLEVEL%"=="3010" EXIT 0 # Install Flutter -# ADD https://storage.googleapis.com/flutter_infra/releases/stable/windows/flutter_windows_2.0.4-stable.zip C:/TEMP/flutter.zip -# RUN powershell -Command "expand-archive -Path 'C:\TEMP\flutter.zip' -DestinationPath 'c:\'" - RUN setx path "%path%;C:\flutter\bin;C:\flutter\bin\cache\dart-sdk\bin;" RUN git clone --branch dev https://github.com/flutter/flutter.git C:\flutter @@ -32,7 +34,7 @@ RUN flutter config --no-analytics RUN flutter config --enable-windows-desktop -# Fix android sdk licenses (missing) +## Fix android sdk licenses (missing in cirruslabs container) RUN powershell.exe -Command \ Set-Content -Value "`n859f317696f67ef3d7f30a50a5560e7834b43903" -Path C:\Android\licenses\android-sdk-arm-dbt-license