Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add action to build objects in project explorer and source orbit #634

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/assets/ProjectExplorer_11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/ProjectExplorer_13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/ProjectExplorer_15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/ProjectExplorer_41.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/ProjectExplorer_42.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 22 additions & 2 deletions docs/pages/ibm-i-projects/iproj-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,31 @@ PASE command line used to build this entire project.
> - `{path}` resolves to the full IFS path corresponding to the source in the editor.
> - `{host}` resolves to the IBM i hostname.
> - `{usrprf}` the user profile that the command will be executed under.
> - `{branch}` resolves to the name of the current git branch if this project is managed by git.
> - `{branch}` resolves to the name of the current git branch if this project is managed by Git.

### buildObjectCommand

PASE command line used to build a specific object in this project.

> The following substitution variables are supported:
> - `{object}` resolves to the base object name.
> - `{filename}` resolves to the base file name being edited.
> - `{path}` resolves to the full IFS path corresponding to the source in the editor.
> - `{host}` resolves to the IBM i hostname.
> - `{usrprf}` the user profile that the command will be executed under.
> - `{branch}` resolves to the name of the current git branch if this project is managed by Git.

### compileCommand

PASE command line used to compile a specific source file in this project. The same substitution parameters used in the `buildCommand` are supported.
PASE command line used to compile a specific source file in this project.

> The following substitution variables are supported:
> - `{filename}` resolves to the base file name being edited.
> - `{files}` resolves to the list of files being selected or the active editor.
> - `{path}` resolves to the full IFS path corresponding to the source in the editor.
> - `{host}` resolves to the IBM i hostname.
> - `{usrprf}` the user profile that the command will be executed under.
> - `{branch}` resolves to the name of the current git branch if this project is managed by Git.

### extensions

Expand Down
18 changes: 15 additions & 3 deletions docs/pages/projectExplorer/run-builds-compiles-and-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,29 @@ The build or compiles of a project are based on the `buildCommand` and `compileC

Before running a build, the project's build command must be set. This can be done using the **Set Build Command** action on the project. Here you can leverage any build tool such as `elias` in ARCAD Builder or `makei` in `ibmi-bob`.

![Set Build Command](../../assets/ProjectExplorer_11.png)
![Set Build Command](../../assets/ProjectExplorer_11.png ':size=500')

To then launch a build, use the **Run Build** action on the project heading or the `ctrl+shift+b` shortcut (`cmd+shift+b` on Mac). This will first deploy the project and then invoke the build command. To view the output of this build process, navigate to the **Output** view and select the **IBM i Output** channel.

![Run Build](../../assets/ProjectExplorer_12.png)

In the case you want to simply build a specific object in your project, you can set your project's build object command using the **Set Build Object Command** action on the project.

![Set Build Object Command](../../assets/ProjectExplorer_41.png ':size=500')

To then build a target object, locate the object under the **Library List** or **Object Libraries** and use the right-click **Run Build Object** action.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the menu item would be better as 'Build Object', this is different than 'Run Build' which implies running the full build. I know this means redoing some screen caps, but I believe it would be an improvement


> [!NOTE]
>
> This action can also be performed on objects under the [Source Orbit heading](https://ibm.github.io/sourceorbit/#/./pages/extension/index?id=ibm-i-project-explorer-integration) in **Project Explorer** as well as on objects in both [impacted object views](https://ibm.github.io/sourceorbit/#/./pages/extension/index?id=view-impacted-objects) provided by Source Orbit (**Source Impacts** and **Change Impacts**).

![Run Build Object](../../assets/ProjectExplorer_42.png ':size=500')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer Build Object


## Run a Compile

Similar to the build command, the project's compile command must be first set using the **Set Compile Compile** action on the project.

![Set Compile Command](../../assets/ProjectExplorer_13.png)
![Set Compile Command](../../assets/ProjectExplorer_13.png ':size=500')

To compile a directory or file, this can be achieved from several locations:

Expand All @@ -29,7 +41,7 @@ To compile a directory or file, this can be achieved from several locations:

An alternative to using the build or compile command is to leverage the use of Code for IBM i workspace actions. These actions are stored in `.vscode/actions.json` at the root of the project and should be pushed to the Git repository. To generate an initial `actions.json` file, use the **Launch Action Setup** action on the project. Here you will be prompted to select from a set of pre-defined actions.

![Launch Action Setup](../../assets/ProjectExplorer_15.png)
![Launch Action Setup](../../assets/ProjectExplorer_15.png ':size=500')

Refer to the example below of having setup a project to use `ibmi-bob`:

Expand Down
9 changes: 7 additions & 2 deletions l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
"From: {0}/{1}:{2}": "From: {0}/{1}:{2}",
"To: {0}/{1}/{2}/{3}:{4}": "To: {0}/{1}/{2}/{3}:{4}",
"Cannot parse \"{0}\" as a date object": "Cannot parse \"{0}\" as a date object",
"Project's build object command not set": "Project's build object command not set",
"Set Build Object Command": "Set Build Object Command",
"Project's build command not set": "Project's build command not set",
"Set Build Command": "Set Build Command",
"Project's compile command not set": "Project's compile command not set",
"Set Compile Command": "Set Compile Command",
"Build object command already set to {0}": "Build object command already set to {0}",
"Build command already set to {0}": "Build command already set to {0}",
"Compile command already set to {0}": "Compile command already set to {0}",
"No iproj.json found": "No iproj.json found",
Expand Down Expand Up @@ -117,10 +120,12 @@
"Refresh IBM i Project Explorer after deploy location changes": "Refresh IBM i Project Explorer after deploy location changes",
"Disconnect IBM i Projects": "Disconnect IBM i Projects",
"Failed to retrieve project": "Failed to retrieve project",
"Enter build command ({0} resolves to the base file name being edited. {1} resolves to the full IFS path corresponding to the source in the editor. {2} resolves to the IBM i hostname. {3} resolves to the user profile that the command will be executed under. {4} resolves to the name of the current git branch if this project is managed by git.)": "Enter build command ({0} resolves to the base file name being edited. {1} resolves to the full IFS path corresponding to the source in the editor. {2} resolves to the IBM i hostname. {3} resolves to the user profile that the command will be executed under. {4} resolves to the name of the current git branch if this project is managed by git.)",
"Enter build command ({0} resolves to the base file name being edited. {1} resolves to the full IFS path corresponding to the source in the editor. {2} resolves to the IBM i hostname. {3} resolves to the user profile that the command will be executed under. {4} resolves to the name of the current git branch if this project is managed by Git.)": "Enter build command ({0} resolves to the base file name being edited. {1} resolves to the full IFS path corresponding to the source in the editor. {2} resolves to the IBM i hostname. {3} resolves to the user profile that the command will be executed under. {4} resolves to the name of the current git branch if this project is managed by Git.)",
"Build command": "Build command",
"Enter build object command ({0} resolves to the base object name. {1} resolves to the base file name being edited. {2} resolves to the full IFS path corresponding to the source in the editor. {3} resolves to the IBM i hostname. {4} resolves to the user profile that the command will be executed under. {5} resolves to the name of the current git branch if this project is managed by Git.)": "Enter build object command ({0} resolves to the base object name. {1} resolves to the base file name being edited. {2} resolves to the full IFS path corresponding to the source in the editor. {3} resolves to the IBM i hostname. {4} resolves to the user profile that the command will be executed under. {5} resolves to the name of the current git branch if this project is managed by Git.)",
"Build object command": "Build object command",
"Failed to retrieve file to compile": "Failed to retrieve file to compile",
"Enter compile command ({0} resolves to the base file name being edited. {1} resolves to the full IFS path corresponding to the source in the editor. {2} resolves to the IBM i hostname. {3} resolves to the user profile that the command will be executed under. {4} resolves to the name of the current git branch if this project is managed by git.)": "Enter compile command ({0} resolves to the base file name being edited. {1} resolves to the full IFS path corresponding to the source in the editor. {2} resolves to the IBM i hostname. {3} resolves to the user profile that the command will be executed under. {4} resolves to the name of the current git branch if this project is managed by git.)",
"Enter compile command ({0} resolves to the base file name being edited. {1} resolves to the full IFS path corresponding to the source in the editor. {2} resolves to the IBM i hostname. {3} resolves to the user profile that the command will be executed under. {4} resolves to the name of the current git branch if this project is managed by Git.)": "Enter compile command ({0} resolves to the base file name being edited. {1} resolves to the full IFS path corresponding to the source in the editor. {2} resolves to the IBM i hostname. {3} resolves to the user profile that the command will be executed under. {4} resolves to the name of the current git branch if this project is managed by Git.)",
"Compile command": "Compile command",
"Select a project": "Select a project",
"Compare": "Compare",
Expand Down
44 changes: 41 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,16 @@
"command": "vscode-ibmi-projectexplorer.projectExplorer.setBuildCommand",
"title": "%commands.projectExplorer.setBuildCommand%"
},
{
"category": "%commands.projectExplorer%",
"command": "vscode-ibmi-projectexplorer.projectExplorer.runBuildObject",
"title": "%commands.projectExplorer.runBuildObject%"
},
{
"category": "%commands.projectExplorer%",
"command": "vscode-ibmi-projectexplorer.projectExplorer.setBuildObjectCommand",
"title": "%commands.projectExplorer.setBuildObjectCommand%"
},
{
"category": "%commands.projectExplorer%",
"command": "vscode-ibmi-projectexplorer.projectExplorer.runCompile",
Expand Down Expand Up @@ -840,6 +850,14 @@
"command": "vscode-ibmi-projectexplorer.projectExplorer.setBuildCommand",
"when": "vscode-ibmi-projectexplorer:hasActiveProject"
},
{
"command": "vscode-ibmi-projectexplorer.projectExplorer.runBuildObject",
"when": "vscode-ibmi-projectexplorer:hasActiveProject"
},
{
"command": "vscode-ibmi-projectexplorer.projectExplorer.setBuildObjectCommand",
"when": "vscode-ibmi-projectexplorer:hasActiveProject"
},
{
"command": "vscode-ibmi-projectexplorer.projectExplorer.runCompile",
"when": "code-for-ibmi:connected && vscode-ibmi-projectexplorer:hasActiveProject"
Expand Down Expand Up @@ -1274,14 +1292,19 @@
"group": "0_setup@0"
},
{
"command": "vscode-ibmi-projectexplorer.projectExplorer.setCompileCommand",
"command": "vscode-ibmi-projectexplorer.projectExplorer.setBuildObjectCommand",
"when": "view == projectExplorer && viewItem =~ /^project.*/",
"group": "0_setup@1"
},
{
"command": "vscode-ibmi-projectexplorer.projectExplorer.setCompileCommand",
"when": "view == projectExplorer && viewItem =~ /^project.*/",
"group": "0_setup@2"
},
{
"command": "vscode-ibmi-projectexplorer.projectExplorer.launchActionsSetup",
"when": "view == projectExplorer && viewItem =~ /^project.*/ && code-for-ibmi:connected",
"group": "0_setup@2"
"group": "0_setup@3"
},
{
"command": "vscode-ibmi-projectexplorer.projectExplorer.setActiveProject",
Expand Down Expand Up @@ -1563,10 +1586,15 @@
"when": "view == projectExplorer && viewItem =~ /^library(?!List).*/",
"group": "2_objectActions@0"
},
{
"command": "vscode-ibmi-projectexplorer.projectExplorer.runBuildObject",
"when": "view == projectExplorer && code-for-ibmi:connected && viewItem =~ /^(objectFile|ileObject).*/",
"group": "1_actions@0"
},
{
"command": "vscode-ibmi-projectexplorer.runAction",
"when": "view == projectExplorer && viewItem =~ /^objectFile.*/",
"group": "1_actions@0"
"group": "1_actions@1"
},
{
"command": "vscode-ibmi-projectexplorer.changeObjectDescription",
Expand Down Expand Up @@ -1767,6 +1795,16 @@
"command": "vscode-ibmi-projectexplorer.jobLog.showAllObjects",
"when": "view == jobLog && viewItem =~ /^log.*/ && viewItem =~ /^.*_showAllObjects.*/",
"group": "1_filter@0"
},
{
"command": "vscode-ibmi-projectexplorer.projectExplorer.runBuildObject",
"when": "view == activeImpactView && code-for-ibmi:connected && viewItem =~ /^ileObject.*/",
"group": "1_actions@0"
},
{
"command": "vscode-ibmi-projectexplorer.projectExplorer.runBuildObject",
"when": "view == gitImpactView && code-for-ibmi:connected && viewItem =~ /^ileObject.*/",
"group": "1_actions@0"
}
]
},
Expand Down
2 changes: 2 additions & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"commands.projectExplorer.renameMember": "Rename Member",
"commands.projectExplorer.renameObject": "Rename Object",
"commands.projectExplorer.runBuild": "Run Build",
"commands.projectExplorer.runBuildObject": "Run Build Object",
"commands.projectExplorer.runCompile": "Run Compile",
"commands.projectExplorer.runAction": "Run Action",
"commands.projectExplorer.searchSourceFile": "Search Source File",
Expand All @@ -88,6 +89,7 @@
"commands.projectExplorer.setAsCurrentLibrary": "Set as Current Library",
"commands.projectExplorer.setAsTargetLibraryForCompiles": "Set as Target Library for Compiles",
"commands.projectExplorer.setBuildCommand": "Set Build Command",
"commands.projectExplorer.setBuildObjectCommand": "Set Build Object Command",
"commands.projectExplorer.setCompileCommand": "Set Compile Command",
"commands.projectExplorer.setCurrentLibrary": "Set Current Library",
"commands.projectExplorer.setDeployLocation": "Set Deploy Location",
Expand Down
8 changes: 6 additions & 2 deletions schema/iproj.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,15 @@
},
"buildCommand": {
"type": "string",
"description": "PASE command line used to build this entire project. The following substitution variables are supported:\n {filename} resolves to the base file name being edited.\n {path} resolves to the full IFS path corresponding to the source in the editor.\n {host} resolves to the IBM i hostname.\n {usrprf} the user profile that the command will be executed under.\n {branch} resolves to the name of the current git branch if this project is managed by git."
"markdownDescription": "PASE command line used to build this entire project.\n\nThe following substitution variables are supported:\n * `{filename}` resolves to the base file name being edited.\n * `{path}` resolves to the full IFS path corresponding to the source in the editor.\n * `{host}` resolves to the IBM i hostname.\n * `{usrprf}` the user profile that the command will be executed under.\n * `{branch}` resolves to the name of the current git branch if this project is managed by Git."
},
"buildObjectCommand": {
"type": "string",
"markdownDescription": "PASE command line used to build a specific object in this project.\n\nThe following substitution variables are supported:\n * `{object}` resolves to the base object name.\n * `{filename}` resolves to the base file name being edited.\n * `{path}` resolves to the full IFS path corresponding to the source in the editor.\n * `{host}` resolves to the IBM i hostname.\n * `{usrprf}` the user profile that the command will be executed under.\n * `{branch}` resolves to the name of the current git branch if this project is managed by Git."
},
"compileCommand": {
"type": "string",
"description": "PASE command line used to compile a specific source file in this project. The following substitution variables are supported:\n {filename} resolves to the base file name being edited.\n {files} resolves to the list of files being selected or the active editor.\n {path} resolves to the full IFS path corresponding to the source in the editor.\n {host} resolves to the IBM i hostname.\n {usrprf} the user profile that the command will be executed under.\n {branch} resolves to the name of the current git branch if this project is managed by git."
"markdownDescription": "PASE command line used to compile a specific source file in this project.\n\nThe following substitution variables are supported:\n * `{filename}` resolves to the base file name being edited.\n * `{files}` resolves to the list of files being selected or the active editor.\n * `{path}` resolves to the full IFS path corresponding to the source in the editor.\n * `{host}` resolves to the IBM i hostname.\n * `{usrprf}` the user profile that the command will be executed under.\n * `{branch}` resolves to the name of the current git branch if this project is managed by Git."
},
"extensions": {
"type": "object",
Expand Down
Loading
Loading