@@ -43,24 +43,25 @@ build.cmd /no-deploy-extension /${configuration.toLowerCase()}""")
4343 }
4444}
4545
46- // Add VSI job.
47- // For now, trigger VSI jobs only on explicit request.
48- def newVsiJobName = Utilities . getFullJobName(project, " vsi" , false /* isPr */ )
46+ // Add VSI jobs.
47+ // Generate the builds for commit and PRJob
48+ [true , false ]. each { isPR -> // Defines a closure over true and false, value assigned to isPR
49+ def newVsiJobName = Utilities . getFullJobName(project, " vsi" , isPR)
4950
50- def newVsiJob = job(newVsiJobName) {
51- description(' ' )
51+ def newVsiJob = job(newVsiJobName) {
52+ description(' ' )
5253
53- // This opens the set of build steps that will be run.
54- steps {
55- // Build roslyn-project-system repo - we also need to set certain environment variables for building the repo with VS15 toolset.
56- batchFile(""" SET VS150COMNTOOLS=%ProgramFiles(x86)%\\ Microsoft Visual Studio\\ 2017\\ Enterprise\\ Common7\\ Tools\\
54+ // This opens the set of build steps that will be run.
55+ steps {
56+ // Build roslyn-project-system repo - we also need to set certain environment variables for building the repo with VS15 toolset.
57+ batchFile(""" SET VS150COMNTOOLS=%ProgramFiles(x86)%\\ Microsoft Visual Studio\\ 2017\\ Enterprise\\ Common7\\ Tools\\
5758SET VSSDK150Install=%ProgramFiles(x86)%\\ Microsoft Visual Studio\\ 2017\\ Enterprise\\ VSSDK\\
5859SET VSSDKInstall=%ProgramFiles(x86)%\\ Microsoft Visual Studio\\ 2017\\ Enterprise\\ VSSDK\\
5960
6061build.cmd /release /skiptests""" )
61-
62- // Patch all the MSBuild xaml and targets files from the current roslyn-project-system commit into VS install.
63- batchFile(""" SET VS_MSBUILD_MANAGED=%ProgramFiles(x86)%\\ Microsoft Visual Studio\\ 2017\\ Enterprise\\ MSBuild\\ Microsoft\\ VisualStudio\\ Managed
62+
63+ // Patch all the MSBuild xaml and targets files from the current roslyn-project-system commit into VS install.
64+ batchFile(""" SET VS_MSBUILD_MANAGED=%ProgramFiles(x86)%\\ Microsoft Visual Studio\\ 2017\\ Enterprise\\ MSBuild\\ Microsoft\\ VisualStudio\\ Managed
6465
6566mkdir backup
6667xcopy /SIY "%VS_MSBUILD_MANAGED%" .\\ backup\\ Managed
@@ -69,16 +70,16 @@ xcopy /SIY .\\src\\Targets\\*.targets "%VS_MSBUILD_MANAGED%"
6970xcopy /SIY .\\ bin\\ Release\\ Rules\\ *.xaml "%VS_MSBUILD_MANAGED%"
7071""" )
7172
72- // Sync roslyn-internal upfront as we use the VsixExpInstaller from roslyn-internal repo to install VSIXes built from SDK repo into RoslynDev hive.
73- batchFile(""" pushd %WORKSPACE%\\ roslyn-internal
73+ // Sync roslyn-internal upfront as we use the VsixExpInstaller from roslyn-internal repo to install VSIXes built from SDK repo into RoslynDev hive.
74+ batchFile(""" pushd %WORKSPACE%\\ roslyn-internal
7475git submodule init
7576git submodule sync
7677git submodule update --init --recursive
7778init.cmd
7879popd""" )
7980
80- // Build sdk repo and install templates into RoslynDev hive.
81- batchFile(""" SET VS150COMNTOOLS=%ProgramFiles(x86)%\\ Microsoft Visual Studio\\ 2017\\ Enterprise\\ Common7\\ Tools\\
81+ // Build sdk repo and install templates into RoslynDev hive.
82+ batchFile(""" SET VS150COMNTOOLS=%ProgramFiles(x86)%\\ Microsoft Visual Studio\\ 2017\\ Enterprise\\ Common7\\ Tools\\
8283SET DeveloperCommandPrompt=%VS150COMNTOOLS%\\ VsMSBuildCmd.bat
8384
8485call "%DeveloperCommandPrompt%" || goto :BuildFailed
@@ -101,8 +102,8 @@ echo Build failed with ERRORLEVEL %ERRORLEVEL%
101102exit /b 1
102103""" )
103104
104- // Build roslyn-internal and run netcore VSI tao tests.
105- batchFile(""" SET VS150COMNTOOLS=%ProgramFiles(x86)%\\ Microsoft Visual Studio\\ 2017\\ Enterprise\\ Common7\\ Tools\\
105+ // Build roslyn-internal and run netcore VSI tao tests.
106+ batchFile(""" SET VS150COMNTOOLS=%ProgramFiles(x86)%\\ Microsoft Visual Studio\\ 2017\\ Enterprise\\ Common7\\ Tools\\
106107SET VSSDK150Install=%ProgramFiles(x86)%\\ Microsoft Visual Studio\\ 2017\\ Enterprise\\ VSSDK\\
107108SET VSSDKInstall=%ProgramFiles(x86)%\\ Microsoft Visual Studio\\ 2017\\ Enterprise\\ VSSDK\\
108109
@@ -116,13 +117,29 @@ set EchoOn=true
116117BuildAndTest.cmd -build:true -clean:false -deployExtensions:true -trackFileAccess:false -officialBuild:false -realSignBuild:false -parallel:true -release:true -delaySignBuild:true -samples:false -unit:false -eta:false -vs:true -cibuild:true -x64:false -netcoretestrun
117118popd""" )
118119
119- // Revert patched targets and rules from backup.
120- batchFile(""" SET VS_MSBUILD_MANAGED=%ProgramFiles(x86)%\\ Microsoft Visual Studio\\ 2017\\ Enterprise\\ MSBuild\\ Microsoft\\ VisualStudio\\ Managed
120+ // Revert patched targets and rules from backup.
121+ batchFile(""" SET VS_MSBUILD_MANAGED=%ProgramFiles(x86)%\\ Microsoft Visual Studio\\ 2017\\ Enterprise\\ MSBuild\\ Microsoft\\ VisualStudio\\ Managed
121122del /SQ "%VS_MSBUILD_MANAGED%\\ "
122123xcopy /SIY .\\ backup\\ Managed "%VS_MSBUILD_MANAGED%"
123124rmdir /S /Q backup
124125""" )
126+ }
127+ }
128+
129+ addVsiArchive(newVsiJob)
130+ Utilities . setMachineAffinity(newVsiJob, ' Windows_NT' , ' latest-or-auto-dev15-internal' )
131+ Utilities . standardJobSetup(newVsiJob, project, isPR, " */${ branch} " )
132+ // ISSUE: Temporary until a full builder for source control is available.
133+ addVsiMultiScm(newVsiJob, project)
134+
135+ if (isPR) {
136+ def triggerPhrase = generateTriggerPhrase(newVsiJobName, " vsi" )
137+ Utilities . addGithubPRTriggerForBranch(newVsiJob, branch, newVsiJobName, triggerPhrase, /* triggerPhraseOnly*/ true )
138+ } else {
139+ Utilities . addGithubPushTrigger(newVsiJob)
125140 }
141+
142+ Utilities . addHtmlPublisher(newVsiJob, " roslyn-internal/Open/Binaries/Release/Exes/EditorTestApp/VSIntegrationTestLogs" , ' VS Integration Test Logs' , ' *.html' )
126143}
127144
128145// Archive VSI artifacts.
@@ -182,16 +199,15 @@ static void addVsiMultiScm(def myJob, def project) {
182199}
183200// END ISSUE
184201
185- addVsiArchive(newVsiJob)
186- Utilities . setMachineAffinity(newVsiJob, ' Windows_NT' , ' latest-or-auto-dev15-internal' )
187- // For now, trigger VSI jobs only on explicit request.
188- Utilities . standardJobSetup(newVsiJob, project, false /* isPr */ , " */${ branch} " )
189- // ISSUE: Temporary until a full builder for source control is available.
190- addVsiMultiScm(newVsiJob, project)
191- Utilities . addGithubPushTrigger(newVsiJob)
192- Utilities . addHtmlPublisher(newVsiJob, " roslyn-internal/Open/Binaries/Release/Exes/EditorTestApp/VSIntegrationTestLogs" , ' VS Integration Test Logs' , ' *.html' )
202+ static String generateTriggerPhrase (String jobName , String triggerPhraseExtra ) {
203+ def triggerCore = " all|${ jobName} "
204+ if (triggerPhraseExtra) {
205+ triggerCore = " ${ triggerCore} |${ triggerPhraseExtra} "
206+ }
207+ return " (?i).*test\\ W+(${ triggerCore} )\\ W+please.*" ;
208+ }
193209
194210// Make the call to generate the help job
195211Utilities . createHelperJob(this , project, branch,
196212 " Welcome to the ${ project} Repository" , // This is prepended to the help message
197- " Have a nice day!" ) // This is appended to the help message. You might put known issues here.
213+ " Have a nice day!" ) // This is appended to the help message. You might put known issues here.
0 commit comments