Skip to content

Commit

Permalink
Removing build tools outside of branches (#3780)
Browse files Browse the repository at this point in the history
* Moving old files which are not used anymore to legacy directory

* Separate build tools from branch. Moving forward build tools will be downloaded from a central location, this helps in propogating build changes to any branch dynamically. After this change build process on a new machine or fresh install will be a two step process. First download the build tools by executing msbuild build.proj and once it finishes, then execute whatever target you need to do e.g. msbuild build.proj /t:RunTests /p:Scope=SDKs\Compute. After downloading all build related assets will be downloaded under <root>\tools\SdkBuildTools. Moving bunch of legacy code to legacy directory. Removing build tasks out of this branch, currently being moved to legacy directory
  • Loading branch information
shahabhijeet authored Oct 13, 2017
1 parent 0a8d46e commit deceaf3
Show file tree
Hide file tree
Showing 116 changed files with 76 additions and 891 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ build/
restoredPackages/
PolicheckOutput/
tools/net46/
tools/SdkBuildTools/
tools/Microsoft.WindowsAzure.Build.Tasks/packages/
PublishedNugets/
src/NuGet.Config
Expand Down
22 changes: 17 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
<PropertyGroup>
<LibraryRoot>$(MSBuildThisFileDirectory)</LibraryRoot>
<LibrarySourceFolder>$(LibraryRoot)src</LibrarySourceFolder>
<LibraryToolsFolder>$(LibraryRoot)tools</LibraryToolsFolder>
<LibraryNugetPackageFolder>$(LibraryRoot)\restoredPackages</LibraryNugetPackageFolder>
<LibraryToolsFolder>$(LibraryRoot)tools</LibraryToolsFolder>
<LibraryNugetPackageFolder>$(LibraryRoot)restoredPackages</LibraryNugetPackageFolder>
<LibraryFriendlyName>Microsoft Azure Management Libraries</LibraryFriendlyName>
<AuthenticationSolution>src\Authentication\Authentication.sln</AuthenticationSolution>
<ManagementLibrariesSolution>AzureManagementLibraries.sln</ManagementLibrariesSolution>
<BinariesFolder>$(LibraryRoot)binaries</BinariesFolder>
<BuildAssetsDir>$(LibraryToolsFolder)\BuildAssets</BuildAssetsDir>
<PoliCheckOutputDir>$(LibraryRoot)PolicheckOutput</PoliCheckOutputDir>
<BuiltPackageOutputDir>$(BinariesFolder)\packages</BuiltPackageOutputDir>
<DelaySign Condition =" '$(DelaySign)' == '' ">false</DelaySign>
Expand All @@ -16,9 +17,10 @@
<NuGetCommand>&quot;$(LibraryToolsFolder)\nuget.exe&quot;</NuGetCommand>
<NuGetKey Condition=" '$(NuGetKey)' == '' ">1234</NuGetKey>
<BuildInParallel>true</BuildInParallel>
<SdkBuildToolsDir>$(LibraryToolsFolder)\SdkBuildTools</SdkBuildToolsDir>
<NugetPackageName/>
<ImportDirectoryBuildTargets>true</ImportDirectoryBuildTargets>
<DefaultPathTokenToIgnore>$(IgnorePathTokens) Microsoft.Azure.KeyVault.Samples Gallery Intune AzureBatchFileConventions.IntegrationTests Batch.FileStaging.Tests Azure.Batch.IntegrationTests Azure.Batch.ProtocolTests</DefaultPathTokenToIgnore>
<DefaultPathTokenToIgnore>$(IgnorePathTokens) Microsoft.Azure.KeyVault.Samples Gallery Intune AzureBatchFileConventions.IntegrationTests Batch.FileStaging.Tests Azure.Batch.IntegrationTests Azure.Batch.ProtocolTests</DefaultPathTokenToIgnore>
</PropertyGroup>
<PropertyGroup>
<CIToolsPath>$(OnPremiseBuildTasks)</CIToolsPath>
Expand All @@ -31,6 +33,16 @@
<SdkCommonRootDir>$(LibraryRoot)src\UpgradeVS17\SdkCommon\ClientRuntime</SdkCommonRootDir>
</PropertyGroup>

<Import Project="tools\buildTargets\common.Build.props"/>
<Import Project="tools\buildTargets\common.NugetPackage.props" />
<PropertyGroup>
<NetSdkBuildTargetsDir Condition=" Exists('$(BuildAssetsDir)') ">$(BuildAssetsDir)\targets</NetSdkBuildTargetsDir>
<NetSdkBuildTargetsDir Condition=" Exists('$(SdkBuildToolsDir)') AND '$(NetSdkBuildTargetsDir)' == '' ">$(SdkBuildToolsDir)\targets</NetSdkBuildTargetsDir>
<!-- <NetSdkBuildTargetsDir Condition=" '$(NetSdkBuildTargetsDir)' == '' ">$(LibraryToolsFolder)\buildTargets</NetSdkBuildTargetsDir> -->

<NetSdkBuildToolsDir Condition="Exists('$(BuildAssetsDir)')">$(BuildAssetsDir)</NetSdkBuildToolsDir>
<NetSdkBuildToolsDir Condition="Exists('$(SdkBuildToolsDir)')">$(SdkBuildToolsDir)</NetSdkBuildToolsDir>
<!-- <NetSdkBuildToolsDir Condition=" '$(NetSdkBuildToolsDir)' == '' ">$(LibraryToolsFolder)\buildTargets</NetSdkBuildToolsDir> -->
</PropertyGroup>

<Import Condition="Exists('$(NetSdkBuildTargetsDir)\common.Build.props')" Project="$(NetSdkBuildTargetsDir)\common.Build.props"/>
<Import Condition="Exists('$(NetSdkBuildTargetsDir)\common.NugetPackage.props')" Project="$(NetSdkBuildTargetsDir)\common.NugetPackage.props"/>
</Project>
3 changes: 2 additions & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="tools\buildTargets\common.targets" />
<Import Condition="Exists('$(NetSdkBuildTargetsDir)\common.targets')" Project="$(NetSdkBuildTargetsDir)\common.targets" />
<Import Project="tools\bootstrapTools\bootstrap.targets" />
</Project>
4 changes: 2 additions & 2 deletions build.proj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project DefaultTargets="RunTests" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Init" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="Directory.Build.props" />
<Import Project="test.props" />
<Import Project="AzSdk.props" />
Expand All @@ -11,6 +11,6 @@
<Target Name="PublishNuget" DependsOnTargets="$(PublishNugetDependsOn)" />
<Target Name="CreateNugetPackage" DependsOnTargets="$(PackageNugetDependsOn)" />
<Target Name="RunTests" DependsOnTargets="$(RunTestProjectsDependsOn)" />
<Target Name="SignNuget" DependsOnTargets="$(SignNugetDependsOn)" />
<Target Name="SignNuget" DependsOnTargets="$(SignNugetDependsOn)" />
<Target Name="Help" DependsOnTargets="$(HelpDependsOn)" />
</Project>
86 changes: 42 additions & 44 deletions testSdkOnLinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,52 +164,50 @@ skip_Rps() {
echo $retVal
}

getBuildTools() {
copyFromRootDir="https://raw.githubusercontent.com/shahabhijeet/azure-sdk-for-net/addSep/"
printf "Updating Build tools .....\n"

if [ ! -d ./tools/SdkBuildTools ]; then
mkdir ./tools/SdkBuildTools
fi
if [ ! -d ./tools/SdkBuildTools/targets ]; then
mkdir ./tools/SdkBuildTools/targets
fi

if [ ! -d ./tools/SdkBuildTools/tasks ]; then
mkdir ./tools/SdkBuildTools/tasks
fi

if [ ! -d ./tools/SdkBuildTools/tasks/net46 ]; then
mkdir ./tools/SdkBuildTools/tasks/net46
fi

curl -s $copyFromRootDir/tools/BuildAssets/targets/additional.targets > ./tools/SdkBuildTools/targets/additional.targets
curl -s $copyFromRootDir/tools/BuildAssets/targets/common.Build.props > ./tools/SdkBuildTools/targets/common.Build.props
curl -s $copyFromRootDir/tools/BuildAssets/targets/common.NugetPackage.props > ./tools/SdkBuildTools/targets/common.NugetPackage.props
curl -s $copyFromRootDir/tools/BuildAssets/targets/common.targets > ./tools/SdkBuildTools/targets/common.targets
curl -s $copyFromRootDir/tools/BuildAssets/targets/signing.targets > ./tools/SdkBuildTools/targets/signing.targets
curl -s $copyFromRootDir/tools/BuildAssets/tasks/common.tasks > ./tools/SdkBuildTools/tasks/common.tasks
#curl $copyFromRootDir/tools/BuildAssets/tasks/net46/Microsoft.Azure.Build.BootstrapTasks.dll > ./tools/SdkBuildTools/tasks/net46/Microsoft.Azure.Build.BootstrapTasks.dll
#curl $copyFromRootDir/tools/BuildAssets/tasks/net46/Microsoft.Azure.Build.BootstrapTasks.runtimeconfig.dev.json > ./tools/SdkBuildTools/tasks/net46/Microsoft.Azure.Build.BootstrapTasks.runtimeconfig.dev.json
#curl $copyFromRootDir/tools/BuildAssets/tasks/net46/Microsoft.Azure.Build.BootstrapTasks.runtimeconfig.json > ./tools/SdkBuildTools/tasks/net46/Microsoft.Azure.Build.BootstrapTasks.runtimeconfig.json
curl -s $copyFromRootDir/tools/BuildAssets/tasks/net46/Microsoft.Azure.Sdk.Build.Tasks.dll > ./tools/SdkBuildTools/tasks/net46/Microsoft.Azure.Sdk.Build.Tasks.dll
#curl -s $copyFromRootDir/tools/BuildAssets/tasks/net46/Microsoft.Azure.Sdk.Build.Tasks.runtimeconfig.dev.json > ./tools/SdkBuildTools/tasks/net46/Microsoft.Azure.Sdk.Build.Tasks.runtimeconfig.dev.json
curl -s $copyFromRootDir/tools/BuildAssets/tasks/net46/Microsoft.Build.dll > ./tools/SdkBuildTools/tasks/net46/Microsoft.Build.dll
curl -s $copyFromRootDir/tools/BuildAssets/tasks/net46/Microsoft.Build.Framework.dll > ./tools/SdkBuildTools/tasks/net46/Microsoft.Build.Framework.dll
curl -s $copyFromRootDir/tools/BuildAssets/tasks/net46/Microsoft.Build.Tasks.Core.dll > ./tools/SdkBuildTools/tasks/net46/Microsoft.Build.Tasks.Core.dll
curl -s $copyFromRootDir/tools/BuildAssets/tasks/net46/Microsoft.Build.Utilities.Core.dll > ./tools/SdkBuildTools/tasks/net46Microsoft.Build.Utilities.Core.dll
curl -s $copyFromRootDir/tools/BuildAssets/tasks/net46/System.Collections.Immutable.dll > ./tools/SdkBuildTools/tasks/net46/System.Collections.Immutable.dll
curl -s $copyFromRootDir/tools/BuildAssets/tasks/net46/System.Reflection.Metadata.dll > ./tools/SdkBuildTools/tasks/net46/System.Reflection.Metadata.dll
curl -s $copyFromRootDir/tools/BuildAssets/tasks/net46/System.Runtime.InteropServices.RuntimeInformation.dll > ./tools/SdkBuildTools/tasks/net46/System.Runtime.InteropServices.RuntimeInformation.dll
curl -s $copyFromRootDir/tools/BuildAssets/tasks/net46/System.Threading.Thread.dll > ./tools/SdkBuildTools/tasks/net46/System.Threading.Thread.dll

}

getBuildTools
restoreBuildCR
restoreBuildRepo
restoreBuildCog
restoreBuildKV
restoreBuildAzStack

: '
#echo "base: "$base
#echo "rootedir: "$rootdir
#echo "netstandard1.4 " $netstd14
#echo "netCore1.1 " $netcore11
#if [ -d $sdkdir/$item/Management.* ]
#then
# sdkProjFile=($sdkdir/$item/Management.*/*.csproj)
# printf "Build ------ $sdkProjFile for framework $netstd14\n"
# dotnet build $sdkProjFile -f $netstd14
#fi
else
if [ -d $sdkDir/$item/Management ]; then
printf "Found mgmt $sdkDir/$item/Management\n"
fi
if [ -f $sdkDir/$item/Management/*.sln ]; then
mgmtSln=($sdkDir/$item/Management/*.sln)
printf "Restoring ## $mgmtSln\n"
if [ -d $sdkdir/$item/*.Tests ]; then
mgmtTestProj=($sdkdir/$item/*.Tests/*.csproj)
printf "Test ## $mgmtTestProj for framework $netcore11\n"
fi #mgmtTestProject
fi #mgmgtSln
fi #mgmtSln else
#if [[ $("$testProj" =~ "Authorization") || $( "$testProj" =~ "Gallery" ) || $("$testProj" =~ "Automation") || $( "$testProj" =~ "InTune" ) || $( "$testProj" =~ "DataLake.Store" ) ]]; then
#if [[ ("$testProj" =~ "Authorization") || ( "$testProj" =~ "Gallery" ) || ("$testProj" =~ "Automation") || ( "$testProj" =~ "Intune" ) || ( "$testProj" =~ "DataLake.Store" )
#|| ( "$testProj" =~ "Monitor" ) || ( "$testProj" =~ "RedisCache" ) ]]; then
if [[ "$cogItem" =~ "Tests" ]]; then
print "cogItem --- $cogItem\n"
cogDataTestProj=($cogItem/*.csproj)
printf "Cog TestProjects ... $cogDataTestProj\n"
#dotnet restore $cogDataTestProj -r $ubuntu1404
#dotnet test $cogDataTestProj -f $netcore11
fi
'
Loading

0 comments on commit deceaf3

Please sign in to comment.