-
Notifications
You must be signed in to change notification settings - Fork 641
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
Contributing to Project Oxford Client Libraries | ||
=============================================== | ||
|
||
So, you want to contribute on a client SDK for one of the Project Oxford APIs. | ||
Here's what you need to know. | ||
|
||
1. Each SDK must include both a client library and a sample showing the API in | ||
action | ||
|
||
2. When building an SDK, it's important you support the most common development | ||
platforms and that we are consistent from project to project. We require you | ||
to build the following, using the associated coding guidelines, in priority | ||
order: | ||
|
||
- .NET (Coding guidelines below) | ||
|
||
- Android [(Coding guidelines for | ||
Java)](<http://source.android.com/source/code-style.html>) | ||
|
||
- iOS Objective-C [(Coding guidelines for | ||
Cocoa)](<https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html>) | ||
|
||
- Optional: Client Javascript ([Coding guidelines for | ||
npm](<https://docs.npmjs.com/misc/coding-style>)) | ||
|
||
3. Samples are important for illustrating how to actually call into the API. | ||
Samples should be as visual and reusable as possible. | ||
|
||
- Do: | ||
|
||
- Create a UI sample when possible. | ||
|
||
- Make your sample user friendly. Expect that developers will want to try | ||
different mainline scenarios and key APIs. | ||
|
||
- Create code that's easy for other developers to copy/paste into their | ||
own solutions | ||
|
||
- Consider: | ||
|
||
- Adding UI to allow devs to quickly copy/paste subscription keys, instead | ||
of updating them in the code or using a config file. The | ||
FaceAPI-WPF-Samples.sln provides an example. | ||
|
||
- Don't: | ||
|
||
- Leave your subscription key in the source of samples. You do not want | ||
your key to be abused by others. | ||
|
||
4. Always create a README.md for your top-level API root and for each platform. | ||
|
||
- Use the existing README.md files as a reference for what information is | ||
useful here. In general, you want to describe the functionality of the | ||
API as well as specifics for how to build and run the project(s). | ||
|
||
|
||
|
||
Coding Guidelines for C\# | ||
------------------------- | ||
|
||
The general rule we follow is "use Visual Studio defaults." | ||
|
||
1. Use [Allman style](<http://en.wikipedia.org/wiki/Indent_style#Allman_style>) | ||
braces, where each brace begins on a new line. A single-line statement block | ||
can go without braces, but the block must be properly indented on its own | ||
line, and it must not be nested in other statement blocks that use braces. | ||
|
||
2. Use four spaces of indentation (no tabs). | ||
|
||
3. Use \_camelCase for internal and private members and use readonly where | ||
possible. Prefix instance fields with \_, static fields with s\_, and thread | ||
static fields with t\_. | ||
|
||
4. Avoid this. unless absolutely necessary. | ||
|
||
5. Always specify the visibility, even if it's the default (that is, private | ||
string \_foo, not string \_foo). | ||
|
||
6. Namespace imports should be specified at the top of the file, outside of | ||
namespace declarations, and should be sorted alphabetically, with System. | ||
namespaces at the top and blank lines between different top level groups. | ||
|
||
7. Avoid more than one empty line at any time. For example, do not have two | ||
blank lines between members of a type. | ||
|
||
8. Avoid spurious free spaces. For example avoid if (someVar == 0)..., where | ||
the dots mark the spurious free spaces. Consider enabling "View White Space | ||
(Ctrl+E, S)" if using Visual Studio, to aid detection. | ||
|
||
9. Only use var when it's obvious what the variable type is (that is, var | ||
stream = new FileStream(...), not var stream = OpenStandardInput()). | ||
|
||
10. Use language keywords instead of BCL types (that is, int, string, float | ||
instead of Int32, String, Single, and so on) for both type references as | ||
well as method calls (that is, int.Parse instead of Int32.Parse). | ||
|
||
11. Use PascalCasing to name all constant local variables and fields. The only | ||
exception is for interop code where the constant value should exactly match | ||
the name and value of the code you are calling via interop. | ||
|
||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module external.linked.project.id="Sample" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> | ||
<component name="FacetManager"> | ||
<facet type="java-gradle" name="Java-Gradle"> | ||
<configuration> | ||
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" /> | ||
<option name="BUILDABLE" value="false" /> | ||
</configuration> | ||
</facet> | ||
</component> | ||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<excludeFolder url="file://$MODULE_DIR$/.gradle" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:1.3.0' | ||
|
||
// NOTE: Do not place your application dependencies here; they belong | ||
// in the individual module build.gradle files | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
jcenter() | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module external.linked.project.id="ClientLibrary" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> | ||
<component name="FacetManager"> | ||
<facet type="java-gradle" name="Java-Gradle"> | ||
<configuration> | ||
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" /> | ||
<option name="BUILDABLE" value="false" /> | ||
</configuration> | ||
</facet> | ||
</component> | ||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<excludeFolder url="file://$MODULE_DIR$/.gradle" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Project-wide Gradle settings. | ||
|
||
# IDE (e.g. Android Studio) users: | ||
# Gradle settings configured through the IDE *will override* | ||
# any settings specified in this file. | ||
|
||
# For more details on how to configure your build environment visit | ||
# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
|
||
# Specifies the JVM arguments used for the daemon process. | ||
# The setting is particularly useful for tweaking memory settings. | ||
# Default value: -Xmx10248m -XX:MaxPermSize=256m | ||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
# When configured, Gradle will run in incubating parallel mode. | ||
# This option should only be used with decoupled projects. More details, visit | ||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
# org.gradle.parallel=true | ||
|
||
// | ||
// The following are used by Microsoft to upload Maven Package. | ||
// You can ignore these in your sample use. | ||
// | ||
signing.keyId= | ||
signing.password= | ||
signing.secretKeyRingFile= | ||
|
||
ossrhUsername= | ||
ossrhPassword= |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Wed Apr 10 15:27:10 PDT 2013 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip |