Skip to content

Commit

Permalink
Building non-Windows builds using the CLI's MSBuild (dotnet#2533)
Browse files Browse the repository at this point in the history
* Building non-Windows builds using the CLI's MSBuild

* Fixing svcutil issue on non-Windows
  • Loading branch information
joperezr authored Feb 1, 2018
1 parent 4f6966c commit 9962f41
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 27 deletions.
2 changes: 1 addition & 1 deletion BuildToolsVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.0-prerelease-02427-01
2.1.0-preview2-02431-05
2 changes: 1 addition & 1 deletion DotnetCLIVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0-preview1-005977
2.1.2
4 changes: 2 additions & 2 deletions dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<StandardCurrentRef>9a7b364b261add4b1e7793c596f8fcd89484c68b</StandardCurrentRef>
<ProjectNTfsCurrentRef>9a7b364b261add4b1e7793c596f8fcd89484c68b</ProjectNTfsCurrentRef>
<ProjectNTfsTestILCCurrentRef>9a7b364b261add4b1e7793c596f8fcd89484c68b</ProjectNTfsTestILCCurrentRef>
<BuildToolsCurrentRef>b59e9333b8a600304b8a457443331a90cf4e5c16</BuildToolsCurrentRef>
<BuildToolsCurrentRef>fb8aaa87581eafdad52a1997540471169cf1b6bb</BuildToolsCurrentRef>
<CoreClrCurrentRef>9a7b364b261add4b1e7793c596f8fcd89484c68b</CoreClrCurrentRef>
</PropertyGroup>

Expand Down Expand Up @@ -53,7 +53,7 @@
<!-- Package versions used as toolsets -->
<PropertyGroup>
<FeedTasksPackage>Microsoft.DotNet.Build.Tasks.Feed</FeedTasksPackage>
<FeedTasksPackageVersion>2.1.0-prerelease-02427-01</FeedTasksPackageVersion>
<FeedTasksPackageVersion>2.1.0-preview2-02431-05</FeedTasksPackageVersion>
</PropertyGroup>

<!-- Package dependency verification/auto-upgrade configuration. -->
Expand Down
1 change: 1 addition & 0 deletions external/runtime/runtime.depproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<NugetRuntimeIdentifier Condition="'$(TargetGroup)' == 'uap'">win10-$(ArchGroup)</NugetRuntimeIdentifier>
<NugetRuntimeIdentifier Condition="'$(TargetGroup)' == 'uapaot'">win10-$(ArchGroup)-aot</NugetRuntimeIdentifier>
<RidSpecificAssets>true</RidSpecificAssets>
<NoWarn>$(NoWarn);NU1603;NU1605</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetGroup)' == 'uapaot'">
Expand Down
1 change: 1 addition & 0 deletions external/test-runtime/XUnit.Runtime.depproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<NuGetTargetMonikerShort Condition="'$(TargetGroup)' == 'uapaot'">netstandard2.0</NuGetTargetMonikerShort>
<NuGetTargetMoniker Condition="'$(TargetGroup)' == 'uap'">.NETStandard,Version=v2.0</NuGetTargetMoniker>
<NuGetTargetMonikerShort Condition="'$(TargetGroup)' == 'uap'">netstandard2.0</NuGetTargetMonikerShort>
<NoWarn>$(NoWarn);NU1603</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit.console.netcore">
Expand Down
4 changes: 2 additions & 2 deletions init-tools.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if exist "%DOTNET_CMD%" goto :afterdotnetrestore

echo Installing dotnet cli...
if NOT exist "%DOTNET_PATH%" mkdir "%DOTNET_PATH%"
set DOTNET_ZIP_NAME=dotnet-dev-win-x64.%DOTNET_VERSION%.zip
set DOTNET_ZIP_NAME=dotnet-sdk-%DOTNET_VERSION%-win-x64.zip
set DOTNET_REMOTE_PATH=https://dotnetcli.azureedge.net/dotnet/Sdk/%DOTNET_VERSION%/%DOTNET_ZIP_NAME%
set DOTNET_LOCAL_PATH=%DOTNET_PATH%%DOTNET_ZIP_NAME%
echo Installing '%DOTNET_REMOTE_PATH%' to '%DOTNET_LOCAL_PATH%' >> "%INIT_TOOLS_LOG%"
Expand Down Expand Up @@ -68,4 +68,4 @@ if not [%INIT_TOOLS_ERRORLEVEL%]==[0] (
:: Create sempahore file
echo Done initializing tools.
echo Init-Tools.cmd completed for BuildTools Version: %BUILDTOOLS_VERSION% > "%BUILD_TOOLS_SEMAPHORE%"
exit /b 0
exit /b 0
12 changes: 6 additions & 6 deletions init-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ OSName=$(uname -s)
case $OSName in
Darwin)
OS=OSX
__DOTNET_PKG=dotnet-dev-osx-x64
__DOTNET_PKG=dotnet-sdk-${__DOTNET_TOOLS_VERSION}-osx-x64
ulimit -n 2048
# Format x.y.z as single integer with three digits for each part
VERSION=`sw_vers -productVersion| sed -e 's/\./ /g' | xargs printf "%03d%03d%03d"`
Expand All @@ -34,14 +34,14 @@ OSName=$(uname -s)
;;

Linux)
__DOTNET_PKG=dotnet-dev-linux-x64
__DOTNET_PKG=dotnet-sdk-${__DOTNET_TOOLS_VERSION}-linux-x64
OS=Linux
;;

*)
echo "Unsupported OS '$OSName' detected. Downloading linux-x64 tools."
OS=Linux
__DOTNET_PKG=dotnet-dev-linux-x64
__DOTNET_PKG=dotnet-sdk-${__DOTNET_TOOLS_VERSION}-linux-x64
;;
esac
fi
Expand All @@ -64,7 +64,7 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then
cp -r $DOTNET_TOOL_DIR/* $__DOTNET_PATH
else
echo "Installing dotnet cli..."
__DOTNET_LOCATION="https://dotnetcli.azureedge.net/dotnet/Sdk/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.${__DOTNET_TOOLS_VERSION}.tar.gz"
__DOTNET_LOCATION="https://dotnetcli.azureedge.net/dotnet/Sdk/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.tar.gz"
# curl has HTTPS CA trust-issues less often than wget, so lets try that first.
echo "Installing '${__DOTNET_LOCATION}' to '$__DOTNET_PATH/dotnet.tar'" >> $__init_tools_log
which curl > /dev/null 2> /dev/null
Expand Down Expand Up @@ -98,11 +98,11 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then
fi

echo "Initializing BuildTools..."
echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR" >> $__init_tools_log
echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR $__PACKAGES_DIR" >> $__init_tools_log

# Executables restored with .NET Core 2.0 do not have executable permission flags. https://github.com/NuGet/Home/issues/4424
chmod +x $__BUILD_TOOLS_PATH/init-tools.sh
$__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR >> $__init_tools_log
$__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR $__PACKAGES_DIR >> $__init_tools_log
if [ "$?" != "0" ]; then
echo "ERROR: An error occured when trying to initialize the tools. Please check '$__init_tools_log' for more details."1>&2
exit 1
Expand Down
3 changes: 2 additions & 1 deletion src/GenerateDepsJson.targets
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
</PropertyGroup>

<GenerateDepsJson DepsJsonPath="$(_OriginalDepsJsonPath)"
GenerateNewDepsJson="true"
RuntimeDirectory="$(NETCoreAppTestSharedFrameworkPath)"
DepsExceptions="@(ExceptionForDepsJson)"
OutputPath="$(_OutputTestSharedFrameworkDepsPath)"/>
</Target>
</Project>
</Project>
15 changes: 1 addition & 14 deletions src/svcutilcore/tests/svcutilcore.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</PropertyGroup>
<Exec Command="$(GeneratorCliPath)dotnet $(CorrectedOutputPath)dotnet-svcutilcore.dll /t:xmlserializer $(CorrectedOutputPath)$(InputAssembly).dll /out:$(CorrectedOutputPath)$(SerializerName).cs" />
<Warning Condition="Exists('$(CorrectedOutputPath)$(SerializerName).cs') != 'true'" Text="Fail to generate $(CorrectedOutputPath)$(SerializerName).cs"/>
<Csc Condition="Exists('$(CorrectedOutputPath)$(SerializerName).cs') == 'true' AND '$(MSBuildRuntimeType)' != 'core'"
<Csc Condition="Exists('$(CorrectedOutputPath)$(SerializerName).cs') == 'true'"
OutputAssembly="$(CorrectedOutputPath)$(SerializerName).dll"
References="@(ReferencePath);@(IntermediateAssembly)"
EmitDebugInformation="$(DebugSymbols)"
Expand All @@ -93,19 +93,6 @@
ToolPath="$(CscToolPath)"
DisabledWarnings="$(NoWarn), 219"
UseSharedCompilation="true" />
<!-- when building on core CSC requires the OverrideToolHost parameter, but this is not supported by desktop csc -->
<Csc Condition="Exists('$(CorrectedOutputPath)$(SerializerName).cs') == 'true' AND '$(MSBuildRuntimeType)' == 'core'"
OutputAssembly="$(CorrectedOutputPath)$(SerializerName).dll"
References="@(ReferencePath);@(IntermediateAssembly)"
EmitDebugInformation="$(DebugSymbols)"
DebugType="$(DebugType)"
Sources="$(CorrectedOutputPath)$(SerializerName).cs"
TargetType="Library"
ToolExe="$(CscToolExe)"
ToolPath="$(CscToolPath)"
OverrideToolHost="$(OverrideToolHost)"
DisabledWarnings="$(NoWarn), 219"
UseSharedCompilation="true" />
<Warning Condition="Exists('$(CorrectedOutputPath)$(SerializerName).dll') != 'true'" Text="Fail to generate $(CorrectedOutputPath)$(SerializerName).dll"/>

<ItemGroup>
Expand Down

0 comments on commit 9962f41

Please sign in to comment.