Skip to content

Commit

Permalink
docs: update readme & contributing
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-herrero-tab committed Apr 22, 2021
1 parent 6e530e4 commit 18819e6
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 129 deletions.
57 changes: 2 additions & 55 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,7 @@

If you want to contribute to the code, please follow the following rules.

## Table of contents

<!---
ToC generated with https://ecotrust-canada.github.io/markdown-toc/
-->

- [💻 Android Studio](#---android-studio)
* [Recommended plugins](#recommended-plugins)
- [✏️ Code](#---code)
* [Clean code](#clean-code)
* [Code Style](#code-style)
* [Naming conventions](#naming-conventions)
* [Lint & Sonar](#lint---sonar)
* [Unit tests](#unit-tests)
* [UI](#ui)
- [🛠 Tasks](#---tasks)
* [Git](#git)
+ [Messages](#messages)
+ [Branches](#branches)
* [App Versioning](#app-versioning)
* [Release a version](#release-a-version)
* [Markdown](#markdown)


## 💻 Android Studio

### Recommended plugins

- [Adb Idea](https://plugins.jetbrains.com/plugin/7380-adb-idea) : Use ADB commands to your connected device directly from Android Studio.
- [Kotlin Fill Class](https://plugins.jetbrains.com/plugin/10942-kotlin-fill-class) : Pre-fill all constructor parameters for a class. Essential for data classes.
- [Key Promoter](https://plugins.jetbrains.com/plugin/9792-key-promoter-x) : Learn shortcuts for all actions done in Android Studio.
- [String Manipulation](https://plugins.jetbrains.com/plugin/2162-string-manipulation) : Reformat strings (case switching, sorting, filtering, incrementing, aligning, encoding ...)
- [Rainbow Brackets](https://plugins.jetbrains.com/plugin/10080-rainbow-brackets) : Increase readability for nested blocks.


## ✏️ Code
Expand Down Expand Up @@ -107,20 +75,12 @@ _After_ you commit, verify if tests are running on CI:


./gradlew clean createDebugCoverageReport

and open **jacoco report** generated in :

/printer/build/reports/coverage/debug/index.html


### UI

Follow as much as possible the [Design System](https://uxdesign.cc/everything-you-need-to-know-about-design-systems-54b109851969) principles:

- Create and re-use ui components with custom views
- Use as much as possible `ConstrainLayout` to build responsive screens.
- Create `styles`, `colors` and `dimens` instead of adding attributes in each views in layouts.


## 🛠 Tasks

Expand Down Expand Up @@ -154,18 +114,7 @@ cp .githooks/commit-msg .git/hooks/commit-msg

Follow the [GitHub Flow][github-flow]

🚧 TODO update this.

^(?:master|main|develop|feature\/(?P<feature_name>[A-Za-z][A-Za-z0-9\-\/]*)|(?:release|hotfix)\/(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:(?P<pre_release>(?:0|[1-9]\d*|\d*[A-Za-z-][A-Za-z0-9-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][A-Za-z0-9-]*))*))?(?:\+(?P<build_metadata>[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*))?)$


### App Versioning

Follow the [SemVer Conventions][semver]

### Release a version

🚧 TODO explain release process with GitHub.
Open a Pull Request targeting `develop` branch.

### Markdown

Expand All @@ -179,8 +128,6 @@ If you add or update titles, please generate a new Table of Contents by using [m




[semver]: http://semver.org
[conventional-commits]: https://www.conventionalcommits.org
[github-flow]: https://guides.github.com/introduction/flow/
[standard-version]: https://github.com/conventional-changelog/standard-version
128 changes: 63 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,9 @@
# Tabesto printer module

## Table of Contents
<!---
ToC generated with https://ecotrust-canada.github.io/markdown-toc/
-->

- [Global architecture](#global-architecture)
- [Installation](#installation)
- [Usage](#usage)
* [Connect printer](#connect-printer)
* [Discover printers](#discover-printers)
* [Print ticket](#print-ticket)
* [Handle errors](#handle-errors)
* [...](#)
- [Android architecture](#android-architecture)
- [Continuous integration](#continuous-integration)
* [Build, tests, lints and sonar](#build--tests--lints-and-sonar)
* [Build, lints and sonar](#build--lints-and-sonar)
* [Publish library and prepare release](#publish-library-and-prepare-release)
* [Publish Javadoc](#publish-javadoc)
- [Contributing](#contributing)
- [License](#license)



## Global architecture
# Tabesto POS printer module

## Description

This module allows you to use POS printers easily with your Android application.
With this wrapper module, we can handle printer(s) in a more convenient way, and add some flexibility.



Expand All @@ -38,75 +15,96 @@ This module allows you to use POS printers easily with your Android application.



## Installation

```api 'com.tabesto:printer-module:1.0.0-beta4'``` 🚧 TODO: update when first version will be released
## Features

- **Print** on **one** or **many** printer simultaneously.
- **Customize ticket content** to print.
- **Connect**, **disconnect** printers dynamically.
- Retrieve printer **status** on demand.
- **Discover** dynamically printers around (bluetooth only).


## Usage

See `sample` application

🚧 TODO:

### Connect printer
## Installation

### Discover printers
Add it in your root build.gradle at the end of repositories:

### Print ticket
```groovy
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```

### Handle errors

### ...

Add the dependency in your module build.gradle, with the last version available [![](https://jitpack.io/v/Tabesto/android-pos-printer.svg)](https://jitpack.io/#Tabesto/android-pos-printer) :

```groovy
dependencies {
...
implementation 'com.github.Tabesto:android-pos-printer:{lastVersion}'
}
```

## Android architecture

🚧 TODO

## Logs

## Continuous integration
### Build, tests, lints and sonar
A GitHubAction [android-tests](.github/workflows/android-tests.yml) is configured to build `printer` module on:
- Pull request events : Open and Ready for review
- Merge on develop branch
- Demand
If you want to see the library logs inside your application, just plant a [Timber Tree](https://github.com/JakeWharton/timber) :

It follows these steps:
```kotlin
if (BuildConfig.DEBUG) {
Timber.plant(Timber.DebugTree())
}
```

1. **Build** `printer` module
2. Run **android lint** & **kotlin detekt** for `printer` & `sample` modules
3. Run **instrumentation tests** for `printer` module
4. Run **sonar** analyze (see [SonarCloud Project](https://sonarcloud.io/dashboard?id=Tabesto_pos-printer-module))


## Usage

### Build, lints and sonar
See `sample` application.

A GitHubAction [android-sonar](.github/workflows/android-sonar.yml) is configured to build `printer` module on:
A [Javadoc is available here.](https://tabesto.github.io/android-pos-printer/printer/)

- Pull request events : Open and Ready for review
- Merge on develop branch
- Demand
🚧 TODO: add more detailed documentation with examples

It follows these steps:

1. **Build** `printer` module
2. Run **android lint** & **kotlin detekt** for `printer` & `sample` modules
3. Run **sonar** analyze (see [SonarCloud Project](https://sonarcloud.io/dashboard?id=Tabesto_pos-printer-module))
4. Notify **slack** `mobile-ci` channel anyway


## Contributing

If you want to contribute to the code, please refer to the following [CONTRIBUTING](CONTRIBUTING.md).
All contributions are welcome ! If you want to contribute to the code, please refer to the following [CONTRIBUTING](CONTRIBUTING.md).

If you want to modify diagrams present in this README, you can find all resources in `/docs/resources ` directory. You can open xml file with [draw.io](https://draw.io/).



## License

🚧 TODO: chose a public license when module will become public.
```
MIT License
Copyright (c) 2021 TABESTO
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ext.versions = [
versionNameMinor : 0,
versionNamePatch : 0,
versionNamePreReleaseClassifier: "beta",
versionNamePreReleaseNumber : null,
versionNamePreReleaseNumber : 1,
isSnapshot : false,
buildTools : '30.0.2',
androidGradleVersion : '4.0.2',
Expand Down
Binary file modified docs/global-architecture-diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions docs/resources/arch-modules-graphs.xml.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="app.diagrams.net" modified="2020-10-12T14:27:33.529Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36" etag="OifOIhF2IfrmJYhZEway" version="13.7.6" type="google" pages="2"><diagram id="I8E56uY5YPf1mQ0-Cvgx" name="Global architecture diagram">7Vhbd+MmEP41fqwPErrYj4njbU6brnPW2+22Lz1YwhINEirCt/31BQlsyciXJHb80uMHi9EwwHzfzDDqwVG2/pmjIv2NxZj2XBCve/Ch57qO5wbyT0k2tSQEw1qQcBJrpZ1gSn5gLQRauiAxLluKgjEqSNEWRizPcSRaMsQ5W7XV5oy2Vy1Qgi3BNELUlv5BYpHW0oEb7uSPmCSpWdkJ9PkyZJT1ScoUxWzVEMFxD444Y6J+ytYjTJXzjF/qeZ8OvN1ujONcnDPhRzFc0n9/ycAk+fZX/i3/nYvHn2BtZYnoQh9Yb1ZsjAc4W+QxVkZAD94zLlKWsBzRJ8YKKXSk8B8sxEZjhxaCSVEqMqrf4jUR3xvPfypTfdfXw4e1Nl0NNnpQCsTFnQJQCiKKypJERvyJ0K3tXPDNd2NADWrrvhnurFcjY74+JY4t8Hfe1KKSLXiEj7jQsBLxBIsjeu4WcxksmGVY7kfO45giQZbtfSDN2mSrtwNWPmhsX4GzZ8F6MSDD40C+FaEzCdBm5w1g9d8Jq576zIjcoQt04gx8nUZ02oQQtE3U+9Kz9six3cbb+eJYeeErmuFSMsIFz1wuirl8kul+Ifl0OGMohFYpEXhaoMrbK1kl2qSaSyxHjDJezYUzgCEOKqA5e8GNNwAPwGCgZrBcaI46ntKUtkmeqKG75cASc4HXx1lgo6YnwAFoed/19Hi1KwGOr2VpM/0DcBjpdwWwawEyfp5OPkvR9OFXG4GUZbNFedr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5y+VLjPIiUwpd/wLHJ0Ue3wiWIul8bEShRmb9sYU7NWYMJraeRFWAbLjxFZq3/XKtAeQHAkDdtq70RwJiaCFh1MGjCgKPV5lLU+QBniU1GbYzF4fxyJWHGOZ1JI1P0BTnft2oe+SmEGiehq/xX1a3hmn3G0bX5f6RTlVFD+ZV7B78bB+xsNh9OFPxfyn3EpQNqlbWirgIEfFsG/4joLOIXV7xtrMRoKvqiiCskwqZrGliaDCLqsVn4yP/6rJE+7PORRUCx8SRc7iy4hpeaTwOWSF3+s3Gm3A6KTapmHphtpc+0fHCRsjFY+yUFe6BXkYoV0ghzvKGC0N4a3gaZ10qAs4CwHwVuoSfiMjb5CLh6GoFGEX5toK64stsJdYaHIINGHCakuwM9YiSARX1gO5nu1fkZwy7Z6ugW1B0+qTV+VMB9V/ZU4jbOs6SaWEPY91V4LuNL7FbZHWsWiI5j1v400R2WVUwarQtyOmhr6u3rg1sIBEm1SKisdLwQQeVCEXHFoBdNXQOL+/NB1u64TQQoLIQckDzrMs3sw6DOsecUtNf9d5MX9qsaznw1r/SKz/S1vuzuNgw9qcptu5sXqs52n9y98=</diagram></mxfile>
<mxfile host="Electron" modified="2021-04-21T17:09:50.381Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/14.5.1 Chrome/89.0.4389.82 Electron/12.0.1 Safari/537.36" etag="MAAsJOm0AOwTiwHXAa9w" version="14.5.1" type="device" pages="2"><diagram id="I8E56uY5YPf1mQ0-Cvgx" name="Global architecture diagram">7Vlbc9o4FP41PNYjW74+JoS2s8k2zJDtNvvSEbawtStbrixu/fUrYdn4FmATKLMzgRnwObr46HzfJx3MCI7TzSeO8uR3FmE6skC0GcG7kWUFtis/lWNbOlwblI6Yk6h0mXvHjPzE2ll1W5IIF62OgjEqSN52hizLcChaPsQ5W7e7LRht3zVHMe45ZiGife+fJBJJ6fUtb+//jEmcVHc23aBsSVHVWa+kSFDE1g0XnIzgmDMmyqt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VCEXHFoBdNXQOL+/NB1u64TQQoLIQckDzrMs3sw6DOsecUtNf9d5MX9qsaznw1r/SKz/S1vuzuNgw9qcptu5sXqs52n9y98=</diagram></mxfile>
10 changes: 4 additions & 6 deletions printer/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tabesto.printer">

<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

</manifest>

0 comments on commit 18819e6

Please sign in to comment.