@azure-tools/typespec-java 0.27.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/code-model-builder.d.ts.map +1 -1
- package/dist/src/code-model-builder.js +39 -28
- package/dist/src/code-model-builder.js.map +1 -1
- package/dist/src/emitter.d.ts +0 -1
- package/dist/src/emitter.d.ts.map +1 -1
- package/dist/src/emitter.js +54 -98
- package/dist/src/emitter.js.map +1 -1
- package/dist/src/utils.d.ts +6 -0
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +47 -0
- package/dist/src/utils.js.map +1 -1
- package/dist/src/validate.d.ts +4 -0
- package/dist/src/validate.d.ts.map +1 -0
- package/dist/src/validate.js +67 -0
- package/dist/src/validate.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/generator/http-client-generator/target/emitter.jar +0 -0
- package/package.json +1 -1
- package/readme.md +67 -3
package/dist/src/emitter.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { createTypeSpecLibrary, getNormalizedAbsolutePath, resolvePath, } from "@typespec/compiler";
|
|
2
|
-
import { spawn } from "child_process";
|
|
3
2
|
import { promises } from "fs";
|
|
4
3
|
import { dump } from "js-yaml";
|
|
5
4
|
import { dirname } from "path";
|
|
6
5
|
import { fileURLToPath } from "url";
|
|
7
6
|
import { CodeModelBuilder } from "./code-model-builder.js";
|
|
8
|
-
import { logError } from "./utils.js";
|
|
7
|
+
import { logError, spawnAsync } from "./utils.js";
|
|
8
|
+
import { JDK_NOT_FOUND_MESSAGE, validateDependencies } from "./validate.js";
|
|
9
9
|
const EmitterOptionsSchema = {
|
|
10
10
|
type: "object",
|
|
11
11
|
additionalProperties: true,
|
|
12
12
|
properties: {
|
|
13
13
|
namespace: { type: "string", nullable: true },
|
|
14
|
-
"output-dir": { type: "string", nullable: true },
|
|
15
14
|
"package-dir": { type: "string", nullable: true },
|
|
16
15
|
flavor: { type: "string", nullable: true },
|
|
17
16
|
// service
|
|
@@ -49,108 +48,65 @@ export const $lib = createTypeSpecLibrary({
|
|
|
49
48
|
},
|
|
50
49
|
});
|
|
51
50
|
export async function $onEmit(context) {
|
|
52
|
-
var _a, _b, _c, _d, _e, _f
|
|
51
|
+
var _a, _b, _c, _d, _e, _f;
|
|
53
52
|
const program = context.program;
|
|
54
|
-
|
|
55
|
-
if (!
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
const builder = new CodeModelBuilder(program, context);
|
|
62
|
-
const codeModel = await builder.build();
|
|
63
|
-
if (!program.compilerOptions.noEmit && !program.hasError()) {
|
|
64
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
65
|
-
const moduleRoot = resolvePath(__dirname, "..", "..");
|
|
66
|
-
const outputPath = (_b = options["output-dir"]) !== null && _b !== void 0 ? _b : context.emitterOutputDir;
|
|
67
|
-
options["output-dir"] = getNormalizedAbsolutePath(outputPath, undefined);
|
|
68
|
-
options["arm"] = codeModel.arm;
|
|
69
|
-
const codeModelFileName = resolvePath(outputPath, "./code-model.yaml");
|
|
70
|
-
await promises.mkdir(outputPath, { recursive: true }).catch((err) => {
|
|
71
|
-
if (err.code !== "EISDIR" && err.code !== "EEXIST") {
|
|
72
|
-
logError(program, `Failed to create output directory: ${outputPath}`);
|
|
73
|
-
return;
|
|
53
|
+
await validateDependencies(program, true);
|
|
54
|
+
if (!program.hasError()) {
|
|
55
|
+
const options = context.options;
|
|
56
|
+
if (!options["flavor"]) {
|
|
57
|
+
if ($lib.name === "@azure-tools/typespec-java") {
|
|
58
|
+
options["flavor"] = "azure";
|
|
74
59
|
}
|
|
75
|
-
});
|
|
76
|
-
await program.host.writeFile(codeModelFileName, dump(codeModel));
|
|
77
|
-
program.trace("http-client-java", `Code model file written to ${codeModelFileName}`);
|
|
78
|
-
const emitterOptions = JSON.stringify(options);
|
|
79
|
-
program.trace("http-client-java", `Emitter options ${emitterOptions}`);
|
|
80
|
-
const jarFileName = resolvePath(moduleRoot, "generator/http-client-generator/target", "emitter.jar");
|
|
81
|
-
program.trace("http-client-java", `Exec JAR ${jarFileName}`);
|
|
82
|
-
const javaArgs = [];
|
|
83
|
-
javaArgs.push(`-DemitterOptions=${emitterOptions}`);
|
|
84
|
-
if ((_c = options["dev-options"]) === null || _c === void 0 ? void 0 : _c.debug) {
|
|
85
|
-
javaArgs.push("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005");
|
|
86
|
-
}
|
|
87
|
-
if ((_d = options["dev-options"]) === null || _d === void 0 ? void 0 : _d.loglevel) {
|
|
88
|
-
javaArgs.push("-Dorg.slf4j.simpleLogger.defaultLogLevel=" + ((_e = options["dev-options"]) === null || _e === void 0 ? void 0 : _e.loglevel));
|
|
89
|
-
}
|
|
90
|
-
if ((_f = options["dev-options"]) === null || _f === void 0 ? void 0 : _f["java-temp-dir"]) {
|
|
91
|
-
javaArgs.push("-Dcodegen.java.temp.directory=" + ((_g = options["dev-options"]) === null || _g === void 0 ? void 0 : _g["java-temp-dir"]));
|
|
92
60
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
});
|
|
61
|
+
const builder = new CodeModelBuilder(program, context);
|
|
62
|
+
const codeModel = await builder.build();
|
|
63
|
+
if (!program.hasError() && !program.compilerOptions.noEmit) {
|
|
64
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
65
|
+
const moduleRoot = resolvePath(__dirname, "..", "..");
|
|
66
|
+
const outputPath = context.emitterOutputDir;
|
|
67
|
+
options["output-dir"] = getNormalizedAbsolutePath(outputPath, undefined);
|
|
68
|
+
options.arm = codeModel.arm;
|
|
69
|
+
const codeModelFileName = resolvePath(outputPath, "./code-model.yaml");
|
|
70
|
+
await promises.mkdir(outputPath, { recursive: true }).catch((err) => {
|
|
71
|
+
if (err.code !== "EISDIR" && err.code !== "EEXIST") {
|
|
72
|
+
logError(program, `Failed to create output directory: ${outputPath}`);
|
|
73
|
+
return;
|
|
107
74
|
}
|
|
108
|
-
if (childProcess.stderr) {
|
|
109
|
-
childProcess.stderr.on("data", (data) => {
|
|
110
|
-
stderr.push(data.toString());
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
// failed to spawn the process
|
|
114
|
-
childProcess.on("error", (e) => {
|
|
115
|
-
error = e;
|
|
116
|
-
});
|
|
117
|
-
// process exits with error
|
|
118
|
-
childProcess.on("exit", (code, signal) => {
|
|
119
|
-
if (code !== 0) {
|
|
120
|
-
if (code) {
|
|
121
|
-
error = new Error(`JAR ended with code '${code}'.`);
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
error = new Error(`JAR terminated by signal '${signal}'.`);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
// close and complete Promise
|
|
129
|
-
childProcess.on("close", () => {
|
|
130
|
-
if (error) {
|
|
131
|
-
reject(error);
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
resolve({
|
|
135
|
-
stdout: stdout.join(""),
|
|
136
|
-
stderr: stderr.join(""),
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
75
|
});
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
76
|
+
await program.host.writeFile(codeModelFileName, dump(codeModel));
|
|
77
|
+
program.trace("http-client-java", `Code model file written to ${codeModelFileName}`);
|
|
78
|
+
const emitterOptions = JSON.stringify(options);
|
|
79
|
+
program.trace("http-client-java", `Emitter options ${emitterOptions}`);
|
|
80
|
+
const jarFileName = resolvePath(moduleRoot, "generator/http-client-generator/target", "emitter.jar");
|
|
81
|
+
program.trace("http-client-java", `Exec JAR ${jarFileName}`);
|
|
82
|
+
const javaArgs = [];
|
|
83
|
+
javaArgs.push(`-DemitterOptions=${emitterOptions}`);
|
|
84
|
+
if ((_a = options["dev-options"]) === null || _a === void 0 ? void 0 : _a.debug) {
|
|
85
|
+
javaArgs.push("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005");
|
|
147
86
|
}
|
|
148
|
-
|
|
149
|
-
|
|
87
|
+
if ((_b = options["dev-options"]) === null || _b === void 0 ? void 0 : _b.loglevel) {
|
|
88
|
+
javaArgs.push("-Dorg.slf4j.simpleLogger.defaultLogLevel=" + ((_c = options["dev-options"]) === null || _c === void 0 ? void 0 : _c.loglevel));
|
|
89
|
+
}
|
|
90
|
+
if ((_d = options["dev-options"]) === null || _d === void 0 ? void 0 : _d["java-temp-dir"]) {
|
|
91
|
+
javaArgs.push("-Dcodegen.java.temp.directory=" + ((_e = options["dev-options"]) === null || _e === void 0 ? void 0 : _e["java-temp-dir"]));
|
|
92
|
+
}
|
|
93
|
+
javaArgs.push("-jar");
|
|
94
|
+
javaArgs.push(jarFileName);
|
|
95
|
+
javaArgs.push(codeModelFileName);
|
|
96
|
+
try {
|
|
97
|
+
await spawnAsync("java", javaArgs, { stdio: "inherit" });
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
if (error && "code" in error && error["code"] === "ENOENT") {
|
|
101
|
+
logError(program, JDK_NOT_FOUND_MESSAGE);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
logError(program, error.message);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (!((_f = options["dev-options"]) === null || _f === void 0 ? void 0 : _f["generate-code-model"])) {
|
|
108
|
+
await program.host.rm(codeModelFileName);
|
|
150
109
|
}
|
|
151
|
-
}
|
|
152
|
-
if (!((_h = options["dev-options"]) === null || _h === void 0 ? void 0 : _h["generate-code-model"])) {
|
|
153
|
-
await program.host.rm(codeModelFileName);
|
|
154
110
|
}
|
|
155
111
|
}
|
|
156
112
|
}
|
package/dist/src/emitter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.js","sourceRoot":"","sources":["../../src/emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,yBAAyB,EAEzB,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"emitter.js","sourceRoot":"","sources":["../../src/emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,yBAAyB,EAEzB,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAkD5E,MAAM,oBAAoB,GAAmC;IAC3D,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,IAAI;IAC1B,UAAU,EAAE;QACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC7C,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAEjD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAE1C,UAAU;QACV,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAClD,kBAAkB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,I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,KAAK,QAAQ,EAAE,CAAC;oBAC3D,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;gBAC3C,CAAC;qBAAM,CAAC;oBACN,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;gBACnC,CAAC;YACH,CAAC;YAED,IAAI,CAAC,CAAA,MAAA,OAAO,CAAC,aAAa,CAAC,0CAAG,qBAAqB,CAAC,CAAA,EAAE,CAAC;gBACrD,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Program, Type } from "@typespec/compiler";
|
|
2
|
+
import { SpawnOptions } from "child_process";
|
|
2
3
|
export declare function logError(program: Program, msg: string): void;
|
|
3
4
|
export declare function logWarning(program: Program, msg: string): void;
|
|
4
5
|
export declare function trace(program: Program, msg: string): void;
|
|
@@ -6,4 +7,9 @@ export declare function pascalCase(name: string): string;
|
|
|
6
7
|
export declare function getNamespace(type: Type | undefined): string | undefined;
|
|
7
8
|
export declare function stringArrayContainsIgnoreCase(stringList: string[], str: string): boolean;
|
|
8
9
|
export declare function removeClientSuffix(clientName: string): string;
|
|
10
|
+
export type SpawnReturns = {
|
|
11
|
+
stdout: string;
|
|
12
|
+
stderr: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function spawnAsync(command: string, args: readonly string[], options: SpawnOptions): Promise<SpawnReturns>;
|
|
9
15
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAS,YAAY,EAAE,MAAM,eAAe,CAAC;AAEpD,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,QAQrD;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,QAQvD;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,QAElD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM/C;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAmBvE;AAED,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAIxF;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG7D;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,YAAY,CAAC,CAgDvB"}
|
package/dist/src/utils.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NoTarget } from "@typespec/compiler";
|
|
2
|
+
import { spawn } from "child_process";
|
|
2
3
|
export function logError(program, msg) {
|
|
3
4
|
trace(program, msg);
|
|
4
5
|
program.reportDiagnostic({
|
|
@@ -56,4 +57,50 @@ export function removeClientSuffix(clientName) {
|
|
|
56
57
|
const clientSuffix = "Client";
|
|
57
58
|
return clientName.endsWith(clientSuffix) ? clientName.slice(0, -clientSuffix.length) : clientName;
|
|
58
59
|
}
|
|
60
|
+
export async function spawnAsync(command, args, options) {
|
|
61
|
+
return new Promise((resolve, reject) => {
|
|
62
|
+
const childProcess = spawn(command, args, options);
|
|
63
|
+
let error = undefined;
|
|
64
|
+
// std
|
|
65
|
+
const stdout = [];
|
|
66
|
+
const stderr = [];
|
|
67
|
+
if (childProcess.stdout) {
|
|
68
|
+
childProcess.stdout.on("data", (data) => {
|
|
69
|
+
stdout.push(data.toString());
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (childProcess.stderr) {
|
|
73
|
+
childProcess.stderr.on("data", (data) => {
|
|
74
|
+
stderr.push(data.toString());
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// failed to spawn the process
|
|
78
|
+
childProcess.on("error", (e) => {
|
|
79
|
+
error = e;
|
|
80
|
+
});
|
|
81
|
+
// process exits with error
|
|
82
|
+
childProcess.on("exit", (code, signal) => {
|
|
83
|
+
if (code !== 0) {
|
|
84
|
+
if (code) {
|
|
85
|
+
error = new Error(`${command} ended with code '${code}'.`);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
error = new Error(`${command} terminated by signal '${signal}'.`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
// close and complete Promise
|
|
93
|
+
childProcess.on("close", () => {
|
|
94
|
+
if (error) {
|
|
95
|
+
reject(error);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
resolve({
|
|
99
|
+
stdout: stdout.join(""),
|
|
100
|
+
stderr: stderr.join(""),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
}
|
|
59
106
|
//# sourceMappingURL=utils.js.map
|
package/dist/src/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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AY,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YAC5B,IAAI,KAAK,EAAE,CAAC;gBACV,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC;oBACN,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;oBACvB,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;iBACxB,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Program } from "@typespec/compiler";
|
|
2
|
+
export declare const JDK_NOT_FOUND_MESSAGE = "Java Development Kit (JDK) is not found in PATH. Please install JDK 17 or above. Microsoft Build of OpenJDK can be downloaded from https://learn.microsoft.com/java/openjdk/download";
|
|
3
|
+
export declare function validateDependencies(program: Program | undefined, logDiagnostic?: boolean): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG7C,eAAO,MAAM,qBAAqB,yLACsJ,CAAC;AAEzL,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,aAAa,GAAE,OAAe,iBA+C/B"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { logError, spawnAsync } from "./utils.js";
|
|
2
|
+
export const JDK_NOT_FOUND_MESSAGE = "Java Development Kit (JDK) is not found in PATH. Please install JDK 17 or above. Microsoft Build of OpenJDK can be downloaded from https://learn.microsoft.com/java/openjdk/download";
|
|
3
|
+
export async function validateDependencies(program, logDiagnostic = false) {
|
|
4
|
+
var _a;
|
|
5
|
+
// Check JDK and version
|
|
6
|
+
try {
|
|
7
|
+
const result = await spawnAsync("javac", ["-version"], { stdio: "pipe" });
|
|
8
|
+
const javaVersion = (_a = findJavaVersion(result.stdout)) !== null && _a !== void 0 ? _a : findJavaVersion(result.stderr);
|
|
9
|
+
if (javaVersion) {
|
|
10
|
+
if (javaVersion < 11) {
|
|
11
|
+
// the message is JDK 17, because clientcore depends on JDK 17
|
|
12
|
+
// emitter only require JDK 11
|
|
13
|
+
const message = `Java Development Kit (JDK) in PATH is version ${javaVersion}. Please install JDK 17 or above. Microsoft Build of OpenJDK can be downloaded from https://learn.microsoft.com/java/openjdk/download`;
|
|
14
|
+
// // eslint-disable-next-line no-console
|
|
15
|
+
// console.log("[ERROR] " + message);
|
|
16
|
+
if (program && logDiagnostic) {
|
|
17
|
+
logError(program, message);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
let message = error.message;
|
|
24
|
+
if (error && "code" in error && error["code"] === "ENOENT") {
|
|
25
|
+
message = JDK_NOT_FOUND_MESSAGE;
|
|
26
|
+
}
|
|
27
|
+
// // eslint-disable-next-line no-console
|
|
28
|
+
// console.log("[ERROR] " + message);
|
|
29
|
+
if (program && logDiagnostic) {
|
|
30
|
+
logError(program, message);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// Check Maven
|
|
34
|
+
// nodejs does not allow spawn of .cmd on win32
|
|
35
|
+
const shell = process.platform === "win32";
|
|
36
|
+
try {
|
|
37
|
+
await spawnAsync("mvn", ["-v"], { stdio: "pipe", shell: shell });
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
let message = error.message;
|
|
41
|
+
if (shell || (error && "code" in error && error["code"] === "ENOENT")) {
|
|
42
|
+
message =
|
|
43
|
+
"Apache Maven is not found in PATH. Apache Maven can be downloaded from https://maven.apache.org/download.cgi";
|
|
44
|
+
}
|
|
45
|
+
// // eslint-disable-next-line no-console
|
|
46
|
+
// console.log("[ERROR] " + message);
|
|
47
|
+
if (program && logDiagnostic) {
|
|
48
|
+
logError(program, message);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function findJavaVersion(output) {
|
|
53
|
+
const regex = /javac (\d+)\.(\d+)\..*/;
|
|
54
|
+
const matches = output.match(regex);
|
|
55
|
+
if (matches && matches.length > 2) {
|
|
56
|
+
if (matches[1] === "1") {
|
|
57
|
+
// "javac 1.8.0_422" -> 8
|
|
58
|
+
return +matches[2];
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
// "javac 21.0.3" -> 21
|
|
62
|
+
return +matches[1];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/validate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,CAAC,MAAM,qBAAqB,GAChC,sLAAsL,CAAC;AAEzL,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAA4B,EAC5B,gBAAyB,KAAK;;IAE9B,wBAAwB;IACxB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC1E,MAAM,WAAW,GAAG,MAAA,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,mCAAI,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrF,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,WAAW,GAAG,EAAE,EAAE,CAAC;gBACrB,8DAA8D;gBAC9D,8BAA8B;gBAC9B,MAAM,OAAO,GAAG,iDAAiD,WAAW,uIAAuI,CAAC;gBACpN,yCAAyC;gBACzC,qCAAqC;gB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