@@ -40,15 +40,15 @@ environment variables are set. A convenient way of doing this is to add them
4040into ` ~/.bashrc ` . On a Mac, the SDK and Java installation used by the SDK may
4141be found:
4242
43- ```
43+ ``` shell
4444export ANDROID_HOME=~ /Library/Android/sdk
4545export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home
4646```
4747Note: JDK 11, 12, 13, etc. have known issues and are not supported.
4848
4949Now, clone the Amplify Android project from GitHub.
5050
51- ```
51+ ``` shell
5252git clone
[email protected] :aws-amplify/amplify-android.git
5353```
5454Load 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
5959Project ⌘F9". If working on the command line, you can do the same thing
6060via:
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
7474To publish the outputs of the build, execute the following command from
7575the 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
128128Be aware of the Getting Started and Pull Request guides. This portion deals
129129actually 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.
155170For example, let's say you want to add a ` Merger ` component to the AppSync
156171Local implementation. Create a file in that module, and a unit test for it:
157172
158- ```
173+ ``` console
159174aws-datastore/src/main/com/amplifyframework/datastore/syncengine/Merger.java
160175aws-datastore/src/test/com/amplifyframework/datastore/syncengine/MergerTest.java
161176```
162177
163178The 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:
285300This will perform a clean build, run Checkstyle, Android Lint, and all unit
286301tests. 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.
302317If you are part of the private access list, the command below will copy
303318those configurations to your local workspace:
304319
305- ```
320+ ``` shell
306321cd amplify-android
307322.circleci/copy-configs
308323```
309324
310325To run a __ specific__ test:
311326
312- ```
327+ ``` shell
313328test=' com.amplifyframework.api.aws.RestApiInstrumentationTest#getRequestWithIAM'
314329./gradlew :cAT -Pandroid.testInstrumentationRunnerArguments.class=" $test "
315330```
316331
317332To 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
344359First, create a _ fork_ of ` amplify-android ` . Clone it, and make changes to this _ fork_ .
345360
346- ```
361+ ``` shell
347362git 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
357372include design documents, StackOverflow implementation notes, GitHub issues,
358373etc. All links must be publicly accessible.
359374
360- ```
375+ ``` console
361376[aws-datatore] Add a 3-way merging component for network ingress
362377
363378The Merger checks the state of the Mutation Outbox before applying
@@ -370,26 +385,22 @@ See also: https://stackoverflow.com/a/58662077/695787
370385
371386Now, save your work to a new branch:
372387
373- ```
388+ ``` shell
374389git checkout -B add_merger_to_datastore
375390```
376391
377392To publish it:
378393
379- ```
394+ ``` shell
380395git push -u origin add_merger_to_datastore
381396```
382397
383398This last step will give you a URL to view a GitHub page in your browser.
384399Copy-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
394405your PR must also pass the CircleCI workflow and LGTM validations. CircleCI
395406will run all build tasks (Checkstyle, Lint, unit tests).
@@ -403,26 +414,26 @@ the PR.
403414### Environment Debugging
404415
405416Are 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
423434Do you have the Android SDK setup, and do you have a pointer to the Java environment?
424435
425- ```
436+ ``` console
426437echo -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
433444If the build fails, and you can't figure out why from a Google search /
434445StackOverflow session, try passing options to Gradle:
435446
436- ```
447+ ``` shell
437448./gradlew --stacktrace
438449```
439450
440451The next flag will spit out lots of info. It's only useful if you pipe the
441452output 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
450461want to see the output on the device that occurs, while the tests are
451462executing.
452463
453- ```
464+ ``` shell
454465# If you run this same code in a script/block, this will clear the log
455466# file each time.
456467rm -f device-logs-during-test.log
@@ -476,24 +487,17 @@ iOS, and numerous JavaScript-based web platforms. The Amplify CLI
476487provides an entry point to configure backend resources for all of these
477488platforms.
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 )
4804912 . [ AWS Amplify for iOS] ( https://github.com/aws-amplify/amplify-ios )
4814923 . [ 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
484496toolkit for interacting with AWS backend resources.
485497
4864981 . [ AWS SDK for Android] ( https://github.com/aws-amplify/aws-sdk-android )
4874992 . [ 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
499503Looking at [ the existing issues] ( https://github.com/aws-amplify/amplify-android/issues ) is a
@@ -519,3 +523,4 @@ contribution.
519523We may ask you to sign a
520524[ Contributor License Agreement (CLA)] ( http://en.wikipedia.org/wiki/Contributor_License_Agreement ) for
521525larger changes.
526+
0 commit comments