Skip to content

Commit 3f3f694

Browse files
chore: update repository documentation (#785)
1 parent b2dd55d commit 3f3f694

File tree

3 files changed

+109
-103
lines changed

3 files changed

+109
-103
lines changed

CONTRIBUTING.md

Lines changed: 57 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ environment variables are set. A convenient way of doing this is to add them
4040
into `~/.bashrc`. On a Mac, the SDK and Java installation used by the SDK may
4141
be found:
4242

43-
```
43+
```shell
4444
export ANDROID_HOME=~/Library/Android/sdk
4545
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home
4646
```
4747
Note: JDK 11, 12, 13, etc. have known issues and are not supported.
4848

4949
Now, clone the Amplify Android project from GitHub.
5050

51-
```
51+
```shell
5252
git clone [email protected]:aws-amplify/amplify-android.git
5353
```
5454
Load this project into Android Studio by selecting File > Open, and choosing
@@ -59,7 +59,7 @@ In Android Studio, build the project by clicking the Hammer icon, "Make
5959
Project ⌘F9". If working on the command line, you can do the same thing
6060
via:
6161

62-
```
62+
```shell
6363
./gradlew build
6464
```
6565

@@ -74,7 +74,7 @@ The local Maven repository is usually found in your home directory at
7474
To publish the outputs of the build, execute the following command from
7575
the root of the `amplify-android` project:
7676

77-
```
77+
```shell
7878
./gradlew publishToMavenLocal
7979
```
8080

@@ -88,7 +88,7 @@ buildscript {
8888
mavenLocal() // this should ideally appear before other repositories
8989
}
9090
dependencies {
91-
classpath 'com.android.tools.build:gradle:3.6.3'
91+
classpath 'com.android.tools.build:gradle:4.0.1'
9292
}
9393
}
9494
@@ -128,14 +128,29 @@ AndroidX test core, runner, and a jUnit extension. See Android's notes on
128128
Be aware of the Getting Started and Pull Request guides. This portion deals
129129
actually with changing some code.
130130

131-
First, identify the module you'll modify:
131+
First, identify the module you'll modify. The various Gradle modules are
132+
described below:
132133

133134
- `core` - The Framework itself, including category behavior definitions
134-
- `aws-datastore` - An AppSync implementation of the datastore contract
135-
- `aws-api` - A utility to talk to GraphQL and REST endpoints
136-
- `aws-storage-s3` - Wrapper around S3
137-
- `aws-analytics-pinpoint` - Wrapper around Pinpoint
138-
- `testutilts` - Utility code, helpful when writing unit and instrumentation
135+
- `aws-auth-cognito` - A plugin implementation of the Auth category that
136+
speaks to Amazon Cognito through the legacy `AWSMobileClient` utility
137+
- `aws-datastore` - An AppSync-based plugin for the DataStore category
138+
- `aws-api` - Plugin for API category with special abilities to talk to
139+
AppSync and API Gateway endpoints
140+
- `aws-api-appsync` - AppSync implementation details that are shared
141+
accross multiple plugins implementations (`aws-api`, `aws-datastore`)
142+
- `aws-storage-s3` - A plugin for the Storage category, leveraging S3, Cognito
143+
- `aws-predictions` - A plugin for Predictions category, leveraging
144+
numerous Amazon machine learnings services.
145+
- `aws-predictions-tensorflow` - A plugin for the Predictions category
146+
which does machine learning on the device, using TensorFlow Lite
147+
- `aws-analytics-pinpoint` - A plugin for the Analytics category,
148+
leveraging Amazon Pinpoint
149+
- `rxbindings` - A front-end for Amplify that expresses operations as
150+
Rx primitives
151+
- `amplify-tools` - A Gradle plugin that can be used to run Amplify CLI
152+
commands from within the Android Studio IDE.
153+
- `testutils` - Utility code, helpful when writing unit and instrumentation
139154
tests. A lot of it deals with making async code synchronous, for more
140155
legible tests.
141156
- `testmodels` - Models that are used in test code. These were generated by
@@ -155,14 +170,14 @@ conventions and expectations for source files in the Android codebase.
155170
For example, let's say you want to add a `Merger` component to the AppSync
156171
Local implementation. Create a file in that module, and a unit test for it:
157172

158-
```
173+
```console
159174
aws-datastore/src/main/com/amplifyframework/datastore/syncengine/Merger.java
160175
aws-datastore/src/test/com/amplifyframework/datastore/syncengine/MergerTest.java
161176
```
162177

163178
The code below might be a reasonable template for these new files.
164179

165-
```
180+
```java
166181
/*
167182
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
168183
*
@@ -203,7 +218,7 @@ final class Merger {
203218
```
204219

205220

206-
```
221+
```java
207222
/*
208223
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
209224
*
@@ -285,7 +300,7 @@ Some suggestions include:
285300
This will perform a clean build, run Checkstyle, Android Lint, and all unit
286301
tests. This must complete successfully before proposing a PR.
287302

288-
```
303+
```shell
289304
./gradlew clean build
290305
```
291306

@@ -302,21 +317,21 @@ configurations suitable for running the integration tests.
302317
If you are part of the private access list, the command below will copy
303318
those configurations to your local workspace:
304319

305-
```
320+
```shell
306321
cd amplify-android
307322
.circleci/copy-configs
308323
```
309324

310325
To run a __specific__ test:
311326

312-
```
327+
```shell
313328
test='com.amplifyframework.api.aws.RestApiInstrumentationTest#getRequestWithIAM'
314329
./gradlew :cAT -Pandroid.testInstrumentationRunnerArguments.class="$test"
315330
```
316331

317332
To run __all__ tests:
318333

319-
```
334+
```shell
320335
./gradlew cAT
321336
```
322337

@@ -343,7 +358,7 @@ This is mostly the same as [GitHub's guide on creating a pull request](https://h
343358

344359
First, create a _fork_ of `amplify-android`. Clone it, and make changes to this _fork_.
345360

346-
```
361+
```shell
347362
git clone [email protected]:your_username/amplify-android.git
348363
```
349364

@@ -357,7 +372,7 @@ describing what you've done, include links to useful resources. These might
357372
include design documents, StackOverflow implementation notes, GitHub issues,
358373
etc. All links must be publicly accessible.
359374

360-
```
375+
```console
361376
[aws-datatore] Add a 3-way merging component for network ingress
362377

363378
The Merger checks the state of the Mutation Outbox before applying
@@ -370,26 +385,22 @@ See also: https://stackoverflow.com/a/58662077/695787
370385

371386
Now, save your work to a new branch:
372387

373-
```
388+
```shell
374389
git checkout -B add_merger_to_datastore
375390
```
376391

377392
To publish it:
378393

379-
```
394+
```shell
380395
git push -u origin add_merger_to_datastore
381396
```
382397

383398
This last step will give you a URL to view a GitHub page in your browser.
384399
Copy-paste this, and complete the workflow in the UI. It will invite you to
385400
"create a PR" from your newly published branch.
386401

387-
Your should add the
388-
**[Amplify-Native](https:~~/~~/github.com/orgs/aws-amplify/teams/amplify-native)**
389-
team as a reviewer of your PR.
390-
391-
Your PR must be reviewed by at least one member of this team, in order to be
392-
considered for inclusion.
402+
Your PR must be reviewed by at least one repository maintainer, in order
403+
to be considered for inclusion.
393404

394405
your PR must also pass the CircleCI workflow and LGTM validations. CircleCI
395406
will run all build tasks (Checkstyle, Lint, unit tests).
@@ -403,26 +414,26 @@ the PR.
403414
### Environment Debugging
404415

405416
Are you using the right versions of Gradle, Ant, Groovy, Kotlin, Java, Mac OS X?
406-
```
417+
```console
407418
./gradlew -version
408419

409420
------------------------------------------------------------
410-
Gradle 6.3
421+
Gradle 6.6
411422
------------------------------------------------------------
412423

413-
Build time: 2020-03-24 19:52:07 UTC
414-
Revision: bacd40b727b0130eeac8855ae3f9fd9a0b207c60
424+
Build time: 2020-08-10 22:06:19 UTC
425+
Revision: d119144684a0c301aea027b79857815659e431b9
415426

416-
Kotlin: 1.3.70
417-
Groovy: 2.5.10
418-
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
419-
JVM: 1.8.0_212-release (JetBrains s.r.o 25.212-b4-5784211)
420-
OS: Mac OS X 10.14.6 x86_64
427+
Kotlin: 1.3.72
428+
Groovy: 2.5.12
429+
Ant: Apache Ant(TM) version 1.10.8 compiled on May 10 2020
430+
JVM: 1.8.0_242-release (JetBrains s.r.o 25.242-b3-6222593)
431+
OS: Mac OS X 10.15.6 x86_64
421432
```
422433

423434
Do you have the Android SDK setup, and do you have a pointer to the Java environment?
424435

425-
```
436+
```console
426437
echo -e $ANDROID_HOME\\n$JAVA_HOME
427438
/Users/jhwill/Library/Android/sdk
428439
/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home
@@ -433,14 +444,14 @@ echo -e $ANDROID_HOME\\n$JAVA_HOME
433444
If the build fails, and you can't figure out why from a Google search /
434445
StackOverflow session, try passing options to Gradle:
435446

436-
```
447+
```shell
437448
./gradlew --stacktrace
438449
```
439450

440451
The next flag will spit out lots of info. It's only useful if you pipe the
441452
output to a file, and grep through it.
442453

443-
```
454+
```shell
444455
./gradlew --debug 2>&1 > debugging-the-build.log
445456
```
446457

@@ -450,7 +461,7 @@ If a single test is failing, run only that test, to isolate it. You may also
450461
want to see the output on the device that occurs, while the tests are
451462
executing.
452463

453-
```
464+
```shell
454465
# If you run this same code in a script/block, this will clear the log
455466
# file each time.
456467
rm -f device-logs-during-test.log
@@ -476,24 +487,17 @@ iOS, and numerous JavaScript-based web platforms. The Amplify CLI
476487
provides an entry point to configure backend resources for all of these
477488
platforms.
478489

479-
1. [AWS Amplify CLI](https://github.com/aws-amplify/amplify-cli)
490+
1. [AWS Amplify for Flutter](https://github.com/aws-amplify/amplify-flutter)
480491
2. [AWS Amplify for iOS](https://github.com/aws-amplify/amplify-ios)
481492
3. [AWS Amplify for JavaScript](https://github.com/aws-amplify/amplify-js)
493+
4. [AWS Amplify CLI](https://github.com/aws-amplify/amplify-cli)
482494

483-
AWS Amplify plugins are built on top of the AWS SDKs. AWS SDKs are a
495+
AWS Amplify plugins are built on top of "low-level" AWS SDKs. AWS SDKs are a
484496
toolkit for interacting with AWS backend resources.
485497

486498
1. [AWS SDK for Android](https://github.com/aws-amplify/aws-sdk-android)
487499
2. [AWS SDK for iOS](https://github.com/aws-amplify/aws-sdk-ios)
488-
3. [AWS SDK for JavaScript](https://github.com/aws/aws-sdk-js)
489-
490-
Not officially part of the AWS SDKs, [AppSync](https://aws.amazon.com/appsync/) is an opinionated,
491-
mobile-oriented GraphQL management service. It is used by Amplify's
492-
DataStore and API plugins.
493-
494-
1. [Android AppSync Client](https://github.com/awslabs/aws-mobile-appsync-sdk-android)
495-
2. [iOS AppSync Client](https://github.com/awslabs/aws-mobile-appsync-sdk-ios)
496-
3. [JavaScript AppSync Client](https://github.com/awslabs/aws-mobile-appsync-sdk-js)
500+
3. [AWS SDK for JavaScript](https://github.com/aws/aws-sdk-js-v3)
497501

498502
## Finding Contributions to Make
499503
Looking at [the existing issues](https://github.com/aws-amplify/amplify-android/issues) is a
@@ -519,3 +523,4 @@ contribution.
519523
We may ask you to sign a
520524
[Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for
521525
larger changes.
526+

README.md

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
</a>
99

1010

11-
AWS Amplify provides a high-level interface to perform different categories of
12-
cloud operations. Each category is fulfilled by a _plugin_. You specify which
13-
plugins to use during setup.
11+
AWS Amplify provides a high-level interface to perform different
12+
**categories** of cloud operations. Each category is fulfilled by a
13+
**plugin**. You specify which plugins to use during setup.
1414

1515
The default plugins that we provide are designed to facilitate interaction with
16-
Amazon Web Services (AWS). But, the Amplify framework is designed to be
16+
Amazon Web Services (AWS). But, the Amplify Framework is designed to be
1717
extensible to any other backend or service.
1818

1919
To familiarize yourself with Amplify, checkout our [Getting Started
2020
Guide](https://docs.amplify.aws/start/q/integration/android).
2121

22-
## Features / APIs
22+
## Categories
2323

2424
- **[Authentication](https://docs.amplify.aws/lib/auth/getting-started/q/platform/android)**
2525
APIs and building blocks for developers who want to create user authentication
@@ -63,31 +63,46 @@ dependencies section:
6363

6464
```groovy
6565
dependencies {
66-
implementation 'com.amplifyframework:core:1.1.2'
67-
6866
// Only specify modules that provide functionality your app will use
69-
implementation 'com.amplifyframework:aws-analytics-pinpoint:1.1.2'
70-
implementation 'com.amplifyframework:aws-api:1.1.2'
71-
implementation 'com.amplifyframework:aws-auth-cognito:1.1.2'
72-
implementation 'com.amplifyframework:aws-datastore:1.1.2'
73-
implementation 'com.amplifyframework:aws-predictions:1.1.2'
74-
implementation 'com.amplifyframework:aws-storage-s3:1.1.2'
67+
implementation 'com.amplifyframework:aws-analytics-pinpoint:1.3.0'
68+
implementation 'com.amplifyframework:aws-api:1.3.0'
69+
implementation 'com.amplifyframework:aws-auth-cognito:1.3.0'
70+
implementation 'com.amplifyframework:aws-datastore:1.3.0'
71+
implementation 'com.amplifyframework:aws-predictions:1.3.0'
72+
implementation 'com.amplifyframework:aws-storage-s3:1.3.0'
7573
}
7674
```
7775

78-
### Java 8 Compatibility
76+
### Java 8 Requirement
7977

80-
Amplify Android uses Java 8 features. Please add a `compileOptions`
78+
Amplify Android _requires_ Java 8 features. Please add a `compileOptions`
8179
block inside your app's `build.gradle`, as below:
8280

8381
```gradle
8482
android {
8583
compileOptions {
84+
coreLibraryDesugaringEnabled true
8685
sourceCompatibility JavaVersion.VERSION_1_8
8786
targetCompatibility JavaVersion.VERSION_1_8
8887
}
8988
}
9089
```
90+
In the same file, add core library desugaring in your `dependencies`
91+
block:
92+
```gradle
93+
dependencies {
94+
// Add this line
95+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10'
96+
}
97+
```
98+
99+
### Rx Support
100+
101+
By default, Amplify's interfaces render results through async callbacks.
102+
However, we also offer an Rx-compatible front-end to Amplify.
103+
104+
See [Using RxJava with Amplify](https://docs.amplify.aws/lib/project-setup/rxjava/q/platform/android)
105+
for more information.
91106

92107
### Authentication
93108

@@ -113,3 +128,4 @@ and we'll get back to you.
113128
## Contribute to the Project
114129

115130
Please see the [Contributing Guidelines](./CONTRIBUTING.md).
131+

0 commit comments

Comments
 (0)