Skip to content

Commit

Permalink
Expose host gulp tasts that run agent specific logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
skrustev committed Nov 21, 2024
1 parent 463e6c5 commit 4cf28c6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions azure-pipelines/templates/build-steps-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ steps:
customCommand: ci

- task: CmdLine@2
displayName: 'npx gulp copySamplesTo${{ parameters.projectToBuild }}'
displayName: 'npx gulp copySamplesTo${{ parameters.projectToBuild }}Host'
inputs:
script: 'npx gulp copySamplesTo${{ parameters.projectToBuild }}'
script: 'npx gulp copySamplesTo${{ parameters.projectToBuild }}Host'
workingDirectory: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.Gulp'
failOnStderr: true

Expand Down
19 changes: 15 additions & 4 deletions browser/IgBlazorSamples.Gulp/tasks/gulp-samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ function copySamplePages(cb, outputPath) {
cb();
}

function copySampleScripts(cb, outputPath, indexName) {
function copySampleScripts(cb, outputPath, indexName, isLocalBuild) {
var insertScriptFiles = [];

log('deleting scripts in: ' + outputPath + '/wwwroot/sb/*.js');
Expand Down Expand Up @@ -464,7 +464,6 @@ function copySampleScripts(cb, outputPath, indexName) {

// indexLines = indexLines.filter((v, i, a) => a.indexOf(v) === i);

var isLocalBuild = __dirname.indexOf('Agent') < 0;
for (let i = 0; i < indexLines.length; i++) {
if (indexLines[i].indexOf('<base href') > 0) {
if (isLocalBuild) {
Expand Down Expand Up @@ -492,7 +491,13 @@ function copySampleScripts(cb, outputPath, indexName) {
// '../../browser/IgBlazorSamples.Server/wwwroot'
function copySamplesToServer(cb) {
cleanupSampleBrowser( "../../browser/IgBlazorSamples.Server");
copySampleScripts(cb, "../../browser/IgBlazorSamples.Server", "/Pages/_Host.cshtml");
copySampleScripts(cb, "../../browser/IgBlazorSamples.Server", "/Pages/_Host.cshtml", true);
copySamplePages(cb, "../../browser/IgBlazorSamples.Server");
} exports.copySamplesToServer = copySamplesToServer;

function copySamplesToServerHost(cb) {
cleanupSampleBrowser( "../../browser/IgBlazorSamples.Server");
copySampleScripts(cb, "../../browser/IgBlazorSamples.Server", "/Pages/_Host.cshtml", false);
copySamplePages(cb, "../../browser/IgBlazorSamples.Server");
} exports.copySamplesToServer = copySamplesToServer;

Expand All @@ -501,7 +506,13 @@ function copySamplesToServer(cb) {
// '../../browser/IgBlazorSamples.Client/wwwroot'
function copySamplesToClient(cb) {
cleanupSampleBrowser( "../../browser/IgBlazorSamples.Client");
copySampleScripts(cb, "../../browser/IgBlazorSamples.Client", "/wwwroot/index.html");
copySampleScripts(cb, "../../browser/IgBlazorSamples.Client", "/wwwroot/index.html", true);
copySamplePages(cb, "../../browser/IgBlazorSamples.Client");
} exports.copySamplesToClient = copySamplesToClient;

function copySamplesToClientHost(cb) {
cleanupSampleBrowser( "../../browser/IgBlazorSamples.Client");
copySampleScripts(cb, "../../browser/IgBlazorSamples.Client", "/wwwroot/index.html", false);
copySamplePages(cb, "../../browser/IgBlazorSamples.Client");
} exports.copySamplesToClient = copySamplesToClient;

Expand Down

0 comments on commit 4cf28c6

Please sign in to comment.