Skip to content

Commit 68ac92c

Browse files
committed
try schedule target again
1 parent 36fa3fc commit 68ac92c

File tree

1 file changed

+33
-23
lines changed

1 file changed

+33
-23
lines changed

src/index.ts

+33-23
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import fs from "fs-extra";
77
// import { createBuilder } from "@angular-devkit/architect";
88
import { WorkspaceNodeModulesArchitectHost } from "@angular-devkit/architect/node";
99
import { NodeJsSyncHost } from "@angular-devkit/core/node";
10-
import { workspaces } from "@angular-devkit/core";
10+
import { workspaces, logging } from "@angular-devkit/core";
1111
import { Architect } from "@angular-devkit/architect";
1212
// import {
1313
// ApplicationBuilderOptions,
@@ -293,35 +293,45 @@ class ServerlessReact {
293293

294294
console.log("!!! projectMetadata", projectMetadata);
295295

296-
const targetOptions = await architectHost.getOptionsForTarget({
297-
project: projectName,
298-
target: "build",
299-
});
300-
301-
if (!targetOptions) {
302-
throw new Error(`targetOptions does not exist`);
303-
}
304-
305-
console.log("!!! targetOptions", targetOptions);
306-
307-
// const scheduleTargetRun = await architect.scheduleTarget({
296+
// const targetOptions = await architectHost.getOptionsForTarget({
297+
// configuration: "",
308298
// project: projectName,
309299
// target: "build",
310300
// });
311301

312-
// console.log("!!! scheduleTargetRun", scheduleTargetRun);
313-
// const scheduleTargetLastOutput = await scheduleTargetRun.lastOutput;
314-
// console.log("!!! scheduleTargetLastOutput", scheduleTargetLastOutput);
302+
// if (!targetOptions) {
303+
// throw new Error(`targetOptions does not exist`);
304+
// }
305+
306+
// console.log("!!! targetOptions", targetOptions);
307+
308+
const logger = new logging.Logger(PLUGIN_NAME);
309+
logger.subscribe((entry) => {
310+
console.log(entry.message);
311+
});
315312

316-
const scheduleBuilderRun = await architect.scheduleBuilder(
317-
buildTarget.builder,
318-
targetOptions,
319-
JSON.parse(JSON.stringify({ target: projectName })) // skip type checking
313+
const scheduleTargetRun = await architect.scheduleTarget(
314+
{
315+
configuration: "",
316+
project: projectName,
317+
target: "build",
318+
},
319+
{},
320+
{ logger }
320321
);
321322

322-
console.log("!!! scheduleBuilderRun", scheduleBuilderRun);
323-
const scheduleBuilderLastOutput = await scheduleBuilderRun.lastOutput;
324-
console.log("!!! scheduleBuilderLastOutput", scheduleBuilderLastOutput);
323+
console.log("!!! scheduleTargetRun", scheduleTargetRun);
324+
const scheduleTargetLastOutput = await scheduleTargetRun.lastOutput;
325+
console.log("!!! scheduleTargetLastOutput", scheduleTargetLastOutput);
326+
327+
// const scheduleBuilderRun = await architect.scheduleBuilder(
328+
// buildTarget.builder,
329+
// targetOptions
330+
// );
331+
332+
// console.log("!!! scheduleBuilderRun", scheduleBuilderRun);
333+
// const scheduleBuilderLastOutput = await scheduleBuilderRun.lastOutput;
334+
// console.log("!!! scheduleBuilderLastOutput", scheduleBuilderLastOutput);
325335

326336
// const host = workspaces.createWorkspaceHost(new NodeJsSyncHost());
327337

0 commit comments

Comments
 (0)