Skip to content

Commit b410121

Browse files
authored
feat: structured build settings information (#291)
* feat: structured build log * changeset
1 parent d06dbe9 commit b410121

File tree

4 files changed

+22
-17
lines changed

4 files changed

+22
-17
lines changed

.changeset/little-kiwis-count.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@rnef/platform-apple-helpers': patch
3+
'@rnef/platform-android': patch
4+
---
5+
6+
feat: structured build settings information

packages/platform-android/src/lib/commands/runGradle.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,13 @@ export async function runGradle({
4242
return;
4343
}
4444
const humanReadableTasks = tasks.join(', ');
45+
46+
logger.log(`Build Settings:
47+
Variant ${color.bold(args.variant)}
48+
Tasks ${color.bold(humanReadableTasks)}`);
49+
4550
const loader = spinner({ indicator: 'timer' });
46-
const message = `Building the app with Gradle using ${humanReadableTasks} ${
47-
tasks.length > 1 ? 'tasks' : 'task'
48-
}.`;
51+
const message = `Building the app`;
4952

5053
loader.start(message);
5154
const gradleArgs = getTaskNames(androidProject.appName, tasks);
@@ -76,11 +79,7 @@ export async function runGradle({
7679

7780
try {
7881
await spawn(gradleWrapper, gradleArgs, { cwd: androidProject.sourceDir });
79-
loader.stop(
80-
`Built the app with Gradle using ${humanReadableTasks} ${
81-
tasks.length > 1 ? 'tasks' : 'task'
82-
}.`
83-
);
82+
loader.stop(`Built the app`);
8483
} catch (error) {
8584
loader.stop('Failed to build the app');
8685
const cleanedErrorMessage = getCleanedErrorMessage(

packages/platform-apple-helpers/src/lib/commands/build/buildProject.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from 'node:path';
22
import type { SubprocessError } from '@rnef/tools';
3-
import { logger, RnefError, spawn, spinner } from '@rnef/tools';
3+
import { color, logger, RnefError, spawn, spinner } from '@rnef/tools';
44
import type { ApplePlatform, XcodeProjectInfo } from '../../types/index.js';
55
import { getBuildPaths } from '../../utils/getBuildPaths.js';
66
import { supportedPlatforms } from '../../utils/supportedPlatforms.js';
@@ -157,10 +157,13 @@ export const buildProject = async ({
157157
xcodebuildArgs.push(...args.extraParams);
158158
}
159159

160+
logger.log(`Build Settings:
161+
Scheme ${color.bold(scheme)}
162+
Configuration ${color.bold(configuration)}`);
163+
160164
const loader = spinner({ indicator: 'timer' });
161-
const message = `${
162-
args.archive ? 'Archiving' : 'Building'
163-
} the app with xcodebuild for ${scheme} scheme in ${configuration} configuration`;
165+
166+
const message = `${args.archive ? 'Archiving' : 'Building'} the app`;
164167

165168
loader.start(message);
166169
try {
@@ -174,11 +177,7 @@ export const buildProject = async ({
174177
}
175178

176179
await process;
177-
loader.stop(
178-
`${
179-
args.archive ? 'Archived' : 'Built'
180-
} the app with xcodebuild for ${scheme} scheme in ${configuration} configuration.`
181-
);
180+
loader.stop(`${args.archive ? 'Archived' : 'Built'} the app.`);
182181
} catch (error) {
183182
if ((error as SubprocessError).stderr.trim() === '') {
184183
loader.stop(

packages/platform-apple-helpers/src/lib/utils/getInfo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export async function getInfo(
4141
const info = parseTargetList(stdout);
4242

4343
if (!info) {
44+
loader.stop('Failed: Gathering Xcode project information', 1);
4445
throw new RnefError('Failed to get Xcode project information');
4546
}
4647

0 commit comments

Comments
 (0)