You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
increment version from 1.0.2 to 1.1.0
updated README.md
rewrote dependency collection mechanism
support auto-collection of more dependencies from local WebCTRL installations
support auto-collection of dependencies from an external website
added 'depend [--all]' command for triggering dependency recollection
added jar files to default .gitignore
removed config.txt from default .gitignore
added listener and welcome-file-list to default deployment descriptor
added `override` variable which allows extensions to invoke base commands they override (if any)
added support for an optional startup script
implemented fail-fast compilation
Copy file name to clipboardExpand all lines: README.md
+56-12Lines changed: 56 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,30 @@
2
2
3
3
WebCTRL is a trademark of Automated Logic Corporation. Any other trademarks mentioned herein are the property of their respective owners.
4
4
5
-
[This script](Utility.bat) may be used to automate certain aspects of *WebCTRL* add-on development on *Windows* operating systems. *WebCTRL SDK* dependencies are automatically collected from a local *WebCTRL* installation. Commands are provided for add-on compilation and packaging. Keystore management is automatic, so you don't have to worry about manually signing your *.addon* file.
5
+
-[Add-On Development Script for WebCTRL](#add-on-development-script-for-webctrl)
[This script](Utility.bat) may be used to automate certain aspects of *WebCTRL* add-on development on *Windows* operating systems. *Windows* version 10 or greater is required. *WebCTRL SDK* dependencies are automatically collected from a local *WebCTRL* installation. Other dependencies may be automatically downloaded from URLs. Commands are provided for add-on compilation and packaging. Keystore management is automatic, so you don't have to worry about manually signing your *.addon* file. Newly created projects are scaffolded by the script to contain all required files.
1. Install the most recent [*JDK*](https://jdk.java.net/)release.
12
29
13
30
1. Install [*Visual Studio Code*](https://code.visualstudio.com/) and the following extensions:
14
31
@@ -28,7 +45,7 @@ WebCTRL is a trademark of Automated Logic Corporation. Any other trademarks men
28
45
29
46
- If the script cannot locate a *WebCTRL* installation folder under *%SystemDrive%*, you will be prompted to specify an installation path.
30
47
31
-
- The script will automatically retrieve all [runtime dependencies](#dependency-collection) from this *WebCTRL* installation.
48
+
- The script will automatically retrieve all [runtime dependencies](#dependencies) from this *WebCTRL* installation.
32
49
33
50
- You will be prompted to enter a keystore password and a few other parameters for creating a new keystore. Refer to [Keystore Management](#keystore-management) for more details.
34
51
@@ -52,6 +69,7 @@ The following commands may be used to automate add-on compilation and packaging.
52
69
| - | - |
53
70
|`help`| Displays a help message listing these commands with brief descriptions. |
54
71
|`cls`| Clears the terminal. |
72
+
|`depend [--all]`| Attempts to collect missing dependencies. Recollects all dependencies if the `--all` flag is given. |
55
73
|`init [--new]`| Reinitializes the current project if no parameters are given. Prompts you to initialize a new project if the `--new` flag is given. |
56
74
|`build [args]`| Compiles source code. The last modified timestamp for each *.java* file is recorded to avoid unnecessary recompilation. Arguments are passed to the `javac` compilation command. Arguments are stored for future invokation, so you only have to type them once. The default compilation flag is `--release 11`. |
57
75
|`pack`| Packages all relevant files into a newly created *.addon* archive. |
@@ -64,7 +82,11 @@ The following commands may be used to automate add-on compilation and packaging.
64
82
65
83
## Extensions
66
84
67
-
Custom project-specific commands can be created to extend the functionality of this script. For examples, refer to <https://github.com/automatic-controls/centralizer-for-webctrl/tree/main/ext>. Any batch file placed in *./ext* is treated as an extension. The name of each batch file is used as the command name (case-insensitive). It is expected that each extension prints help information to the terminal when passed the `--help` parameter. Help information is appended to the help menu shown in the terminal. The default commands shown in the previous section can be overridden by extensions. For instance, <https://github.com/automatic-controls/centralizer-for-webctrl/blob/main/ext/pack.bat> overrides the default `pack` command.
85
+
Custom project-specific commands can be created to extend the functionality of this script. For examples, refer to <https://github.com/automatic-controls/centralizer-for-webctrl/tree/main/ext>. Any batch file placed in *./ext* is treated as an extension. The name of each batch file is used as the command name (case-insensitive). It is expected that each extension prints help information to the terminal when passed the `--help` parameter. Help information is appended to the help menu shown in the terminal.
86
+
87
+
The default commands shown in the previous section can be overridden by extensions. For instance, <https://github.com/automatic-controls/commissioning-scripts/blob/main/ext/pack.bat> overrides the default `pack` command. This example also shows how to invoke the overridden packing command (akin to the `super` keyword in Java).
88
+
89
+
An optional script, `./startup.bat`, is invoked whenever a project folder is loaded. This may be used for any additional setup required for project files after cloning a remote repository to your local device.
68
90
69
91
## Generated Project Structure
70
92
@@ -74,28 +96,32 @@ Custom project-specific commands can be created to extend the functionality of t
74
96
|*./.gitignore*| Tells *Git* what to ignore when committing files. |
75
97
|*./Utility.bat*| Script to automate builds. |
76
98
|*./README.md*| User-friendly information about the project. |
77
-
|*./DEPENDENCIES*| Record all compile-time dependencies. |
|*./root/webapp/WEB-INF/lib*| Contains dependencies **not** provided by *WebCTRL* at runtime. |
89
114
|*./lib*| Contains project-specific dependencies provided by *WebCTRL* at runtime. |
90
115
|*./ext*| Contains [extensions](#extensions) that provide additional commands. |
116
+
|*./startup.bat*| Batch script which is executed whenever the project folder is loaded. |
91
117
92
118
## Manual Deployment
93
119
94
120
1. Place the authentication certificate (look for a file with the *.cer* extension in your local clone of this repository) into the *./addons* directory of the target *WebCTRL* installation.
95
121
96
122
1. Use the *WebCTRL* interface to install the *.addon* archive of your project.
97
123
98
-
## Dependency Collection
124
+
## Dependencies
99
125
100
126
Runtime dependencies are located in *./lib* relative to your local clone of this repository. These dependencies do not need to be packaged into your *.addon* file because they are provided by *WebCTRL* at runtime. Other external dependencies should be placed in *./root/webapp/WEB-INF/lib* relative to your project folder. The following runtime dependencies are collected from your *WebCTRL* installation:
101
127
@@ -109,7 +135,25 @@ Runtime dependencies are located in *./lib* relative to your local clone of this
If you change the *WebCTRL* installation by manually editing *./config.txt* (relative to your local clone of this repository), then you should delete *./lib* to force dependency recollection. Feel free to browse your *WebCTRL* installation for dependencies that give access to other internal APIs if these defaults are insufficient. If you would like to add a *WebCTRL* API to one project folder without affecting any other projects, the *.jar* file should be placed in *./lib* relative to your project folder.
138
+
Feel free to browse your *WebCTRL* installation for dependencies that give access to other internal APIs if these defaults are insufficient. If you would like to add a *WebCTRL* API to one project folder without affecting any other projects, the *.jar* file should be placed in *./lib* relative to your project folder. This is also the folder where source jars should be placed for external dependencies (source jars do not need to be packaged into the add-on; however, they are useful for intellisense and documentation).
139
+
140
+
### Automated Collection
141
+
142
+
There are three files which define automatic dependency collection. The first is [*./DEPENDENCIES*](./DEPENDENCIES) relative to your local clone of this repository. This file defines global runtime dependencies used by every project (e.g, the *WebCTRL SDK*). The other two files are [*./config/EXTERNAL_DEPS*](https://github.com/automatic-controls/commissioning-scripts/blob/main/config/EXTERNAL_DEPS) and [*./config/RUNTIME_DEPS*](https://github.com/automatic-controls/commissioning-scripts/blob/main/config/RUNTIME_DEPS) relative to each project folder (click the links for an example).
143
+
144
+
Dependencies specified by *EXTERNAL_DEPS* are placed in *./root/webapp/WEB-INF/lib*. Dependencies specified by *RUNTIME_DEPS* are placed in *./lib*. Dependency collection automatically occurs whenever a project folder is loaded, or it can be manually triggered with the [`depend`](#command-reference) command.
145
+
146
+
Each dependency list adheres to the same file format. Two schemes currently exist for collecting dependencies. The `file` scheme searches for a dependency located in your *WebCTRL* installation. The `url` scheme downloads a dependency from a website (using [`curl`](https://curl.se/windows/microsoft.html)). See the example:
The general format is `scheme:identifier:location`. For files, the location is a relative path to the folder in your *WebCTRL* installation which contains the dependency. For urls, the location is a direct download link. The identifier should be the first part of the dependency's filename (excluding the version). Dependency filenames are generally expected to match the regular expression `^identifier-\d.*\.jar$`.
113
157
114
158
## Keystore Management
115
159
@@ -123,9 +167,9 @@ The generated 2048-bit RSA key-pair is valid for 100 years, uses SHA512 as the s
123
167
124
168
## Known Issues
125
169
126
-
### Automatic Collection of External Dependencies
170
+
### Recursive Dependency Collection
127
171
128
-
Recursive dependency collection from *Maven* repositories is not supported. *POM* files are commonly used by other compilation scripts for such purposes.
172
+
Recursive dependency collection from *Maven* repositories is not supported. *POM* files are commonly used by other compilation scripts for such purposes. For this development tool, you must manually specify the URL to download each required dependency individually.
0 commit comments