Skip to content

Commit

Permalink
Merge pull request #107 from adobe/staging
Browse files Browse the repository at this point in the history
Merge `staging` into `main` for Assurance 3.0.0 release
  • Loading branch information
prudrabhat committed Apr 2, 2024
2 parents d3b79f1 + b035dbf commit 0ea983f
Show file tree
Hide file tree
Showing 166 changed files with 10,005 additions and 8,671 deletions.
44 changes: 27 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
version: 2.1

orbs:
android: circleci/android@2.0
android: circleci/android@2.4.0
codecov: codecov/codecov@4.0.1

workflows:
version: 2
aepsdk-core-ci:
aepsdk-assurance-ci:
jobs:
- build-and-unit-test
- functional-test

jobs:
build-and-unit-test:
executor:
name: android/android-machine
name: android/android-docker
resource-class: large
tag: 2022.01.1
tag: 2024.01.1

steps:
- checkout
Expand All @@ -25,39 +26,48 @@ jobs:
command: make checkformat

- run:
name: Generate release build
command: make generate-library-release
name: Assemble Phone Release
command: make assemble-phone-release

- run:
name: Generate JavaDoc
command: make javadoc
name: Run Assurance Unit Tests with coverage
command: make unit-test-coverage

- run:
name: Run Unit tests
command: make unit-test
- codecov/upload:
file: ./code/assurance/build/reports/coverage/test/phone/debug/report.xml
flags: unit-tests

- store_test_results:
path: code/assurance/build/test-results/

- store_artifacts:
path: code/assurance/build/reports

- store_test_results:
path: code/assurance/build/test-results/testPhoneDebugUnitTest
- run:
name: Generate JavaDoc
command: make javadoc


functional-test:
executor:
name: android/android-machine
resource-class: large
tag: 2022.01.1
tag: 2024.01.1

steps:
- checkout

- android/start-emulator-and-run-tests:
system-image: system-images;android-29;default;x86
post-emulator-launch-assemble-command: make build-release
test-command: make functional-test
post-emulator-launch-assemble-command: make assemble-phone-release
test-command: make functional-test-coverage

- codecov/upload:
file: "./code/core/build/reports/coverage/androidTest/phone/debug/connected/report.xml"
flags: functional-tests

- store_artifacts:
path: code/assurance/build/reports

- store_test_results:
path: code/assurance/build/outputs/androidTest-results
path: code/assurance/build/outputs/androidTest-results
4 changes: 4 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
template: |
## What’s Changed
$CHANGES
53 changes: 44 additions & 9 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,69 @@
name: Publish package to the Maven Central Repository
name: Publish Release

on:
push:
branches:
- main
## Manual Workflow trigger
workflow_dispatch:
inputs:
tag:
description: 'tag/version'
required: true

action_tag:
description: 'Create tag? ("no" to skip)'
required: true
default: 'yes'

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
java-version: 17

- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Verify version
run: |
set -eo pipefail
echo Release version: ${{ github.event.inputs.tag }}
(./scripts/version.sh -v ${{ github.event.inputs.tag }})
- name: Import GPG key
env:
GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
run: |
echo $GPG_SECRET_KEYS | base64 --decode | gpg --import --no-tty --batch --yes
echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust --no-tty --batch --yes
- name: Publish to maven central repository
- name: Publish to Maven Central Repository
run: make ci-publish-main
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}

- name: Create GitHub Release
id: create_release
uses: release-drafter/release-drafter@v5
if: ${{ github.event.inputs.action_tag == 'yes' }}
with:
name: v${{ github.event.inputs.tag }}
tag: v${{ github.event.inputs.tag }}
version: v${{ github.event.inputs.tag }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 15 additions & 8 deletions .github/workflows/maven-snapshot.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
name: Publish package to the Maven Central Staging Repository
name: Publish Snapshot

on:
push:
branches:
- staging
## Manual Workflow trigger
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Java
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
java-version: 17

- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Import GPG key
env:
GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
run: |
echo $GPG_SECRET_KEYS | base64 --decode | gpg --import --no-tty --batch --yes
echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust --no-tty --batch --yes
- name: Publish to maven central staging repository
- name: Publish to Maven Central Staging Repository
run: make ci-publish-staging
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Update Extension Version
on:
workflow_dispatch:
inputs:
version:
description: 'New version to use for the Assurance extension. Example: 3.0.0'
required: true


core-dependency:
description: '[Optional] Update Core dependency in pom.xml. Example: 3.0.0'
required: false

jobs:
update-version:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Update Versions
run: (./scripts/version.sh -u -v ${{ github.event.inputs.version }} -d "Core ${{ github.event.inputs.core-dependency }}")

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ github.token }}
commit-message: Updating version to ${{ github.event.inputs.version }}.
branch: version-${{ github.event.inputs.version }}-update
delete-branch: true
title: Updating version to ${{ github.event.inputs.version }}
body: Updating version to ${{ github.event.inputs.version }}
23 changes: 13 additions & 10 deletions Documentation/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@ Assurance extension has a dependency on [AEP Core SDK](https://github.com/adobe/

## Add Assurance extension to your app

1. Installation via [Maven](https://maven.apache.org/) & [Gradle](https://gradle.org/) is the easiest and recommended way to get the AEP SDK into your Android app. Add a dependency on Assurance and Core to your mobile application. To ensure consistent builds, it is best to explicitly specify the dependency version and update them manually.
1. Installation via [Maven](https://maven.apache.org/) & [Gradle](https://gradle.org/) is the easiest and recommended way to get the AEP SDK into your Android app. Add a dependency on Assurance and Core to your mobile application. To ensure consistent builds, it is best to use the AEP SDK Bill of Materials (BOM) and explicitly specify the `sdk-bom` dependency version and update it manually when required.
### Kotlin

```kotlin
implementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+"))
implementation("com.adobe.marketing.mobile:core")
implementation("com.adobe.marketing.mobile:assurance")
```
implementation 'com.adobe.marketing.mobile:core:2.+'
implementation 'com.adobe.marketing.mobile:assurance:2.+'

### Groovy

```groovy
implementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')
implementation 'com.adobe.marketing.mobile:core'
implementation 'com.adobe.marketing.mobile:assurance'
```

2. Import MobileCore and Assurance extensions:
Expand All @@ -30,13 +40,6 @@ Assurance extension has a dependency on [AEP Core SDK](https://github.com/adobe/
import com.adobe.marketing.mobile.Assurance
```

**Note**: Assurance SDK displays some UI components using the source app context. If you see an error similar to the following :

```
AAPT: error: attribute layout_constraintStart_toStartOf (aka <your_app_name>:layout_constraintStart_toStartOf) not found
```
while building your app with Assurance SDK, include a dependency on `implementation 'androidx.constraintlayout:constraintlayout:1.1.3'` or newer in your app.

3. Import the Assurance library into your project and register it with `MobileCore`

### Java
Expand Down
43 changes: 24 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ EXTENSION-LIBRARY-FOLDER-NAME = assurance
TEST-APP-FOLDER-NAME = assurance-testapp
TEST-APP-DEBUG-APK = assurance-testapp-debug.apk

BUILD-ASSEMBLE-LOCATION = ./ci/assemble
ROOT_DIR=$(shell git rev-parse --show-toplevel)

PROJECT_NAME = $(shell cat $(ROOT_DIR)/code/gradle.properties | grep "moduleProjectName" | cut -d'=' -f2)
SOURCE_FILE_DIR = $(ROOT_DIR)/code/$(PROJECT_NAME)
AAR_FILE_DIR = $(ROOT_DIR)/code/$(PROJECT_NAME)/build/outputs/aar
AAR_FILE_DIR = $(ROOT_DIR)/code/$(EXTENSION-LIBRARY-FOLDER-NAME)/build/outputs/aar
TEST_APP_APK_OUTPUT_DIR = $(ROOT_DIR)/code/$(TEST-APP-FOLDER-NAME)/build/outputs/apk
ARTIFACTS_DIR = $(ROOT_DIR)/artifacts

Expand All @@ -21,10 +18,8 @@ checkformat:
format:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) spotlessApply)

build:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) lint)
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) assemblePhone)

## This is a custom app build command to generate and copy the test app apk
## Use assemble-app for general usecases
build-app:
(./code/gradlew -p code clean)
# Delete TEST-APP-DEBUG-APK-NAME from the contents of ARTIFACTS_DIR
Expand All @@ -37,32 +32,42 @@ build-app:
(cp -r $(TEST_APP_APK_OUTPUT_DIR)/debug/$(TEST-APP-DEBUG-APK) $(ARTIFACTS_DIR))

unit-test:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) platformUnitTestJacocoReport)
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) testPhoneDebugUnitTest)

unit-test-coverage:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) createPhoneDebugUnitTestCoverageReport)

functional-test:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) uninstallPhoneDebugAndroidTest)
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) connectedPhoneDebugAndroidTest platformFunctionalTestJacocoReport)
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) connectedPhoneDebugAndroidTest)

functional-test-coverage:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) uninstallPhoneDebugAndroidTest)
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) createPhoneDebugAndroidTestCoverageReport)

javadoc:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) javadocPublic)
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) javadocJar)

assemble-phone:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) assemblePhone)

generate-library-debug:
assemble-phone-debug:
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} assemblePhoneDebug)

generate-library-release:
assemble-phone-release:
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} assemblePhoneRelease)

build-release:
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} clean lint assemblePhoneRelease)
assemble-app:
(./code/gradlew -p code/$(TEST-APP-FOLDER-NAME) assemble)

ci-publish-staging: clean build-release
ci-publish-staging: clean assemble-phone
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} publishReleasePublicationToSonatypeRepository --stacktrace)

ci-publish-main: clean build-release
ci-publish-main: clean assemble-phone
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} publishReleasePublicationToSonatypeRepository -Prelease)

ci-publish-maven-local: clean build-release
ci-publish-maven-local: clean assemble-phone
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} publishReleasePublicationToMavenLocal -x signReleasePublication)

ci-publish-jitpack: clean build-release
ci-publish-maven-local-jitpack: clean assemble-phone
(./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} publishReleasePublicationToMavenLocal -Pjitpack -x signReleasePublication)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Refer to the [getting started guide](./Documentation/getting-started.md) for set

1. Fork this repo for your username and clone it on your development machine.
2. If you haven't already, install Android Studio on your development machine. This project has been verified to work with Andrid Studio Dolphin.
3. Open `aepsdk-assurance-android/code/settings.gradle` file in AndroidStudio
3. Open `aepsdk-assurance-android/code/settings.gradle.kts` file in AndroidStudio

You should now be able to see `assurance` and `assurance-testapp` modules under the `Project --> Android` section.

Expand Down

0 comments on commit 0ea983f

Please sign in to comment.