|
1 | 1 | # relsvr-rap Command-Line Usage Guide |
2 | 2 |
|
3 | | -The `relsvr-rap` CLI tool builds Relativity Application Package (RAP) files from source assemblies and custom pages. |
| 3 | +The `relsvr-rap` CLI builds Relativity Application Package (RAP) files from your application schema, assemblies, and custom pages. |
4 | 4 |
|
5 | 5 | ## Command Syntax |
6 | 6 |
|
7 | | -``` |
8 | | -relsvr-rap build --source <path> --input <file> --version <version> --relativity-server-release <year> [--warnings-as-errors] [--log-file <path>] [--log-level <level>] |
| 7 | +```text |
| 8 | +relsvr-rap build --source <path> --input <file> --version <version> --relativity-server-release <year> [--warnings-as-errors <true|false>] [--log-file <path>] [--log-level <level>] |
9 | 9 | ``` |
10 | 10 |
|
11 | 11 | ## Parameters |
12 | 12 |
|
13 | 13 | | Parameter | Required | Type | Description | |
14 | 14 | |-----------|----------|------|-------------| |
15 | | -| `--source` | Yes | String | The root directory of the repository containing your RAP source files. All paths in the input build XML file are relative to this directory. | |
16 | | -| `--input` | Yes | String | Path to the build configuration XML file (e.g., `build.xml`) that defines the RAP structure, assemblies, custom pages, and resources. Path can be relative to `--source` or absolute. | |
17 | | -| `--version` | Yes | String | The application version number to assign to the RAP package (e.g., `1.0.0.0`). This is the RAP version, NOT the Relativity application schema version. | |
18 | | -| `--relativity-server-release` | Yes | Integer | The version of Relativity Server that the RAP targets. Use: `2024`, `2025`, etc. Determines which SDK versions are used for validation. `2024` is the minimum version. | |
19 | | -| `--warnings-as-errors` | No | Boolean | **Default: true**. When enabled, validation warnings cause the build to fail. Set to `false` to treat warnings as non-fatal. | |
20 | | -| `--log-file` | No | String | File path where build logs should be written (e.g., `Artifacts/Logs/build.log`). If not specified, logs only appear in console output. | |
21 | | -| `--log-level` | No | String | Sets the logging verbosity. Values: `Debug`, `Information`, `Warning`, `Error`, `Fatal`. Default is `Information`. | |
| 15 | +| └──source` | Yes | String | Repository root for the RAP build. Paths inside the input XML are resolved from this directory. | |
| 16 | +| └──input` | Yes | String | Path to the RAP build XML (for example, `DevelopmentScripts\build.xml`). Can be absolute or relative to └──source`. | |
| 17 | +| └──version` | Yes | String | RAP package version (for example, `1.0.0.0`). | |
| 18 | +| └──relativity-server-release` | Yes | Integer | Target Relativity Server release year (for example, `2024`, `2025`). | |
| 19 | +| └──warnings-as-errors` | No | Boolean | Treat warnings as build failures when set to `true`. | |
| 20 | +| └──log-file` | No | String | File path for build logs (for example, `Artifacts\Logs\rapbuild.log`). | |
| 21 | +| └──log-level` | No | String | Logging verbosity. Typical values: `Debug`, `Information`, `Warning`, `Error`, `Fatal`. | |
22 | 22 |
|
23 | | -## Command-Line Examples |
| 23 | +## Quick Start for This Repository |
24 | 24 |
|
25 | | -### Basic Build |
| 25 | +From the repo root (`server-sample-rap`): |
| 26 | + |
| 27 | +```powershell |
| 28 | +relsvr-rap build ` |
| 29 | +Sour --source "C:\Projects\MyRelativityApp" ` |
| 30 | + --input "DevelopmentScripts\build.xml" ` |
| 31 | + --version "1.0.0.0" ` |
| 32 | + --relativity-server-release 2024 ` |
| 33 | + --log-file "Artifacts\Logs\rapbuild.log" |
26 | 34 | ``` |
| 35 | + |
| 36 | +The repository build script (`build.ps1`) already runs this command after restore/build steps. |
| 37 | + |
| 38 | +## Additional Examples |
| 39 | + |
| 40 | +### Basic Build |
| 41 | + |
| 42 | +```powershell |
27 | 43 | relsvr-rap build --source C:\MyApp --input DevelopmentScripts\build.xml --version 1.0.0.0 --relativity-server-release 2025 |
28 | 44 | ``` |
29 | 45 |
|
30 | | -### Build with Logging |
31 | | -``` |
32 | | -relsvr-rap build --source C:\MyApp --input build.xml --version 1.2.3.4 --relativity-server-release 2024 --log-file Artifacts\Logs\build.log |
33 | | -``` |
| 46 | +### Disable Warnings-As-Errors |
34 | 47 |
|
35 | | -### Build with Warnings as Errors Disabled |
36 | | -``` |
37 | | -relsvr-rap build --source C:\MyApp --input build.xml --version 2.0.0.0 --relativity-server-release 2025 --warnings-as-errors false |
| 48 | +```powershell |
| 49 | +relsvr-rap build --source C:\MyApp --input DevelopmentScripts\build.xml --version 2.0.0.0 --relativity-server-release 2025 --warnings-as-errors false |
38 | 50 | ``` |
39 | 51 |
|
40 | | -### Complete Example with All Options |
41 | | -``` |
| 52 | +### Full Example |
| 53 | + |
| 54 | +```powershell |
42 | 55 | relsvr-rap build ` |
43 | 56 | --source "C:\Projects\MyRelativityApp" ` |
44 | 57 | --input "DevelopmentScripts\build.xml" ` |
45 | 58 | --version "1.5.0.0" ` |
46 | 59 | --relativity-server-release 2025 ` |
47 | 60 | --warnings-as-errors false ` |
48 | | - --log-file "Artifacts\Logs\rap-build.log" ` |
| 61 | + --log-file "Artifacts\Logs\rapbuild.log" ` |
49 | 62 | --log-level Debug |
50 | 63 | ``` |
51 | 64 |
|
52 | | -## Example Repository Structure |
| 65 | +## Expected Repository Layout |
53 | 66 |
|
54 | | -Here's a typical repository layout for a RAP project with assemblies and a custom page: |
55 | | - |
56 | | -``` |
| 67 | +```text |
57 | 68 | MyRelativityApplication/ |
58 | 69 | ├── DevelopmentScripts/ |
59 | | -│ └── build.xml # RAP build configuration |
| 70 | +| └── build.xml |
60 | 71 | ├── ApplicationsXML/ |
61 | | -│ └── application.xml # Relativity application schema |
| 72 | +| └── application.xml |
62 | 73 | ├── Source/ |
63 | | -│ ├── MyApp/ # Main application assembly project |
64 | | -│ │ ├── MyApp.csproj |
65 | | -│ │ ├── bin/ |
66 | | -│ │ │ └── Debug/ |
67 | | -│ │ │ └── MyApp.dll # Main assembly to include in RAP |
68 | | -│ │ ├── Agents/ |
69 | | -│ │ │ └── MyAgent.cs |
70 | | -│ │ ├── EventHandlers/ |
71 | | -│ │ │ └── InstallHandler.cs |
72 | | -│ │ └── Services/ |
73 | | -│ │ └── MyService.cs |
74 | | -│ │ |
75 | | -│ ├── MyApp.CustomPage/ # Custom page (ASP.NET MVC/Blazor) |
76 | | -│ │ ├── MyApp.CustomPage.csproj |
77 | | -| | ├── MyApp.CustomPage |
78 | | -│ │ │ └── MyApp.CustomPage.dll |
79 | | -│ │ │ └── Views/ |
80 | | -│ │ │ ├── Home/ |
81 | | -│ │ │ │ └── Index.cshtml |
82 | | -│ │ │ └── Shared/ |
83 | | -│ │ │ └── _Layout.cshtml |
84 | | -│ │ ├── bin/ |
85 | | -│ │ │ └── Debug/ |
86 | | -│ │ │ └── MyApp.CustomPage.dll |
87 | | -│ │ ├── Controllers/ |
88 | | -│ │ │ └── HomeController.cs |
89 | | -│ │ ├── Views/ |
90 | | -│ │ │ ├── Home/ |
91 | | -│ │ │ │ └── Index.cshtml |
92 | | -│ │ │ └── Shared/ |
93 | | -│ │ │ └── _Layout.cshtml |
94 | | -│ │ ├── Content/ |
95 | | -│ │ │ ├── styles.css |
96 | | -│ │ │ └── logo.png |
97 | | -│ │ └── App_Start/ |
98 | | -│ │ ├── RouteConfig.cs |
99 | | -│ │ └── BundleConfig.cs |
100 | | -│ |
101 | | -├── Artifacts/ # Build output (created during build) |
102 | | -│ ├── Logs/ |
103 | | -│ │ ├── buildsummary.log |
104 | | -│ │ └── builderrors.log |
105 | | -│ ├── NuGet/ |
106 | | -│ │ └── MyRelativityApplication.1.0.0-local.nupkg |
107 | | -│ └── MyRelativityApplication.rap # Final RAP package |
| 74 | +| ├── MyApp/ |
| 75 | +| | ├── MyApp.csproj |
| 76 | +| | └── bin/ |
| 77 | +| | └── MyApp.dll |
| 78 | +| └── MyApp.CustomPage/ |
| 79 | +| ├── MyApp.CustomPage.csproj |
| 80 | +| ├── Controllers/ |
| 81 | +| ├── Views/ |
| 82 | +| └── MyApp.CustomPage/ |
| 83 | +└── Artifacts/ |
| 84 | + ├── Logs/ |
| 85 | + └── MyRelativityApplication.rap |
108 | 86 | ``` |
109 | 87 |
|
110 | 88 | ## build.xml Configuration |
111 | 89 |
|
112 | | -The build XML file referenced by `--input` should follow this structure: |
| 90 | +The XML file provided to └──input` defines what goes into the RAP package. |
113 | 91 |
|
114 | 92 | ```xml |
115 | | -<?xml version="1.0" encoding="UTF-8"?> |
116 | 93 | <BuildTools> |
117 | 94 | <RAPBuilder> |
118 | 95 | <Applications> |
119 | | - <Application name="MyRelativityApplication" generatenuspec="true"> |
120 | | - <!-- Output path for the RAP file --> |
121 | | - <Destination>Artifacts\MyRelativityApplication.rap</Destination> |
122 | | - |
123 | | - <!-- Path to the application schema XML --> |
| 96 | + <Application name="SampleRap"> |
| 97 | + <Destination>Artifacts\SampleRap.rap</Destination> |
124 | 98 | <ApplicationSchema>ApplicationsXML/application.xml</ApplicationSchema> |
125 | 99 |
|
126 | | - <!-- Assembly DLLs to include in RAP --> |
127 | 100 | <Assemblies> |
128 | | - <Assembly>Source\MyApp\bin\MyApp.dll</Assembly> |
129 | | - <Assembly>Source\MyApp.Verifier\bin\MyApp.Verifier.dll</Assembly> |
130 | | - <!-- Include any Relativity SDK dependencies that aren't built-in --> |
131 | | - <Assembly>Source\MyApp.Verifier\bin\Relativity.Core.dll</Assembly> |
| 101 | + <Assembly>Source\SampleRap\bin\SampleRap.dll</Assembly> |
132 | 102 | </Assemblies> |
133 | 103 |
|
134 | | - <!-- Optional: Resource files (images, documents, etc.) --> |
135 | | - <ResourceFiles> |
136 | | - <ResourceFile>Source\MyApp\Resources\logo.png</ResourceFile> |
137 | | - <ResourceFile>Source\MyApp\Resources\documentation.pdf</ResourceFile> |
138 | | - </ResourceFiles> |
| 104 | + <ResourceFiles /> |
139 | 105 |
|
140 | | - <!-- Custom page definition with its unique GUID --> |
141 | 106 | <CustomPages> |
142 | | - <CustomPage guid="f28fb91d-16ea-40f3-b869-a08b1cd7159c"> |
143 | | - Source\MyApp.CustomPage\MyApp.CustomPage |
144 | | - </CustomPage> |
| 107 | + <CustomPage guid="a412cfce-098d-4339-96ba-72933ac2e707">Source\SampleRap.CustomPage\SampleRap.CustomPage</CustomPage> |
145 | 108 | </CustomPages> |
146 | 109 | </Application> |
147 | 110 | </Applications> |
148 | 111 | </RAPBuilder> |
149 | 112 | </BuildTools> |
150 | 113 | ``` |
151 | 114 |
|
152 | | -## application.xml Schema File |
| 115 | +## application.xml Alignment Requirements |
153 | 116 |
|
154 | | -The `application.xml` file (referenced in build.xml) must match your build definition. The easiest way to |
155 | | -generate the application.xml file is to export the applicaiton schema from Relativity. Key sections: |
| 117 | +The `application.xml` schema must stay aligned with `build.xml`. |
156 | 118 |
|
157 | | -```xml |
158 | | -<?xml version="1.0" encoding="UTF-8"?> |
159 | | -<Application xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
160 | | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
161 | | - <DeploymentTarget>Server</DeploymentTarget> |
162 | | - |
163 | | - <!-- List of assemblies (must match build.xml) --> |
164 | | - <Assemblies> |
165 | | - <Assembly> |
166 | | - <Name>MyApp.dll</Name> |
167 | | - <ArtifactId>1000001</ArtifactId> |
168 | | - </Assembly> |
169 | | - <Assembly> |
170 | | - <Name>MyApp.Verifier.dll</Name> |
171 | | - <ArtifactId>1000002</ArtifactId> |
172 | | - </Assembly> |
173 | | - </Assemblies> |
174 | | - |
175 | | - <!-- Application metadata --> |
176 | | - <Name>MyRelativityApplication</Name> |
177 | | - <Guid>6374418f-6fd2-474e-8ce6-b22c046b4212</Guid> |
178 | | - <Version>1.0.0.0</Version> |
179 | | - |
180 | | - <!-- Custom pages (GUIDs must match build.xml) --> |
181 | | - <CustomPages> |
182 | | - <CustomPage> |
183 | | - <Guid>f28fb91d-16ea-40f3-b869-a08b1cd7159c</Guid> |
184 | | - <Name>MyApplication Page</Name> |
185 | | - <FileName>MyApp.CustomPage.zip</FileName> |
186 | | - </CustomPage> |
187 | | - </CustomPages> |
188 | | - |
189 | | - <!-- Define agents, event handlers, and other components --> |
190 | | - <AgentTypes> |
191 | | - <AgentType> |
192 | | - <AgentTypeName>My Custom Agent</AgentTypeName> |
193 | | - <FullNameSpace>MyApp.Agents.MyAgent</FullNameSpace> |
194 | | - </AgentType> |
195 | | - </AgentTypes> |
196 | | -</Application> |
197 | | -``` |
| 119 | +- Assembly names in `application.xml` must match assemblies included in `build.xml`. |
| 120 | +- Custom page GUIDs must match exactly between both files. |
| 121 | +- The application name/version metadata should reflect the package you are building. |
| 122 | + |
| 123 | +The easiest way to create `application.xml` is exporting the application schema from Relativity and then validating that it matches your build inputs. |
198 | 124 |
|
199 | 125 | ## Build Output |
200 | 126 |
|
201 | | -After running the build command, the following artifacts are created: |
| 127 | +After a successful build in this repository: |
202 | 128 |
|
203 | | -``` |
| 129 | +```text |
204 | 130 | Artifacts/ |
205 | 131 | ├── Logs/ |
206 | | -│ ├── buildsummary.log # General build information |
207 | | -│ ├── builderrors.log # Errors only |
208 | | -│ └── {assembly}.{framework}.TestResults.xml # Test results (if tests run) |
209 | | -├── NuGet/ |
210 | | -│ └── MyApp.1.0.0-local.nupkg # NuGet package |
211 | | -└── MyApp.rap # Final RAP package (ZIP-based) |
| 132 | +| ├── buildsummary.log |
| 133 | +| ├── builderrors.log |
| 134 | +| └── rapbuild.log |
| 135 | +└── SampleRap.rap |
212 | 136 | ``` |
213 | 137 |
|
| 138 | +`SampleRap.rap` is the deployable package. |
| 139 | + |
214 | 140 | ## Common Errors and Solutions |
215 | 141 |
|
216 | 142 | | Error | Cause | Solution | |
217 | 143 | |-------|-------|----------| |
218 | | -| "Source directory does not exist" | Invalid `--source` path | Verify path exists and is accessible | |
219 | | -| "Project input file does not exist" | Invalid `--input` path | Ensure build.xml exists at specified location | |
220 | | -| "Assembly not found in schema" | Assembly in build.xml but not in application.xml | Add missing assembly to application.xml | |
221 | | -| "Custom page GUID mismatch" | GUID in build.xml differs from application.xml | Ensure GUIDs match exactly | |
222 | | -| "SDK version validation failed" | Assembly incompatible with target Relativity version | Check Relativity Server 2024/2025 SDK compatibility | |
| 144 | +| `relsvr-rap` is not recognized | Tool not installed or not on `PATH` | Install the tool and ensure your shell can resolve `relsvr-rap` | |
| 145 | +| Source directory does not exist | Invalid └──source` path | Verify the path exists and is readable | |
| 146 | +| Project input file does not exist | Invalid └──input` path | Ensure `DevelopmentScripts\build.xml` exists at the specified location | |
| 147 | +| Assembly not found in schema | `build.xml` and `application.xml` are out of sync | Add/update the assembly entry in `application.xml` | |
| 148 | +| Custom page GUID mismatch | GUID differs between files | Ensure the same GUID is used in both files | |
223 | 149 |
|
224 | 150 | ## Return Codes |
225 | 151 |
|
226 | | -- `0` — Success |
227 | | -- `1` — General error (file not found, invalid path, etc.) |
228 | | -- `4` — RAPBuilderException (validation or build logic error) |
| 152 | +- `0` Success |
| 153 | +- `1` General error (for example, bad path or missing file) |
| 154 | +- `4` RAPBuilder validation/build logic error |
0 commit comments