s32ds-clean-and-rebuild
Clean all build artifacts and perform a full rebuild from scratch. Triggers project clean, waits for the clean job to finish, then starts an incremental build and waits for completion. Finally verifie
Files1
View on GitHubSKILL.mdskills/s32ds/s32ds-clean-and-rebuild/SKILL.md
GitHubClean and Rebuild Project
Goal
Perform a clean build to resolve stale artifacts or inconsistent build state.
Tools Used
search_actions- call FIRST to discover available actions; the returned catalog includes each action's input schemaexecute_action- invoke any discovered action viaexecute_action(action_name="X", params={...}); the staticstart_toolaction brings the IDE up if it is not running- The
waitForJobaction (viaexecute_action) - blocks until a named async job completes
Before You Start
Call search_actions(query="...") first to discover all available actions, their descriptions, and input schemas (a parameterless search_actions() browses everything). Use the returned catalog to determine correct action names and required/optional parameters before calling execute_action.
Steps
Get project info and location:
- Use
execute_action(action_name="getProjectInfo", params={"projectName": "<name>"})-> note thelocationfield
- Use
MANDATORY: Recursively search for .mex files:
- Search the entire project directory tree for files with
.mexextension .mexfiles can be anywhere (root, subfolders, nested deep)- If ANY .mex file exists -> skip steps 3-4 and use step 2b instead
2b. Clean then Update Code and Build (for .mex projects):
- Use
execute_action(action_name="cleanProject", params={"projectName": "<name>"}) - Wait for clean to finish:
execute_action(action_name="waitForJob", params={"jobName": "Clean", "timeoutMs": 30000}) - Select the project first:
execute_action(action_name="selectProject", params={"projectName": "<name>"}) - Then:
execute_action(action_name="executeCommand", params={"commandId": "com.nxp.swtools.framework.updateCodeAndBuildProject"}) - Wait for build to finish:
execute_action(action_name="waitForJob", params={"jobName": "Build", "timeoutMs": 120000}) - Handle edge case - command only generated code without building:
- If
waitForJobreturnsmatched=0(no "Building" job was found), the command only performed code generation and did NOT trigger a build. - In this case, explicitly start the build:
execute_action(action_name="buildProject", params={"projectName": "<name>"}) - Then wait for it to complete:
execute_action(action_name="waitForJob", params={"jobName": "Build", "timeoutMs": 120000})
- If
- You MUST select the project first, otherwise the command silently does nothing!
- This regenerates code AND rebuilds - skip to step 5.
- Search the entire project directory tree for files with
Clean the project (only if NO .mex files):
- Use
execute_action(action_name="cleanProject", params={"projectName": "<name>"}) - Wait for clean to finish:
execute_action(action_name="waitForJob", params={"jobName": "Clean", "timeoutMs": 30000})
- Use
Rebuild (only if NO .mex files):
- Use
execute_action(action_name="buildProject", params={"projectName": "<name>"}) - Wait for build to finish:
execute_action(action_name="waitForJob", params={"jobName": "Build", "timeoutMs": 120000})
- Use
Verify build health:
- Use
execute_action(action_name="getProblems", params={"projectName": "<name>", "severity": "error"}) - Only check problems AFTER
waitForJobconfirms the build has completed - If zero errors -> build succeeded
- If errors persist after clean build -> they are real code issues, not stale artifacts
- Use
Guardrails
Scope
- Act only on the project the user named. Never clean or rebuild an unrelated project as a side effect.
Destructive actions
- Clean deletes build artifacts. Confirm the target project first, and never clean a project the user did not explicitly ask about.
Resource limits
- Wait for the clean job to finish before starting the build; do not spawn parallel or overlapping build jobs on the same project.
Refuse-and-escalate
- If the named project is not found or is closed, stop and ask the user to confirm/open it rather than acting on a guessed project.
When to Use
After switching build configurations (Debug ↔ Release)
After modifying include paths or compiler settings
When incremental build produces inconsistent results
After pulling changes from version control