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

Commit 87621a0

Browse files
committed
Merge branch 'master' into emimunoz/53-action-preview
2 parents 7fbad50 + b8d9447 commit 87621a0

File tree

352 files changed

+17072
-7540
lines changed

Some content is hidden

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

352 files changed

+17072
-7540
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
[![Build Status](https://travis-ci.org/Microsoft/botbuilder-java.svg?branch=master)](https://travis-ci.org/Microsoft/botbuilder-java)
77
[![Coverage Status](https://coveralls.io/repos/github/microsoft/botbuilder-java/badge.svg?branch=823847c676b7dbb0fa348a308297ae375f5141ef)](https://coveralls.io/github/microsoft/botbuilder-java?branch=823847c676b7dbb0fa348a308297ae375f5141ef)
88
[![roadmap badge](https://img.shields.io/badge/visit%20the-roadmap-blue.svg)](https://github.com/Microsoft/botbuilder-java/wiki/Roadmap)
9+
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Microsoft/botbuilder-java/blob/master/LICENSE)
10+
[![Gitter](https://img.shields.io/gitter/room/Microsoft/BotBuilder.svg)](https://gitter.im/Microsoft/BotBuilder)
911

1012
This repository contains code for the Java version of the Microsoft Bot Framework SDK. The Bot Framework SDK v4 enable developers to model conversation and build sophisticated bot applications.
1113

@@ -31,7 +33,7 @@ contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additio
3133

3234
This project uses linting rules to enforce code standardization. These rules are specified in the file [bot-checkstyle.xml](./etc/bot-checkstyle.xml) with [CheckStyle](https://checkstyle.org/) and are hooked to Maven's build cycle.
3335

34-
**INFO**: Since the CheckStyle plugin is hook to the build cycle, this makes the build **fail** in case there are linting warnings in the project files so be sure to check that the code doesn't break any rule.
36+
**INFO**: Since the CheckStyle and PMD plugins are hooked into the build cycle, this makes the build **fail** in cases where there are linting warnings in the project files. Errors will be in the file ./target/checkstyle-result.xml and ./target/pmd.xml.
3537

3638
CheckStyle is available in different flavours:
3739
- [Visual Studio Code plugin](https://marketplace.visualstudio.com/items?itemName=shengchen.vscode-checkstyle)
@@ -41,6 +43,32 @@ CheckStyle is available in different flavours:
4143

4244
**INFO**: Be sure to configure your IDE to use the file [bot-checkstyle.xml](./etc/bot-checkstyle.xml) instead of the default rules.
4345

46+
## Build and IDE
47+
48+
Any IDE that can import and work with Maven projects should work. As a matter of practice we use the command line to perform Maven builds. If your IDE can be configured to defer build and run to Maven it should also work.
49+
- Java
50+
- We use the [Azul JDK 8](https://www.azul.com/downloads/azure-only/zulu/?version=java-8-lts&architecture=x86-64-bit&package=jdk) to build and test with. While not a requirement to develop the SDK with, it is recommended as this is what Azure is using for Java 1.8. If you do install this JDK, make sure your IDE is targeting that JVM, and your path (from command line) and JAVA_HOME point to that.
51+
52+
- Visual Studio Code
53+
- Extensions
54+
- Java Extension Pack by Microsoft
55+
- Checkstyle for Java by ShengChen (Optional)
56+
- EditorConfig for VS Code by EditorConfig (Recommended)
57+
- Recommended setup
58+
- Open the settings for "Language Support for Java by RedHat" and set:
59+
- Java > Format > Settings: Profile = "BotFramework"
60+
- Java > Format > Settings: Url = "etc/botframework-java-formatter.xml"
61+
- This will format the code (on command) to BotFramework style.
62+
63+
- IntelliJ
64+
- Extensions
65+
- Checkstyle by IDEA
66+
- Eclipse Code Formatter by Vojtech-Krasa (Recommended)
67+
- Recommended setup
68+
- When importing the SDK for the first time, make sure "Auto import" is checked.
69+
- If the Eclipse Code Formatter was installed:
70+
- Got to Settings > Other Settings -> Eclipse Code Formatter, and set the formatter config file to etc/botframework-java-formatter.xml
71+
4472
## Reporting Security Issues
4573

4674
Security issues and bugs should be reported privately, via email, to the Microsoft Security

etc/bot-checkstyle.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@
6969

7070
<!-- Miscellaneous other checks. -->
7171
<!-- See http://checkstyle.sourceforge.net/config_misc.html -->
72-
<module name="RegexpSingleline">
72+
<!-- <module name="RegexpSingleline">
7373
<property name="format" value="\s+$"/>
7474
<property name="minimum" value="0"/>
7575
<property name="maximum" value="0"/>
7676
<property name="message" value="Line has trailing spaces."/>
77-
</module>
77+
</module> -->
7878

7979
<!-- Checks for Headers -->
8080
<!-- See http://checkstyle.sourceforge.net/config_header.html -->

etc/botframework-java-formatter.xml

Lines changed: 365 additions & 0 deletions
Large diffs are not rendered by default.

libraries/bot-builder/src/main/java/com/microsoft/bot/builder/ActivityHandler.java

Lines changed: 308 additions & 202 deletions
Large diffs are not rendered by default.

libraries/bot-builder/src/main/java/com/microsoft/bot/builder/AutoSaveStateMiddleware.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import java.util.concurrent.CompletableFuture;
88

99
/**
10-
* Middleware to automatically call .SaveChanges() at the end of the turn for all BotState class it is managing.
10+
* Middleware to automatically call .SaveChanges() at the end of the turn for
11+
* all BotState class it is managing.
1112
*/
1213
public class AutoSaveStateMiddleware implements Middleware {
1314
/**
@@ -67,15 +68,16 @@ public AutoSaveStateMiddleware add(BotState botState) {
6768
}
6869

6970
/**
70-
* Middleware implementation which calls savesChanges automatically at the end of the turn.
71+
* Middleware implementation which calls savesChanges automatically at the end
72+
* of the turn.
7173
*
7274
* @param turnContext The context object for this turn.
73-
* @param next The delegate to call to continue the bot middleware pipeline.
75+
* @param next The delegate to call to continue the bot middleware
76+
* pipeline.
7477
* @return A task representing the asynchronous operation.
7578
*/
7679
@Override
7780
public CompletableFuture<Void> onTurn(TurnContext turnContext, NextDelegate next) {
78-
return next.next()
79-
.thenCompose(result -> botStateSet.saveAllChanges(turnContext));
81+
return next.next().thenCompose(result -> botStateSet.saveAllChanges(turnContext));
8082
}
8183
}

libraries/bot-builder/src/main/java/com/microsoft/bot/builder/Bot.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ public interface Bot {
1212
/**
1313
* When implemented in a bot, handles an incoming activity.
1414
*
15-
* @param turnContext The context object for this turn. Provides information about the
16-
* incoming activity, and other data needed to process the activity.
15+
* @param turnContext The context object for this turn. Provides information
16+
* about the incoming activity, and other data needed to
17+
* process the activity.
1718
* @return A task that represents the work queued to execute.
1819
*/
1920
CompletableFuture<Void> onTurn(TurnContext turnContext);

0 commit comments

Comments
 (0)