Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
Merge pull request #23 from EOSIO/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
GitToSteppin authored May 1, 2019
2 parents aa5c0fa + 8e643d7 commit dc1b2b2
Show file tree
Hide file tree
Showing 23 changed files with 805 additions and 416 deletions.
21 changes: 21 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
steps:

- command: |
bash .scripts/artifactory.sh
gradle assemble artifactoryPublish
label: "Build Library"
agents:
- "queue=automation-android-builder-fleet"
- command: |
bash .scripts/artifactory.sh
gradle test
label: "Run Tests"
agents:
- "queue=automation-android-builder-fleet"
- wait

- command: "echo 'Success!!'"
label: ":trophy: Success"
agents:
- "queue=automation-android-builder-fleet"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ build/

# Local configuration file (sdk path, etc)
local.properties
gradle.properties

# Proguard folder generated by Eclipse
proguard/
Expand Down Expand Up @@ -76,3 +77,4 @@ lint/outputs/
lint/tmp/
# lint/reports/

gradle.properties
9 changes: 0 additions & 9 deletions .idea/fileTemplates/includes/File Header.java

This file was deleted.

16 changes: 16 additions & 0 deletions .scripts/artifactory.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -eu -o pipefail

GRADLE_PROPERTIES="/var/lib/buildkite-agent/builds/automation-android-builder-fleet/EOSIO/eosio-java-android-abieos-serialization-provider/gradle.properties"
export GRADLE_PROPERTIES
echo "Gradle Properties should exist at $GRADLE_PROPERTIES"
echo "Gradle Properties does not exist"
echo "Creating Gradle Properties file..."
touch $GRADLE_PROPERTIES
echo "Writing Secrets to gradle.properties..."
echo "artifactory_username=$(cat /var/lib/buildkite-agent/.artifactory-username)" >> $GRADLE_PROPERTIES
echo "artifactory_password=$(cat /var/lib/buildkite-agent/.artifactory-password)" >> $GRADLE_PROPERTIES
#echo "artifactory_password=testest" >> $GRADLE_PROPERTIES
echo "artifactory_contextURL=https://blockone.jfrog.io/blockone" >> $GRADLE_PROPERTIES
echo "artifactory_repo=android-libs-dev" >> $GRADLE_PROPERTIES
echo "artifactory_path_android_libraries=https://blockone.jfrog.io/blockone/android-libs" >> $GRADLE_PROPERTIES
47 changes: 33 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# Contributing to {{friendlyName}}
# Contributing to EOSIO SDK for Java: Android ABIEOS Serialization Provider

Interested in contributing? That's awesome! Here are some guidelines to get started quickly and easily:

- [Reporting An Issue](#reporting-an-issue)
- [Bug Reports](#bug-reports)
- [Feature Requests](#feature-requests)
- [Change Requests](#change-requests)
- [Working on {{friendlyName}}](#working-on-friendlyname)
- [Working on ABIEOS Serialization Provider](#working-on-abieos-serialization-provider)
- [Feature Branches](#feature-branches)
- [Developing With Gradle Locally](#developing-with-gradle-locally)
- [Submitting Pull Requests](#submitting-pull-requests)
- [Testing and Quality Assurance](#testing-and-quality-assurance)
- [Code Style and Linting](#code-style-and-linting)
- [Conduct](#conduct)
- [Contributor License & Acknowledgments](#contributor-license--acknowledgments)
- [References](#references)

## Reporting An Issue

If you're about to raise an issue because you think you've found a problem with {{friendlyName}}, or you'd like to make a request for a new feature in the codebase, or any other reason… please read this first.
If you're about to raise an issue because you think you've found a problem with ABIEOS Serialization Provider, or you'd like to make a request for a new feature in the codebase, or any other reason… please read this first.

The GitHub issue tracker is the preferred channel for [bug reports](#bug-reports), [feature requests](#feature-requests), and [submitting pull requests](#submitting-pull-requests), but please respect the following restrictions:

Expand All @@ -34,12 +36,12 @@ Guidelines for bug reports:
reported.

1. **Check if the issue has been fixed** — look for [closed issues in the
current milestone](https://github.com/EOSIO/{{githubRepo}}/issues?q=is%3Aissue+is%3Aclosed) or try to reproduce it
current milestone](/../../issues?q=is%3Aissue+is%3Aclosed) or try to reproduce it
using the latest `develop` branch.

A good bug report shouldn't leave others needing to chase you up for more information. Be sure to include the details of your environment and relevant tests that demonstrate the failure.
A good bug report shouldn't leave others needing to chase you down for more information. Be sure to include the details of your environment and relevant tests that demonstrate the failure.

[Report a bug](https://github.com/EOSIO/{{githubRepo}}/issues/new?title=Bug%3A)
[Report a bug](/../../issues/new?title=Bug%3A)

### Feature Requests

Expand All @@ -51,24 +53,35 @@ Feature requests are welcome. Before you submit one be sure to have:

### Change Requests

Change requests cover both architectural and functional changes to how {{friendlyName}} works. If you have an idea for a new or different dependency, a refactor, or an improvement to a feature, etc - please be sure to:
Change requests cover both architectural and functional changes to how ABIEOS Serialization Provider works. If you have an idea for a new or different dependency, a refactor, or an improvement to a feature, etc - please be sure to:

1. **Use the GitHub search** and check someone else didn't get there first
1. Take a moment to think about the best way to make a case for, and explain what you're thinking. Are you sure this shouldn't really be
a [bug report](#bug-reports) or a [feature request](#feature-requests)? Is it really one idea or is it many? What's the context? What problem are you solving? Why is what you are suggesting better than what's already there?
1. Take a moment to think about the best way to make a case for, and explain what you're thinking. Are you sure this shouldn't really be a [bug report](#bug-reports) or a [feature request](#feature-requests)? Is it really one idea or is it many? What's the context? What problem are you solving? Why is what you are suggesting better than what's already there?

## Working on {{friendlyName}}
## Working on ABIEOS Serialization Provider

Code contributions are welcome and encouraged! If you are looking for a good place to start, check out the [good first issue](https://github.com/EOSIO/{{githubRepo}}/labels/good%20first%20issue) label in GitHub issues.
Code contributions are welcome and encouraged! If you are looking for a good place to start, check out the [good first issue](/../../labels/good%20first%20issue) label in GitHub issues.

Also, please follow these guidelines when submitting code:

### Feature Branches

To get it out of the way:

- **[develop](https://github.com/EOSIO/{{githubRepo}}/tree/develop)** is the development branch. All work on the next release happens here so you should generally branch off `develop`. Do **NOT** use this branch for a production site.
- **[master](https://github.com/EOSIO/{{githubRepo}})** contains the latest release of {{friendlyName}}. This branch may be used in production. Do **NOT** use this branch to work on {{friendlyName}}'s source.
- **[develop](/../../tree/develop)** is the development branch. All work on the next release happens here so you should generally branch off `develop`. Do **NOT** use this branch for a production site.
- **[master](/../../tree/master)** contains the latest release of ABIEOS Serialization Provider. This branch may be used in production. Do **NOT** use this branch to work on ABIEOS Serialization Provider's source.

### Developing With Gradle Locally

By default, libraries are installed from remote Maven repositories through Gradle. If, however, you wish to develop locally and you'd like to integrate with locally-cloned versions of EOSIO SDK for Java and/or other Providers, follow these instructions:

1. Clone this and other repos into the same directory, as siblings of one another.
1. Github repo of all libraries:
* [EOSIO SDK for Java](https://github.com/EOSIO/eosio-java): The core EOSIO SDK for Java library
* [RPC Provider](https://github.com/EOSIO/eosio-java-android-rpc-provider): The RPC provider implementation in the core library
* [ABIEOS Serialization Provider](https://github.com/EOSIO/eosio-java-android-abieos-serialization-provider): A pluggable serialization provider for EOSIO SDK for Java using ABIEOS (for transaction and action conversion between JSON and binary data representations)
* [Softkey Signature Provider](https://github.com/EOSIO/eosio-java-softkey-signature-provider): An example pluggable signature provider for EOSIO SDK for Java for signing transactions using in-memory keys (not for production use)1. Import as a gradle project into your favorite IDE or build with gradle from the command line.
1. Develop!

### Submitting Pull Requests

Expand All @@ -78,7 +91,13 @@ Pull requests are awesome. If you're looking to raise a PR for something which d

Never underestimate just how useful quality assurance is. If you're looking to get involved with the code base and don't know where to start, checking out and testing a pull request is one of the most useful things you could do.

Essentially, [check out the latest develop branch](#working-on-{{friendlyName}}), take it for a spin, and if you find anything odd, please follow the [bug report guidelines](#bug-reports) and let us know!
Essentially, [check out the latest develop branch](#working-on-abieos-serialization-provider), take it for a spin, and if you find anything odd, please follow the [bug report guidelines](#bug-reports) and let us know!

### Code Style and Linting

ABIEOS Serialization Provider leverages [SonarLint](https://www.sonarlint.org/) for linting and the [Google Java Style Guide](https://github.com/google/styleguide) with tab size and indent set to 4, and continuation indent set to 8 for code format flagging. Once SonarLint is installed, linting warnings and errors will be flagged inline with squiggles. Automatic code formatting can be accomplished by downloading and importing the Google Java Style settings into your IDE.

Please be sure to resolve any linting issues introduced by your contributions prior to requesting a review on your PR.

## Conduct

Expand Down
100 changes: 95 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,100 @@
# EOSIO SDK for Java ABIEOS Serialization Provider ![EOSIO Alpha](https://img.shields.io/badge/EOSIO-Alpha-blue.svg)
![Java Logo](img/java-logo.png) <img src="img/Android_Robot.png" width="100">
# EOSIO SDK for Java: Android ABIEOS Serialization Provider ![EOSIO Alpha](https://img.shields.io/badge/EOSIO-Alpha-blue.svg)

## Overview
[![Software License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](./LICENSE)
![Language Java](https://img.shields.io/badge/Language-C%2B%2B%2FJava-yellow.svg)
![](https://img.shields.io/badge/Deployment%20Target-Android%206%2B-blue.svg)

## Contributing
Android ABIEOS Serialization Provider is a pluggable serialization provider for EOSIO SDK for Java.

[Contributing Guide](./CONTRIBUTING.md)
Serialization providers are responsible for ABI-driven transaction and action serialization and deserialization between JSON and binary data representations. This particular serialization provider wraps ABIEOS, a C/C++ library that facilitates this conversion.

[Code of Conduct](./CONTRIBUTING.md#conduct)
*All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.*

*The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.*

## Contents

- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Direct Usage](#direct-usage)
- [Android Example App](#android-example-app)
- [Want to Help?](#want-to-help)
- [License & Legal](#license)

## Prerequisites

* Android Studio 3.3.2 or higher
* NDK 18+ (C++ 17 standard support required)
* Cmake 3.6.0+
* Gradle 4.10.1+
* Gradle Plugin 3.3.0+
* For Android, Android 6 (Marshmallow)+

This project relies on platform functionality and libraries only present in Android 6+ and the Android NDK. Therefore, any project depending on ABIEOS Serialization Provider with [EOSIO SDK for Java](https://github.com/EOSIO/eosio-java) **must be an Android 6+ project**. Other serialization providers, however, can be created to support earlier Android versions or other platforms. If your project requires earlier Android version or alternate platform support, or if you'd like to create a serialization provider and have questions, please reach out to us by [logging an issue](/../../issues/new).

## Installation

ABIEOS Serialization Provider is intended to be used in conjunction with [EOSIO SDK for Java](https://github.com/EOSIO/eosio-java) as a provider plugin.

To use ABIEOS Serialization Provider with EOSIO SDK for Java in your app, add the following modules to your `build.gradle`:

```groovy
implementation 'one.block:eosiojava:0.1.0'
implementation 'one.block:eosiojavaandroidabieosserializationprovider:0.1.0'
```

You must also add the following to the `android` section of your application's `build.gradle`:

```groovy
// Needed to get bitcoin-j to produce a valid apk for android.
packagingOptions {
exclude 'lib/x86_64/darwin/libscrypt.dylib'
exclude 'lib/x86_64/freebsd/libscrypt.so'
exclude 'lib/x86_64/linux/libscrypt.so'
}
```

Then refresh your gradle project.

Now ABIEOS Serialization Provider is ready for use within EOSIO SDK for Java according to the [EOSIO SDK for Java Basic Usage instructions](https://github.com/EOSIO/eosio-java/tree/master#basic-usage).

## Direct Usage

If you wish to use ABIEOS Serialization Provider directly, its public methods can be called like this:

```java
try {
AbiEos abieos = new AbiEosSerializationProviderImpl()
} catch (SerializationProviderError serializationProviderError) {
serializationProviderError.printStackTrace();
}

String hex = "1686755CA99DE8E73E1200" // some binary data
String json = "{"name": "John"}" // some JSON

try {
String jsonToBinaryTransaction = abieos.serializeTransaction(json)
} catch (SerializeTransactionError err) {
err.printStackTrace();
}

try {
String binaryToJsonTransaction = abieos.deserializeTransaction(hex)
} catch (DeserializeTransactionError err) {
err.printStackTrace();
}
```

## Android Example App

If you'd like to see EOSIO SDK for Java: Android ABIEOS Serialization Provider in action, check out our open source [Android Example App](https://github.com/EOSIO/eosio-java-android-example-app)--a working application that fetches an account's token balance and pushes a transfer action.

## Want to help?

Interested in contributing? That's awesome! Here are some [Contribution Guidelines](./CONTRIBUTING.md) and the [Code of Conduct](./CONTRIBUTING.md#conduct).

We're always looking for ways to improve this library. Check out our [#enhancement Issues](/../../issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement) for ways you can pitch in.

## License

Expand All @@ -15,3 +103,5 @@
## Important

See LICENSE for copyright and license terms. Block.one makes its contribution on a voluntary basis as a member of the EOSIO community and is not responsible for ensuring the overall performance of the software or any related applications. We make no representation, warranty, guarantee or undertaking in respect of the software or any related documentation, whether expressed or implied, including but not limited to the warranties or merchantability, fitness for a particular purpose and noninfringement. In no event shall we 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 documentation or the use or other dealings in the software or documentation. Any test results or performance figures are indicative and will not reflect performance under all conditions. Any reference to any third party or third-party product, service or other resource is not an endorsement or recommendation by Block.one. We are not responsible, and disclaim any and all responsibility and liability, for your use of or reliance on any of these resources. Third-party resources may be updated, changed or terminated at any time, so the information here may be out of date or inaccurate.

Wallets and related components are complex software that require the highest levels of security. If incorrectly built or used, they may compromise users’ private keys and digital assets. Wallet applications and related components should undergo thorough security evaluations before being used. Only experienced developers should work with this software.
13 changes: 12 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ android {
unitTests.includeAndroidResources = true
}

// Needed to get bitcoin-j to produce a valid apk for android.
packagingOptions {
exclude 'lib/x86_64/darwin/libscrypt.dylib'
exclude 'lib/x86_64/freebsd/libscrypt.so'
exclude 'lib/x86_64/linux/libscrypt.so'
}

lintOptions {
abortOnError false
}
}

dependencies {
Expand All @@ -45,5 +55,6 @@ dependencies {
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
implementation project(':eosiojavaabieos')
androidTestImplementation project(path: ':eosiojava')
implementation 'one.block:eosiojava:0.1.0'

}
Loading

0 comments on commit dc1b2b2

Please sign in to comment.