Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit b2900e4

Browse files
authored
Echo Generator (#856)
* Echo Generator * Generator project cleanup * Added Empty template for generator. Updated README * Generator review changes * Renamed Generator template "tree" folder to "project" * Generator review changes, fixed bug with spaces in artifactId set in POM * Corrected units tests not running in generator templates
1 parent 6078dfa commit b2900e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+5176
-7894
lines changed

Generator/generator-botbuilder-java/.editorconfig

Lines changed: 0 additions & 11 deletions
This file was deleted.

Generator/generator-botbuilder-java/.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

Generator/generator-botbuilder-java/.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

Generator/generator-botbuilder-java/.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

Generator/generator-botbuilder-java/.yo-rc.json

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
The MIT License (MIT)
1+
MIT License
22

3-
Copyright (c) 2018 Microsoft
3+
Copyright (c) 2018 Microsoft Corporation
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99
copies of the Software, and to permit persons to whom the Software is
1010
furnished to do so, subject to the following conditions:
1111

12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1414

1515
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 104 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,120 @@
1-
# generator-botbuilder-java [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
2-
> Template to create conversational bots in Java using Microsoft Bot Framework.
1+
# generator-botbuilder-java
2+
3+
Yeoman generator for [Bot Framework v4](https://dev.botframework.com). Will let you quickly set up a conversational AI bot
4+
using core AI capabilities.
5+
6+
## About
7+
8+
`generator-botbuilder-java` will help you build new conversational AI bots using the [Bot Framework v4](https://dev.botframework.com).
9+
10+
## Templates
11+
12+
The generator supports three different template options. The table below can help guide which template is right for you.
13+
14+
| Template | Description |
15+
| ---------- | --------- |
16+
| Echo Bot | A good template if you want a little more than "Hello World!", but not much more. This template handles the very basics of sending messages to a bot, and having the bot process the messages by repeating them back to the user. This template produces a bot that simply "echoes" back to the user anything the user says to the bot. |
17+
| Empty Bot | A good template if you are familiar with Bot Framework v4, and simply want a basic skeleton project. Also a good option if you want to take sample code from the documentation and paste it into a minimal bot in order to learn. |
18+
19+
### How to Choose a Template
20+
21+
| Template | When This Template is a Good Choice |
22+
| -------- | -------- |
23+
| Echo Bot | You are new to Bot Framework v4 and want a working bot with minimal features. |
24+
| Empty Bot | You are a seasoned Bot Framework v4 developer. You've built bots before, and want the minimum skeleton of a bot. |
25+
26+
### Template Overview
27+
28+
#### Echo Bot Template
29+
30+
The Echo Bot template is slightly more than the a classic "Hello World!" example, but not by much. This template shows the basic structure of a bot, how a bot recieves messages from a user, and how a bot sends messages to a user. The bot will "echo" back to the user, what the user says to the bot. It is a good choice for first time, new to Bot Framework v4 developers.
31+
32+
#### Empty Bot Template
33+
34+
The Empty Bot template is the minimal skeleton code for a bot. It provides a stub `onTurn` handler but does not perform any actions. If you are experienced writing bots with Bot Framework v4 and want the minimum scaffolding, the Empty template is for you.
335

436
## Installation
537

6-
First, install [Yeoman](http://yeoman.io) and generator-botbuilder-java using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).
38+
1. Install [Yeoman](http://yeoman.io) using [npm](https://www.npmjs.com) (we assume you have pre-installed [node.js](https://nodejs.org/)).
39+
40+
```bash
41+
# Make sure both are installed globally
42+
npm install -g yo
43+
```
44+
45+
2. Install generator-botbuilder-java by typing the following in your console:
46+
47+
```bash
48+
# Make sure both are installed globally
49+
npm install -g generator-botbuilder-java
50+
```
51+
52+
3. Verify that Yeoman and generator-botbuilder-java have been installed correctly by typing the following into your console:
53+
54+
```bash
55+
yo botbuilder-java --help
56+
```
57+
58+
## Usage
59+
60+
### Creating a New Bot Project
61+
62+
When the generator is launched, it will prompt for the information required to create a new bot.
763

864
```bash
9-
npm install -g yo
10-
npm install -g generator-botbuilder-java
65+
# Run the generator in interactive mode
66+
yo botbuilder-java
1167
```
1268

13-
Then generate your new project:
69+
### Generator Command Line Options
70+
71+
The generator supports a number of command line options that can be used to change the generator's default options or to pre-seed a prompt.
72+
73+
| Command line Option | Description |
74+
| ------------------- | ----------- |
75+
| --help, -h | List help text for all supported command-line options |
76+
| --botName, -N | The name given to the bot project |
77+
| --packageName, -P | The Java package name to use for the bot |
78+
| --template, -T | The template used to generate the project. Options are `empty`, or `echo`. See [https://aka.ms/botbuilder-generator](https://aka.ms/botbuilder-generator) for additional information regarding the different template option and their functional differences. |
79+
| --noprompt | The generator will not prompt for confirmation before creating a new bot. Any requirement options not passed on the command line will use a reasonable default value. This option is intended to enable automated bot generation for testing purposes. |
80+
81+
#### Example Using Command Line Options
82+
83+
This example shows how to pass command line options to the generator, setting the default language to TypeScript and the default template to Core.
1484
1585
```bash
16-
yo botbuilder-java
86+
# Run the generator defaulting the pacakge name and the template
87+
yo botbuilder-java --P "com.mycompany.bot" --T "echo"
1788
```
1889
19-
## Getting To Know Yeoman
90+
### Generating a Bot Using --noprompt
2091
21-
* Yeoman has a heart of gold.
22-
* Yeoman is a person with feelings and opinions, but is very easy to work with.
23-
* Yeoman can be too opinionated at times but is easily convinced not to be.
24-
* Feel free to [learn more about Yeoman](http://yeoman.io/).
92+
The generator can be run in `--noprompt` mode, which can be used for automated bot creation. When run in `--noprompt` mode, the generator can be configured using command line options as documented above. If a command line option is ommitted a reasonable default will be used. In addition, passing the `--noprompt` option will cause the generator to create a new bot project without prompting for confirmation before generating the bot.
2593
26-
## License
94+
#### Default Options
2795
28-
MIT © [Microsoft]()
96+
| Command line Option | Default Value |
97+
| ------------------- | ----------- |
98+
| --botname, -N | `echo` |
99+
| --packageName, -p | `echo` |
100+
| --template, -T | `echo` |
101+
102+
#### Examples Using --noprompt
103+
104+
This example shows how to run the generator in --noprompt mode, setting all required options on the command line.
105+
106+
```bash
107+
# Run the generator, setting all command line options
108+
yo botbuilder-java --noprompt -N "MyEchoBot" -P "com.mycompany.bot.echo" -T "echo"
109+
```
110+
111+
This example shows how to run the generator in --noprompt mode, using all the default command line options. The generator will create a bot project using all the default values specified in the **Default Options** table above.
112+
113+
```bash
114+
# Run the generator using all default options
115+
yo botbuilder-java --noprompt
116+
```
29117
118+
## Logging Issues and Providing Feedback
30119
31-
[npm-image]: https://badge.fury.io/js/generator-botbuilder-java.svg
32-
[npm-url]: https://npmjs.org/package/generator-botbuilder-java
33-
[travis-image]: https://travis-ci.org/Microsoft/generator-botbuilder-java.svg?branch=master
34-
[travis-url]: https://travis-ci.org/Microsoft/generator-botbuilder-java
35-
[daviddm-image]: https://david-dm.org/Microsoft/generator-botbuilder-java.svg?theme=shields.io
36-
[daviddm-url]: https://david-dm.org/Microsoft/generator-botbuilder-java
37-
[coveralls-image]: https://coveralls.io/repos/Microsoft/generator-botbuilder-java/badge.svg
38-
[coveralls-url]: https://coveralls.io/r/Microsoft/generator-botbuilder-java
120+
Issues and feedback about the botbuilder generator can be submitted through the project's [GitHub Issues](https://github.com/Microsoft/botbuilder-samples/issues) page.

Generator/generator-botbuilder-java/__tests__/app.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)