@brunoluizdesiqueira/bbuilder-cli 1.0.3 → 1.0.5
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 +14 -5
- package/package.json +1 -1
package/dist/build/compiler.js
CHANGED
|
@@ -75,13 +75,25 @@ 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
|
+
});
|
|
89
|
+
}
|
|
78
90
|
async function runCgrc(opts, projectName) {
|
|
79
91
|
const tempDir = path.join(os.tmpdir(), `BimerBuild_${projectName}`);
|
|
80
92
|
const vrcFile = path.join(tempDir, `${projectName}.vrc`);
|
|
81
93
|
const resFile = path.join(tempDir, `${projectName}.res`);
|
|
82
94
|
(0, output_1.step)('Compilando recursos e embutindo ícone...');
|
|
83
95
|
try {
|
|
84
|
-
await (
|
|
96
|
+
await runWindowsCommand(path.win32.join(opts.delphiDir, 'bin', 'cgrc.exe'), [vrcFile, `-fo${resFile}`]);
|
|
85
97
|
}
|
|
86
98
|
catch {
|
|
87
99
|
(0, output_1.fatal)('Falha do compilador CGRC ao gerar o arquivo de recursos .res.');
|
|
@@ -124,10 +136,7 @@ async function runDcc64(opts, projectName, workspaceDir) {
|
|
|
124
136
|
`${projectName}.dpr`,
|
|
125
137
|
];
|
|
126
138
|
try {
|
|
127
|
-
await (
|
|
128
|
-
cwd: workspaceDir,
|
|
129
|
-
stdio: 'inherit',
|
|
130
|
-
});
|
|
139
|
+
await runWindowsCommand(dcc64, args, workspaceDir);
|
|
131
140
|
}
|
|
132
141
|
catch {
|
|
133
142
|
(0, output_1.fatal)('Falha na compilação do Delphi. Verifique os logs de erro acima.');
|