Skip to content

Commit bb45fdd

Browse files
authored
Merge pull request #1 from Watson-Personal-Assistant/esilky-agc-readme-2018-05
Update the README.
2 parents 01618ea + 8d18953 commit bb45fdd

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

README.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,42 @@ $ mvn package
3737
## Development and Debugging (ability to use Eclipse IDE)
3838
**For deployment to a device (e.g. Raspberry Pi) the Maven build must be run from the command line (to create a correctly configured JAR)**
3939

40-
For development and debugging - an `Eclipse project` has been created. Using a dedicated Java IDE like Eclipse can provide significant benefits during development (and especially debugging). The Eclipse project is configured to function as a Maven Project/Build. This means you can edit, build, and debug directly from Eclipse. Remote debugging is also possible. The Maven build is configured with debug information, so if you run the client on the Raspberry Pi in debug mode you can connect to it from Eclipse and debug interactively.
40+
# Instructions for Eclipse
41+
These instructions are for Eclipse, but those of you that use other IDE's can probably adapt to these instuctions.
4142

42-
An example command to run the client in remote debug mode is:
43-
`sudo java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -jar wpa-1.4-SNAPSHOT.jar`
44-
In Eclipse, simply configure a 'Debug Configuration' that specifies the IP address and port of the target and the main class: `Driver`
43+
For development and debugging - an `Eclipse project` has been created. Find it as `.project` in the main folder.
4544

46-
The `start` directory contains startup scripts for both debug and non-debug modes.
45+
Using a dedicated Java IDE like Eclipse can provide significant benefits during development (and especially debugging). The Eclipse project is configured to function as a Maven Project/Build. This means you can edit, build, and debug directly from Eclipse. Remote debugging is also possible. The Maven build is configured with debug information, so if you run the client on the Raspberry Pi in debug mode you can connect to it from Eclipse and debug interactively.
4746

48-
If you are setting this up for the first time, it means you will need to create an Eclipse Workspace or use an existing Workspace. Import the Eclipse project from this directory into the Workspace.
47+
Create a new workspace and import the project (as an existing Eclipse project).
4948

50-
To Run/Debug directly from Eclipse (on the local machine) you will need to set up a local Run/Debug configuration. The main requirement for this is that you will need to indicate that the working directory is the `target/` directory and make sure that it includes a properly configured `configure.properties` file (the Eclipse build does not put one there, so if a 'clean' build is performed there will not be a `configure.properties` file in the directory. If the `configure.properties` file doesn't exist the client should announce that to you (a good test really...).
49+
You can run and debug the client within Eclipse - just set up a 'Run/Debug' configuration with the main class of 'Driver'.
50+
51+
To debug remotely on the Raspberry Pi:
52+
An example command to run the client in remote debug mode is:
53+
`sudo java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -jar wpa-1.4-SNAPSHOT.jar`
54+
In Eclipse, simply configure a 'Debug Configuration' that specifies the IP address and port of the target and the main class: `Driver`
55+
56+
The `start` directory contains startup scripts for both debug and non-debug modes. These scripts can be copied to the `watson` directory on the device.
57+
58+
To Run/Debug directly from Eclipse (on the local machine) you will need to set up a local Run/Debug configuration. The main requirement for this is that you will need to indicate that the working directory is the `target/` directory and make sure that the config directory includes a properly configured `configure.properties` file (the Eclipse build does not put one there, so if a 'clean' build is performed there will not be a `configure.properties` file in the directory. If the `configure.properties` file doesn't exist in the `config` directory the client should announce that to you (a good test really...).
5159

5260
*(as we find and resolve problems with the Eclipse project, we will add to this section - for example, a 'clean' build will delete 'target', so we probably want a build step to copy a `configure.properties` in at the end of the build.)*
5361

5462

5563
## Deploy
56-
Copy the jar (created using the `maven package` command) from the `target/` directory to the device, e.g.
64+
Our standard deployment to a device is into the ~/watson directory.
65+
66+
Copy the jar (created using the `maven package` command) from the `target/` directory on your local system to the device `~/watson` directory, e.g.
5767

5868
```
59-
$ scp target/wpa-1.4-SNAPSHOT.jar pi@192.168.1.15:~/watson
69+
$ scp target/wpa-1.4-SNAPSHOT.jar pi@192.168.1.101:~/watson
6070
```
6171

62-
6372
## Run
64-
Copy `configure.properties.example` to `configure.properties` and copy it to the device `~/watson`. Provide configuration and credential information and options by editing the following properties:
73+
Copy `configure.properties.example` to `configure.properties` into the the `~/watson/config` directory of the device. Provide configuration and credential information and options by editing the following properties:
74+
75+
The `start` directory contains startup scripts for both debug and non-debug modes. These scripts can be copied to the `watson` directory on the device.
6576

6677
### Required Connection Information
6778
* `host` The URL of the Audio Gateway server (should NOT include the protocol prefix such as "https://")

src/main/java/Driver.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ private static Properties readProps() {
111111
// Just return a null properties...
112112
} finally {
113113
try {
114-
file.close();
114+
if (null != file) {
115+
file.close();
116+
}
115117
} catch (IOException e) { }
116118
}
117119
return props;

0 commit comments

Comments
 (0)