3
votes

I'm following the instructions on this link https://blogs.msdn.microsoft.com/azuredatalake/2017/10/24/continuous-integration-made-easy-with-msbuild-support-for-u-sql-preview/

It states that

After running MSBuild from command line or as a VSTS task, all scripts in the U-SQL project are built and output to a single file at "Build output path/script name/script name.usql". You can copy this composite U-SQL script to the release folder for further deployment.

Within my Visual Studio project (.usqlproj) I have multiple .usql scripts

  • CreateDatabase.usql
  • CreateTable.usql
  • CreateTvf.usql

when I do clean and msbuild and then check bin\debug folder, all I get is just CreateDatabase.usql and within that there is only CREATE DATBASE statement. As per the blog I would have thought all the 3 usql scripts would have merged into 1 composite usql script. The msbuild command I executed from command prompt on my machine

msbuild TheProject\TheProject.usqlproj /t:Clean /t:Rebuild /property:USQLSDKPath=C:\TheProject\src\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\build\runtime,USQLTargetType=Merge

I'm using Visual Studio 2017 15.4.3 and Azure Data Lake tools 2.3.0000.1

What am I doing wrong?

2

2 Answers

1
votes

Due to some legacy reasons, to make sure all files in the usqlproj are built, the condition are defined in USqlSDKBuild.targets as below <ItemGroup> <FileToBuild Condition="'$(JustOneFile)' == '' and '$(Build_all_files_in_this_project)' != 'true'" Include="$(ActiveFile)" /> <FileToBuild Condition="'$(JustOneFile)' != '' " Include="$(JustOneFile)" /> <FileToBuild Condition="'$(Build_all_files_in_this_project)' == 'true'" Include="Build_all_files_in_this_project" /> </ItemGroup>

For current preview release, please add "/property:Build_all_files_in_this_project=true,JustOneFile=''" to the command line to make sure all scripts are built. We will update this in later releases with a easier and simpler condition.

0
votes

The command msbuild TheProject\TheProject.usqlproj /t:Clean /t:Rebuild /property:USQLSDKPath=C:\TheProject\src\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\build\runtime,USQLTargetType=Merge actually build the script you selected.

If you are selecting CreateDatabase.usql in VS, it will build the script CreateDatabase.usql in command line.

As below example, since it's selecting test.usql, when execute msbuild command, it will only build test.usql. As the way clicking Build button for the USQL project.

enter image description here

If you want to build all the scripts under the USQL project, you should select Build All Scripts button in VS.

enter image description here

enter image description here