Skip to content

Commit

Permalink
target launch, rnv run for tizen fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
justinasRm committed Sep 18, 2024
1 parent df17178 commit 1f73719
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
21 changes: 15 additions & 6 deletions packages/sdk-tizen/src/deviceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ const formatXMLObject = (
return {};
};

export const launchTizenEmulator = async (name: string | true): Promise<boolean> => {
export const launchTizenEmulator = async (name: string | true, hideDevices?: boolean): Promise<boolean> => {
const c = getContext();
logDefault(`launchTizenEmulator:${name}`);

if (name === true) {
const emulators = await execCLI(CLI_TIZEN_EMULATOR, 'list-vm');
const devices = await execCLI(CLI_SDB_TIZEN, 'devices');
Expand All @@ -86,7 +85,9 @@ export const launchTizenEmulator = async (name: string | true): Promise<boolean>

const lines = specificEmulators.concat(devicesArr);

const targetsArray = lines.map((line) => ({ id: line, name: line }));
const targetsArray = hideDevices
? specificEmulators.map((line) => ({ id: line, name: line }))
: lines.map((line) => ({ id: line, name: line }));

const choices = _composeDevicesString(targetsArray);

Expand All @@ -105,7 +106,7 @@ export const launchTizenEmulator = async (name: string | true): Promise<boolean>
// if ip is chosen, real device boot should start
logInfo('Connecting to device');
c.runtime.target = name.split(':')[0];
await runTizenSimOrDevice();
await runTizenSimOrDevice(true);
return new Promise(() => logInfo('Device is launched.'));
}
try {
Expand Down Expand Up @@ -348,7 +349,7 @@ const _composeDevicesString = (devices: Array<Pick<TizenDevice, 'id' | 'name'>>)
// }
// };

export const runTizenSimOrDevice = async () => {
export const runTizenSimOrDevice = async (onlyRun?: true | null) => {

Check failure on line 352 in packages/sdk-tizen/src/deviceManager.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

'onlyRun' is defined but never used. Allowed unused args must match /^_/u
const c = getContext();
const { target } = c.runtime;
const { platform } = c;
Expand Down Expand Up @@ -382,8 +383,11 @@ export const runTizenSimOrDevice = async () => {
let deviceID: string;

if (!tId) return Promise.reject(`Tizen platform requires "id" filed in platforms.tizen`);

const askForEmulator = async () => {
if (!target) {
launchTizenEmulator(true);
return;
}
const { startEmulator } = await inquirerPrompt({
name: 'startEmulator',
type: 'confirm',
Expand Down Expand Up @@ -424,6 +428,11 @@ Please create one and then edit the default target from ${c.paths.workspace.dir}
const continueLaunching = async () => {
let hasDevice = false;

// if (onlyRun) {
// await execCLI(CLI_TIZEN, `run -p ${tId} -t ${deviceID}`);
// return true;
// }

await execCLI(CLI_TIZEN, `build-web -- "${tBuild}" -out "${intermediate}"`);
await execCLI(CLI_TIZEN, `package -- "${intermediate}" -s ${certProfile} -t wgt -o "${tOut}"`);

Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-tizen/src/tasks/taskTargetLaunch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default createTask({
await checkAndConfigureTizenSdks();
const target = await getTargetWithOptionalPrompt();
await checkTizenSdk();
return launchTizenEmulator(target);
return launchTizenEmulator(target, true);
},
task: RnvTaskName.targetLaunch,
options: [RnvTaskOptions.target],
Expand Down
6 changes: 1 addition & 5 deletions packages/template-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,5 @@
"browserslist": [
">0.2%",
"op_mini all"
],
"dependencies": {
"dotenv": "16.4.5",
"raf": "3.4.1"
}
]
}

0 comments on commit 1f73719

Please sign in to comment.