Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build from source fix #2017

Merged
merged 11 commits into from
May 16, 2019
20 changes: 13 additions & 7 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,18 @@ function restore_package()
log "restore_package: Start restoring packages to $TP_PACKAGES_DIR."
local start=$SECONDS

log ".. .. Restore: Source: $TP_ROOT_DIR/src/package/external/external.csproj"
$dotnet restore $TP_ROOT_DIR/src/package/external/external.csproj --packages $TP_PACKAGES_DIR -v:minimal -warnaserror -p:Version=$TPB_Version || failed=true
if [ "$failed" = true ]; then
error "Failed to restore packages."
return 2
fi
if [[ $TP_USE_REPO_API = 0 ]]; then
log ".. .. Restore: Source: $TP_ROOT_DIR/src/package/external/external.csproj"
$dotnet restore $TP_ROOT_DIR/src/package/external/external.csproj --packages $TP_PACKAGES_DIR -v:minimal -warnaserror -p:Version=$TPB_Version || failed=true
else
log ".. .. Restore: Source: $TP_ROOT_DIR/src/package/external/external_BuildFromSource.csproj"
$dotnet restore $TP_ROOT_DIR/src/package/external/external.csproj --packages $TP_PACKAGES_DIR -v:minimal -warnaserror -p:Version=$TPB_Version -p:DotNetBuildFromSource=true || failed=true
fi

if [ "$failed" = true ]; then
error "Failed to restore packages."
return 2
fi

log "restore_package: Complete. Elapsed $(( SECONDS - start ))s."
}
Expand All @@ -244,7 +250,7 @@ function invoke_build()
if [[ $TP_USE_REPO_API = 0 ]]; then
$dotnet build $TPB_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild || failed=true
else
$dotnet build $TPB_Build_From_Source_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild || failed=true
$dotnet build $TPB_Build_From_Source_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild -p:DotNetBuildFromSource=true || failed=true
fi
else
find . -name "$PROJECT_NAME_PATTERNS" | xargs -L 1 $dotnet build --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild
Expand Down
18 changes: 10 additions & 8 deletions src/package/external/external.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
<CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition=" '$(DotNetBuildFromSource)' != 'true' ">
<!-- This csproj restore external tools required for build process -->
<PackageReference Include="NuGet.CommandLine">
<Version>3.4.3</Version>
Expand All @@ -49,13 +49,6 @@
<Version>1.1.0-beta1-62316-01</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<!-- Required for resolution of desktop dependencies in non windows environment.
We've to set to net46 since the net451 and other packages have assemblies in wrong case.
E.g. System.XML instead of System.Xml. -->
<PackageReference Include="Microsoft.TargetingPack.NETFramework.v4.6">
<Version>1.0.1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Internal.TestPlatform.Extensions">
<Version>$(TestPlatformExternalsVersion)</Version>
<PrivateAssets>All</PrivateAssets>
Expand Down Expand Up @@ -88,6 +81,15 @@
<Version>15.6.815-master284DF69C</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<!-- Required for resolution of desktop dependencies in non windows environment.
We've to set to net46 since the net451 and other packages have assemblies in wrong case.
E.g. System.XML instead of System.Xml. -->
<PackageReference Include="Microsoft.TargetingPack.NETFramework.v4.6">
<Version>1.0.1</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down