Skip to content
Permalink
Browse files

Contributor guide

  • Loading branch information...
dahlia committed Feb 22, 2019
1 parent 58d615d commit c128cc4629909c3b91b86c49bb639f920fbc665d
Showing with 102 additions and 17 deletions.
  1. +92 −0 CONTRIBUTING.md
  2. +1 −0 Docs/CONTRIBUTING.md
  3. +2 −0 Docs/toc.yml
  4. +7 −17 README.md
@@ -6,6 +6,98 @@ We should expand it so that it covers reporting bugs, filing issues,
and writing docs.


Questions & online chat [![Discord](https://img.shields.io/discord/539405872346955788.svg?color=7289da&logo=discord&logoColor=white)][Discord server]
-----------------------

We have a [Discord server] to discuss Libplanet. There are some channels
for purposes:

- *#libplanet-users*: Chat with game programmers who use Libplanet.
Ask questions to *use* Libplanet for your games.
- *#libplanet-dev*: Chat with maintainers and contributors of Libplanet.
Ask questions to *hack* Libplanet and to make a patch for it.
- *#libplanet-users-kr*: The same purpose to *#libplanet-users*,
except you can speak Korean instead English here.

[Discord server]: https://discord.gg/ue9fgc3


Prerequisites
-------------

If you use Linux or macOS you need [Mono], which provides C# compiler and
.NET VM. You could install it by `sudo apt install mono-devel` command
if you use Ubuntu Linux. If you use macOS and [Homebrew], You can install
it by `brew cask install mono-mdk` command.

If you are on Windows you need things like C# compiler included in
[Build Tools for Visual Studio 2017][1]. Choose the following workloads
during installation:

- <q>Windows</q> → <q>.NET desktop build tools</q>
- <q>Other Toolsets</q> → <q>.NET Core build tools</q>

These tools should bring MSBuild, the Libplanet project uses to build, as well.
Check if `msbuild` is available on the shell or Command Prompt. If it fails
to find command named `msbuild` it might be not installed correctly or its
directory might be missing in the `PATH` environment.

Although it is not necessary, you should install a proper IDE for .NET
(or an [OmniSharp] extension for your favorite editor — except it takes
hours to properly configure and integrate with your editor).
C# is not like JavaScript or Python; it is painful to code in C# without IDE.

Unless you already have your favorite setup, we recommend you to use
[Visual Studio Code]. It is free, open source, and made by Microsoft, which
made .NET as well. So Visual Studio Code has a [first-party C# extension][2]
which works well together.

[Mono]: https://www.mono-project.com/
[Homebrew]: https://brew.sh/
[OmniSharp]: http://www.omnisharp.net/
[Visual Studio Code]: https://code.visualstudio.com/
[1]: https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017
[2]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp


Build
-----

The following command installs dependencies (required library packages) and
builds the whole Libplanet solution:

msbuild -r


Tests [![Build Status](https://travis-ci.com/planetarium/libplanet.net.svg?branch=master)][Travis CI] [![Codecov](https://codecov.io/gh/planetarium/libplanet.net/branch/master/graph/badge.svg)][2]
-----

We write as complete tests as possible to the corresponding implementation code.
Going near to the [code coverage][2] 100% is one of our goals.

The *Libplanet* solution consists of two projects. *Libplanet* is an actual
implementation. It is built to a *Libplanet.dll* assembly and packed as
a NuGet package.

*Libplanet.Tests* is a test suite for the *Libplanet.dll* assembly.
It depends on [Xunit], and every namespace and class in it corresponds to
one in *Libplanet* project. If there's *Libplanet.Foo.Bar* class there also
should be *Libplanet.Tests.Foo.BarTest* to test it.

To build and run unit tests at a time execute the below command:

msbuild -r -t:'Build;XunitTest' Libplanet.Tests

It's okay to omit `-r` and `Build` task if you've already run `msbuild -r`
right before:

msbuild -t:XunitTest Libplanet.Tests

[Travis CI]: https://travis-ci.com/planetarium/libplanet.net
[2]: https://codecov.io/gh/planetarium/libplanet.net
[Xunit]: https://xunit.github.io/


Style convention
----------------

@@ -0,0 +1 @@
[!include[README](../CONTRIBUTING.md)]
@@ -7,3 +7,5 @@
homepage: api/Libplanet.yml
- name: Changelog
href: ../CHANGES.md
- name: Contribute
href: CONTRIBUTING.md
@@ -1,6 +1,7 @@
Libplanet
=========

[![Discord](https://img.shields.io/discord/539405872346955788.svg?color=7289da&logo=discord&logoColor=white)][Discord]
[![Build Status](https://travis-ci.com/planetarium/libplanet.net.svg?branch=master)][Travis CI]
[![Codecov](https://codecov.io/gh/planetarium/libplanet.net/branch/master/graph/badge.svg)][Codecov]
[![NuGet](https://img.shields.io/nuget/v/Libplanet.svg?style=flat)][NuGet]
@@ -12,6 +13,7 @@ peer-to-peer network among equal nodes rather than an authorized central
server. Under the hood, it incorporates many features (e.g.,
[digital signature], [BFT] consensus, data replication) of a [blockchain].

[Discord]: https://discord.gg/ue9fgc3
[Travis CI]: https://travis-ci.com/planetarium/libplanet.net
[Codecov]: https://codecov.io/gh/planetarium/libplanet.net
[NuGet]: https://www.nuget.org/packages/Libplanet/
@@ -39,29 +41,17 @@ In the near future, we are going to submit it to [Unity Asset Store] too.
Build
-----

You could build a *Libplanet.dll* assembly from the source code.

The following command installs dependencies (required library packages) and
builds the whole Libplanet solution:

~~~~~~~~ bash
msbuild /r
msbuild -r
~~~~~~~~

Note that `msbuild` is distributed together with Mono framework or
Visual Studio.


Test
----

To build and run unit tests at a time execute the below command:

~~~~~~~~ bash
msbuild /r /t:'Build;XunitTest' Libplanet.Tests
~~~~~~~~

It's okay to omit `/r` and `Build` task if you've already run `msbuild /r`
right before:

~~~~~~~~ bash
msbuild /t:XunitTest Libplanet.Tests
~~~~~~~~
If you'd like to contribute code to the Libplanet project in earnest,
please read our [contributor guide](CONTRIBUTING.md).

0 comments on commit c128cc4

Please sign in to comment.
You can’t perform that action at this time.