Skip to content

Commit

Permalink
Merge pull request #72 from adobe/staging
Browse files Browse the repository at this point in the history
Staging -> Main v1.1.0 Release
  • Loading branch information
emdobrin authored Jun 8, 2022
2 parents 712f9b3 + 92d38af commit 7338285
Show file tree
Hide file tree
Showing 91 changed files with 6,092 additions and 1,637 deletions.
60 changes: 57 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,37 @@ workflows:
version: 2
build-test-deploy:
jobs:
- build-and-unit-test
- functional-test
- validate-code
- build-and-unit-test:
requires:
- validate-code
- functional-test:
requires:
- validate-code

jobs:
validate-code:
working_directory: ~/code
docker:
- image: circleci/android:api-29-node
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout

- run:
name: Check Code Format
command: make format-check

build-and-unit-test:
working_directory: ~/code
docker:
- image: circleci/android:api-29
- image: circleci/android:api-29-node
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout

- run:
name: Javadoc
command: make ci-javadoc
Expand All @@ -36,8 +55,26 @@ jobs:
- run:
name: UnitTests
command: make ci-unit-test

# code coverage
- run:
name: Upload Code Coverage Report
command: |
curl -s https://codecov.io/bash > codecov;
VERSION=$(grep 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2);
SHAVERSION=$(shasum -v);
echo "Using CodeCov version '$VERSION'"
echo "Using shasum '$SHAVERSION'"
for i in 1 256 512
do
shasum -a $i -c --ignore-missing <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM") ||
shasum -a $i -c <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM" | grep -w "codecov")
done
bash ./codecov -v -X s3 -c -D "./ci/unit-test/build/reports" -F unit-tests
- store_artifacts:
path: ci/unit-test/build/reports

- store_test_results:
path: ci/unit-test/build/test-results

Expand All @@ -55,8 +92,25 @@ jobs:
# The test command
test-command: make ci-functional-test

# code coverage
- run:
name: Upload Code Coverage Report
command: |
curl -s https://codecov.io/bash > codecov;
VERSION=$(grep 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2);
SHAVERSION=$(shasum -v);
echo "Using CodeCov version '$VERSION'"
echo "Using shasum '$SHAVERSION'"
for i in 1 256 512
do
shasum -a $i -c --ignore-missing <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM") ||
shasum -a $i -c <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM" | grep -w "codecov")
done
bash ./codecov -v -X s3 -c -D "./ci/functional-test/build/reports" -F functional-tests
- store_artifacts:
path: ci/functional-test/build/reports

- store_test_results:
path: ci/functional-test/build/outputs/androidTest-results

Expand Down
5 changes: 5 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

make format
git diff --cached --name-only --diff-filter=d | while read filename; do git add "$filename"; done

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ ci/
# IntelliJ
*.iml
**/.idea/

# Secrets
**/*/values/secrets.xml
53 changes: 53 additions & 0 deletions Documentation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Advertising identifier

## Configuration
To enable advertising identifier features in the sample app, follow these steps:
1. Update the value for key `gms_ads_app_id` located in the `secrets.xml` at [aepsdk-edgeidentity-android/code/app/src/main/res/values](../code/app/src/main/res/values/secrets.xml) with a valid Google AdMob app ID.
- See Google's [quick start reference](https://developers.google.com/admob/android/quick-start) on how to get your AdMob app ID. See step 3 of the [Configure your app](https://developers.google.com/admob/android/quick-start#import_the_mobile_ads_sdk) section for a free public test app ID from Google.
- Any real key values in the `secrets.xml` file should **not** be committed to the repository.
2. By default, the ad ID features are commented out in the sample app. To enable these features, uncomment the implemention code using [find and replace all](https://www.jetbrains.com/help/idea/finding-and-replacing-text-in-project.html#replace_search_string_in_project) to replace all instances of:
```java
/* Ad ID implementation
```
with:
```java
//* Ad ID implementation
```
Each code block has a pair of block comments wrapped around it to enable this behavior:
```java
/* Ad ID implementation (pt. 1/4)
<commented implementation code...>
/* Ad ID implementation (pt. 1/4) */
```

After replacement it will become:
```java
//* Ad ID implementation (pt. 1/4)
<active implementation code!>
//* Ad ID implementation (pt. 1/4) */
```

For convenience, these are the default find and replace shortcuts in Android Studio:
[<img src="./assets/find-and-replace-shortcuts.png" alt="Default shortcuts for find and replace" width="500"/>](./assets/find-and-replace-shortcuts.png)

The shortcut should open a window that looks like the following:
[<img src="./assets/find-and-replace-all-example.png" alt="Example of find and replace" width="500"/>](./assets/find-and-replace-all-example.png)
There should be 5 pairs of special comment blocks (10 total matches) across two files:
`app/build.gradle`, `CustomIdentityFragment.kt`, and `SharedViewModel.kt`

3. With the implementation code and gradle files uncommented with new dependencies, sync the project with the Gradle file changes using: File -> Sync Project with Gradle Files

[<img src="./assets/sync-project-gradle-example.png" alt="Example of find and replace" width="500"/>](./assets/sync-project-gradle-example.png)

The app should now be properly configured to use advertising identifier features.

To **disable** these features, follow these steps:
1. [Find and replace](https://www.jetbrains.com/help/idea/finding-and-replacing-text-in-project.html#replace_search_string_in_project) all instances of:
```java
//* Ad ID implementation
```
with:
```java
/* Ad ID implementation
```
2. Sync Project with Gradle files using: File -> Sync Project with Gradle Files
Loading

0 comments on commit 7338285

Please sign in to comment.