@brunoluizdesiqueira/bbuilder-cli 1.0.3 → 1.0.4
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/build/compiler.js +15 -5
- package/package.json +1 -1
package/dist/build/compiler.js
CHANGED
|
@@ -75,13 +75,26 @@ function buildDependencies(opts) {
|
|
|
75
75
|
// dcc64 fail to resolve paths such as the Delphi runtime library.
|
|
76
76
|
return opts.dependencyPaths.join(';');
|
|
77
77
|
}
|
|
78
|
+
function quoteForCmd(value) {
|
|
79
|
+
if (!value)
|
|
80
|
+
return '""';
|
|
81
|
+
return `"${value.replace(/"/g, '""')}"`;
|
|
82
|
+
}
|
|
83
|
+
async function runWindowsCommand(executable, args, cwd) {
|
|
84
|
+
const command = [quoteForCmd(executable), ...args.map(quoteForCmd)].join(' ');
|
|
85
|
+
await (0, execa_1.default)('cmd.exe', ['/d', '/s', '/c', command], {
|
|
86
|
+
cwd,
|
|
87
|
+
stdio: 'inherit',
|
|
88
|
+
windowsVerbatimArguments: true,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
78
91
|
async function runCgrc(opts, projectName) {
|
|
79
92
|
const tempDir = path.join(os.tmpdir(), `BimerBuild_${projectName}`);
|
|
80
93
|
const vrcFile = path.join(tempDir, `${projectName}.vrc`);
|
|
81
94
|
const resFile = path.join(tempDir, `${projectName}.res`);
|
|
82
95
|
(0, output_1.step)('Compilando recursos e embutindo ícone...');
|
|
83
96
|
try {
|
|
84
|
-
await (
|
|
97
|
+
await runWindowsCommand(path.win32.join(opts.delphiDir, 'bin', 'cgrc.exe'), [vrcFile, `-fo${resFile}`]);
|
|
85
98
|
}
|
|
86
99
|
catch {
|
|
87
100
|
(0, output_1.fatal)('Falha do compilador CGRC ao gerar o arquivo de recursos .res.');
|
|
@@ -124,10 +137,7 @@ async function runDcc64(opts, projectName, workspaceDir) {
|
|
|
124
137
|
`${projectName}.dpr`,
|
|
125
138
|
];
|
|
126
139
|
try {
|
|
127
|
-
await (
|
|
128
|
-
cwd: workspaceDir,
|
|
129
|
-
stdio: 'inherit',
|
|
130
|
-
});
|
|
140
|
+
await runWindowsCommand(dcc64, args, workspaceDir);
|
|
131
141
|
}
|
|
132
142
|
catch {
|
|
133
143
|
(0, output_1.fatal)('Falha na compilação do Delphi. Verifique os logs de erro acima.');
|