From b073a3be65ccec7472ca2ef313e68bec98d9571b Mon Sep 17 00:00:00 2001 From: Calise Cheung Date: Tue, 22 Aug 2023 14:36:56 -0700 Subject: [PATCH 1/7] Fix Gradle files lint warning Fix Gradle files lint warning --- code/app/build.gradle | 2 +- code/app/src/main/AndroidManifest.xml | 2 +- code/build.gradle | 2 +- code/edgeidentity/build.gradle | 38 +++++++++++++++------------ 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/code/app/build.gradle b/code/app/build.gradle index 1cef94c3..5f1fd851 100644 --- a/code/app/build.gradle +++ b/code/app/build.gradle @@ -44,7 +44,7 @@ android { } } -configurations.all { +configurations.configureEach { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' } diff --git a/code/app/src/main/AndroidManifest.xml b/code/app/src/main/AndroidManifest.xml index 3a7d481a..6ee920b2 100644 --- a/code/app/src/main/AndroidManifest.xml +++ b/code/app/src/main/AndroidManifest.xml @@ -25,7 +25,7 @@ - ` + - variant.javaCompileProvider.get().classpath.files - }) - - options { - source = "8" - links "https://developer.android.com/reference" + tasks.withType(Javadoc).tap { + configureEach { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + classpath += files(android.libraryVariants.collect { variant -> + variant.javaCompileProvider.get().classpath.files + }) + + options { + source = "8" + links "https://developer.android.com/reference" + } } } } -task javadocInternal(type: Javadoc) { +tasks.register('javadocInternal', Javadoc) { destinationDir = reporting.file("javadocInternal") options.memberLevel = JavadocMemberLevel.PRIVATE } -task javadocPublic(type: Javadoc) { +tasks.register('javadocPublic', Javadoc) { destinationDir = reporting.file("javadocPublic") options.memberLevel = JavadocMemberLevel.PUBLIC } -task javadocPublish(type: Jar) { +tasks.register('javadocPublish', Jar) { from javadocPublic archiveClassifier.set('javadoc') } @@ -173,7 +175,8 @@ signing { sign publishing.publications } -task platformUnitTestJacocoReport(type: JacocoReport, dependsOn: "testPhoneDebugUnitTest") { +tasks.register('platformUnitTestJacocoReport', JacocoReport) { + dependsOn "testPhoneDebugUnitTest" def excludeRegex = ['**/BuildConfig.class'] def debugTree = fileTree(dir: "${project.buildDir}/intermediates/javac/phoneDebug/classes/com/adobe/marketing/mobile", excludes: excludeRegex) @@ -189,7 +192,8 @@ task platformUnitTestJacocoReport(type: JacocoReport, dependsOn: "testPhoneDebug } } -task platformFunctionalTestJacocoReport(type: JacocoReport, dependsOn: "createPhoneDebugCoverageReport") { +tasks.register('platformFunctionalTestJacocoReport', JacocoReport) { + dependsOn "createPhoneDebugCoverageReport" def excludeRegex = ['**/BuildConfig.class'] def debugTree = fileTree(dir: "${project.buildDir}/intermediates/javac/phoneDebug/classes/com/adobe/marketing/mobile", excludes: excludeRegex) @@ -223,7 +227,7 @@ dependencies { androidTestImplementation 'com.adobe.marketing.mobile:identity:2.+' } -tasks.withType(Test) { +tasks.withType(Test).configureEach { testLogging { showStandardStreams = true } From 572bf2e5da62890c2b2c3bc3bbf5b7291951cf01 Mon Sep 17 00:00:00 2001 From: Calise Cheung Date: Wed, 21 Feb 2024 16:01:36 -0800 Subject: [PATCH 2/7] Android 3.0.0 migration update (#116) * Android 3.0.0 migration update Android 3.0.0 migration update * disable assemble-app disable assemble-app * disable assemble-phone disable assemble-phone * remove Assemble App remove Assemble App * Exclude duplicated edgeidentity and core module in App gradle Exclude duplicated edgeidentity and core module in App gradle * fix test app paths fix test app paths * Update Review comments Update Review comments * remove duplicated gitignore items remove duplicated gitignore items * include .gradle files include .gradle files * remove .gradle directory files remove .gradle directory files --- .circleci/config.yml | 143 ++++++----- .github/release-drafter.yml | 16 ++ .github/workflows/maven-release.yml | 64 ++++- .github/workflows/maven-snapshot.yml | 29 ++- .github/workflows/update-version.yml | 45 ++++ .gitignore | 10 + Documentation/getting-started-test-app.md | 2 +- Makefile | 107 +++----- code/.gitignore | 14 -- code/app/build.gradle | 81 ------ code/app/build.gradle.kts | 91 +++++++ code/app/src/main/AndroidManifest.xml | 2 +- .../EdgeIdentityApplication.kt | 2 +- .../identity/{app => testapp}/MainActivity.kt | 2 +- .../{app => testapp}/model/SharedViewModel.kt | 2 +- .../{app => testapp}/ui/AssuranceFragment.kt | 4 +- .../ui/CustomIdentityFragment.kt | 6 +- .../ui/GetIdentityFragment.kt | 6 +- .../ui/MultipleIdentityFragment.kt | 6 +- .../main/res/navigation/mobile_navigation.xml | 8 +- code/build.gradle | 40 --- code/build.gradle.kts | 24 ++ code/edgeidentity/build.gradle | 234 ------------------ code/edgeidentity/build.gradle.kts | 44 ++++ code/edgeidentity/consumer-rules.pro | 0 code/edgeidentity/proguard-rules.pro | 21 -- .../edge/identity/IdentityPublicAPITest.java | 19 -- .../mobile/edge/identity/Identity.java | 19 -- .../edge/identity/IdentityConstants.java | 2 +- .../edge/identity/IdentityTestUtil.java | 5 +- .../mobile/edge/identity/IdentityTests.java | 29 --- code/gradle.properties | 15 +- code/gradle/wrapper/gradle-wrapper.properties | 2 +- code/settings.gradle | 21 -- code/settings.gradle.kts | 36 +++ config/formatter/adobe.header.txt | 11 - jitpack.yml | 21 ++ scripts/version.sh | 131 ++++++++++ 38 files changed, 640 insertions(+), 674 deletions(-) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/update-version.yml delete mode 100644 code/.gitignore delete mode 100644 code/app/build.gradle create mode 100644 code/app/build.gradle.kts rename code/app/src/main/java/com/adobe/marketing/edge/identity/{app => testapp}/EdgeIdentityApplication.kt (96%) rename code/app/src/main/java/com/adobe/marketing/edge/identity/{app => testapp}/MainActivity.kt (98%) rename code/app/src/main/java/com/adobe/marketing/edge/identity/{app => testapp}/model/SharedViewModel.kt (99%) rename code/app/src/main/java/com/adobe/marketing/edge/identity/{app => testapp}/ui/AssuranceFragment.kt (93%) rename code/app/src/main/java/com/adobe/marketing/edge/identity/{app => testapp}/ui/CustomIdentityFragment.kt (97%) rename code/app/src/main/java/com/adobe/marketing/edge/identity/{app => testapp}/ui/GetIdentityFragment.kt (96%) rename code/app/src/main/java/com/adobe/marketing/edge/identity/{app => testapp}/ui/MultipleIdentityFragment.kt (97%) delete mode 100644 code/build.gradle create mode 100644 code/build.gradle.kts delete mode 100644 code/edgeidentity/build.gradle create mode 100644 code/edgeidentity/build.gradle.kts delete mode 100644 code/edgeidentity/consumer-rules.pro delete mode 100644 code/edgeidentity/proguard-rules.pro delete mode 100644 code/settings.gradle create mode 100755 code/settings.gradle.kts delete mode 100644 config/formatter/adobe.header.txt create mode 100644 jitpack.yml create mode 100755 scripts/version.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index ad3cbc41..37a614fc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,8 @@ version: 2.1 orbs: - android: circleci/android@1.0 + # Use the circleci android orb version that supports OpenJDK17 required by AGP 8.2+ + android: circleci/android@2.4.0 + codecov: codecov/codecov@4.0.1 # Workflows orchestrate a set of jobs to be run; workflows: @@ -14,104 +16,113 @@ workflows: - functional-test: requires: - validate-code - + jobs: validate-code: - working_directory: ~/code - docker: - - image: circleci/android:api-29-node - environment: - JVM_OPTS: -Xmx3200m + executor: + name: android/android-docker + resource-class: medium + tag: 2024.01.1-node + steps: - checkout - - run: - name: Check Code Format - command: make format-check + - android/restore-gradle-cache + + - android/restore-build-cache + + # - run: + # name: Check Format + # command: make checkformat + + # - run: + # name: Lint + # command: make lint + + - android/save-gradle-cache + + - android/save-build-cache + + # Store Lint report + - store_artifacts: + path: code/edgeidentity/build/reports build-and-unit-test: - working_directory: ~/code - docker: - - image: circleci/android:api-29-node - environment: - JVM_OPTS: -Xmx3200m + executor: + name: android/android-docker + resource-class: medium + tag: 2024.01.1-node + steps: - checkout + - android/restore-gradle-cache + + - android/restore-build-cache + - run: name: Javadoc - command: make ci-javadoc + command: make javadoc + - store_artifacts: - path: ci/javadoc/build/reports + path: code/edgeidentity/build/docs/javadoc - run: - name: Build - command: make ci-build - - # - run: - # name: Build App - # command: make ci-build-app + name: Assemble Phone + command: make assemble-phone - run: - name: UnitTests - command: make ci-unit-test + name: Assemble App + command: make assemble-app - # 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 + - android/run-tests: + test-command: make unit-test-coverage - store_artifacts: - path: ci/unit-test/build/reports + path: code/edgeidentity/build/reports/tests - store_test_results: - path: ci/unit-test/build/test-results + path: code/edgeidentity/build/test-results/testPhoneDebugUnitTest + + - android/save-gradle-cache + + - android/save-build-cache + + - codecov/upload: + file: code/edgeidentity/build/reports/coverage/test/phone/debug/report.xml + flags: unit-tests functional-test: - executor: + executor: name: android/android-machine - resource-class: large + resource-class: medium + tag: 2024.01.1 + steps: - checkout + + - android/restore-build-cache + + - run: + name: List available emulator images + command: sdkmanager --list + - android/start-emulator-and-run-tests: # It should match the name seen in the "sdkmanager --list" output system-image: system-images;android-29;default;x86 # The command to be run, while waiting for emulator startup - post-emulator-launch-assemble-command: make ci-build + post-emulator-launch-assemble-command: make assemble-phone # 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 + test-command: make functional-test-coverage + + - android/save-build-cache + - codecov/upload: + file: code/edgeidentity/build/reports/coverage/androidTest/phone/debug/connected/report.xml + flags: functional-tests + - store_artifacts: - path: ci/functional-test/build/reports + path: code/edgeidentity/build/reports/androidTests - store_test_results: - path: ci/functional-test/build/outputs/androidTest-results - - + path: code/edgeidentity/build/outputs/androidTest-results \ No newline at end of file diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..e053484e --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,16 @@ +# +# Copyright 2024 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +# + +template: | + ## What’s Changed + + $CHANGES \ No newline at end of file diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml index 627da1b4..2e56dc05 100644 --- a/.github/workflows/maven-release.yml +++ b/.github/workflows/maven-release.yml @@ -1,23 +1,66 @@ -name: Publish package to the Maven Central Repository -on: - push: - branches: - - main +# +# Copyright 2024 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +# + +name: Publish Release +on: + 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 + with: + ref: main + - 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: Create GH 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 }} + - name: Import GPG key env: GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }} @@ -25,8 +68,9 @@ jobs: 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 - run: make ci-publish-main + + - name: Publish to Maven Central Repository + run: make ci-publish env: SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} diff --git a/.github/workflows/maven-snapshot.yml b/.github/workflows/maven-snapshot.yml index aa38ba6c..a72603a9 100644 --- a/.github/workflows/maven-snapshot.yml +++ b/.github/workflows/maven-snapshot.yml @@ -1,17 +1,29 @@ -name: Publish package to the Maven Central Repository +# +# Copyright 2024 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +# + +name: Publish Snapshot on: - push: - branches: - - staging + 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: @@ -25,11 +37,10 @@ jobs: 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 Snapshot Repository run: make ci-publish-staging env: SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} - diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml new file mode 100644 index 00000000..8adccbfa --- /dev/null +++ b/.github/workflows/update-version.yml @@ -0,0 +1,45 @@ +# +# Copyright 2024 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +# + +name: Update Version +on: + workflow_dispatch: + inputs: + version: + description: 'New version to use for the Edge Identity 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 Edge Identity Version + 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 }} + diff --git a/.gitignore b/.gitignore index bbccea0c..a87143fd 100644 --- a/.gitignore +++ b/.gitignore @@ -5,11 +5,18 @@ bin/ build/ ci/ +.gradle/ # IntelliJ *.iml **/.idea/ +# Log Files +*.log + +#vscode + .vscode + # Secrets **/*/values/secrets.xml @@ -28,3 +35,6 @@ jacoco.exec # Dex files for ART/Dalvik VM *.dex + +.externalNativeBuild +.cxx \ No newline at end of file diff --git a/Documentation/getting-started-test-app.md b/Documentation/getting-started-test-app.md index befe36de..25609d86 100644 --- a/Documentation/getting-started-test-app.md +++ b/Documentation/getting-started-test-app.md @@ -16,7 +16,7 @@ The test app needs to be configured with the following edge extensions before it Configure a new Assurance session by setting the Base URL to `testapp://main` and launch Assurance in the demo app by running the following command in your terminal: ```bash -$ adb shell am start -W -a android.intent.action.VIEW -d "testapp://main?adb_validation_sessionid=ADD_YOUR_SESSION_ID_HERE" com.adobe.marketing.edge.identity.app +$ adb shell am start -W -a android.intent.action.VIEW -d "testapp://main?adb_validation_sessionid=ADD_YOUR_SESSION_ID_HERE" com.adobe.marketing.edge.identity.testapp ``` Note: replace `ADD_YOUR_SESSION_ID_HERE` with your Assurance session identifier. diff --git a/Makefile b/Makefile index ebae615a..b9e629f1 100644 --- a/Makefile +++ b/Makefile @@ -1,85 +1,60 @@ EXTENSION-LIBRARY-FOLDER-NAME = edgeidentity TEST-APP-FOLDER-NAME = app -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) -AAR_NAME = $(shell cat $(ROOT_DIR)/code/gradle.properties | grep "moduleAARName" | cut -d'=' -f2) -MODULE_NAME = $(shell cat $(ROOT_DIR)/code/gradle.properties | grep "moduleName" | cut -d'=' -f2) -LIB_VERSION = $(shell cat $(ROOT_DIR)/code/gradle.properties | grep "moduleVersion" | cut -d'=' -f2) -SOURCE_FILE_DIR = $(ROOT_DIR)/code/$(PROJECT_NAME) -AAR_FILE_DIR = $(ROOT_DIR)/code/$(PROJECT_NAME)/build/outputs/aar - init: git config core.hooksPath .githooks +clean: + (./code/gradlew -p code clean) + format: (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) spotlessApply) (./code/gradlew -p code/$(TEST-APP-FOLDER-NAME) spotlessApply) -format-check: - (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) spotlessCheck) - (./code/gradlew -p code/$(TEST-APP-FOLDER-NAME) spotlessCheck) +# format-license: +# (./code/gradlew -p code licenseFormat) -clean: - (rm -rf ci) - (rm -rf $(AAR_FILE_DIR)) - (./code/gradlew -p code clean) +# checkformat: +# (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) spotlessCheck) +# (./code/gradlew -p code/$(TEST-APP-FOLDER-NAME) spotlessCheck) -create-ci: clean - (mkdir -p ci) +# lint: +# (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) lint) -ci-build: create-ci - (mkdir -p ci/assemble) +unit-test: + (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) testPhoneDebugUnitTest) - (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) lint) +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) + +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) javadocJar) + +assemble-phone: (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) assemblePhone) - (mv $(AAR_FILE_DIR)/$(EXTENSION-LIBRARY-FOLDER-NAME)-phone-release.aar $(AAR_FILE_DIR)/$(MODULE_NAME)-release-$(LIB_VERSION).aar) - (cp -r ./code/$(EXTENSION-LIBRARY-FOLDER-NAME)/build $(BUILD-ASSEMBLE-LOCATION)) -ci-build-app: +assemble-phone-debug: + (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) assemblePhoneDebug) + +assemble-phone-release: + (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) assemblePhoneRelease) + +assemble-app: (./code/gradlew -p code/$(TEST-APP-FOLDER-NAME) assemble) -ci-unit-test: create-ci - (mkdir -p ci/unit-test) - (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) platformUnitTestJacocoReport) - (cp -r ./code/$(EXTENSION-LIBRARY-FOLDER-NAME)/build ./ci/unit-test/) +ci-publish-maven-local-jitpack: + (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) publishReleasePublicationToMavenLocal -Pjitpack -x signReleasePublication) -ci-functional-test: create-ci - (mkdir -p ci/functional-test) - (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) uninstallPhoneDebugAndroidTest) - (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) connectedPhoneDebugAndroidTest platformFunctionalTestJacocoReport) - (cp -r ./code/$(EXTENSION-LIBRARY-FOLDER-NAME)/build ./ci/functional-test) - -ci-javadoc: create-ci - (mkdir -p ci/javadoc) - (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) javadocPublic > ci/javadocPublic.log 2>&1) - (cp -r ./code/$(EXTENSION-LIBRARY-FOLDER-NAME)/build ./ci/javadoc) - -ci-generate-library-debug: - (./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} assemblePhoneDebug) - -ci-generate-library-release: - (./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} assemblePhoneRelease) - -build-release: - (./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} clean lint assemblePhoneRelease) - -ci-publish-staging: clean build-release - (./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} publishReleasePublicationToSonatypeRepository --stacktrace) - -ci-publish-main: clean build-release - (./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} publishReleasePublicationToSonatypeRepository -Prelease) - -# usage: update-version VERSION=9.9.9 CORE-VERSION=8.8.8 -# usage: update-version VERSION=9.9.9 -update-version: - @echo "Updating version to $(VERSION), Core version to $(CORE-VERSION)" - sed -i '' "s/[0-9]*\.[0-9]*\.[0-9]/$(VERSION)/g" ./code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityConstants.java - sed -i '' "s/\(moduleVersion=\)[0-9]*\.[0-9]*\.[0-9]/\1$(VERSION)/g" ./code/gradle.properties - @if [ -z "$(CORE-VERSION)" ]; then \ - echo "CORE-VERSION was not provided, skipping"; \ - else \ - sed -i '' "s/\(mavenCoreVersion=\)[0-9]*\.[0-9]*\.[0-9]/\1$(CORE-VERSION)/g" ./code/gradle.properties; \ - fi \ No newline at end of file +ci-publish-staging: + (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) publishReleasePublicationToSonatypeRepository) + +ci-publish: + (./code/gradlew -p code/${EXTENSION-LIBRARY-FOLDER-NAME} publishReleasePublicationToSonatypeRepository -Prelease) \ No newline at end of file diff --git a/code/.gitignore b/code/.gitignore deleted file mode 100644 index 603b1407..00000000 --- a/code/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -*.iml -.gradle -/local.properties -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml -.DS_Store -/build -/captures -.externalNativeBuild -.cxx diff --git a/code/app/build.gradle b/code/app/build.gradle deleted file mode 100644 index 5f1fd851..00000000 --- a/code/app/build.gradle +++ /dev/null @@ -1,81 +0,0 @@ -plugins { - id 'com.android.application' - id 'com.diffplug.spotless' - id 'org.jetbrains.kotlin.android' -} - -spotless { - kotlin { - target "src/*/java/**/*.kt" - ktlint('0.41.0') - licenseHeaderFile "../../config/formatter/adobe.header.txt" - } -} - -android { - namespace 'com.adobe.marketing.edge.identity.app' - - compileSdk rootProject.ext.compileSdkVersion - - defaultConfig { - applicationId "com.adobe.marketing.edge.identity.app" - minSdk rootProject.ext.minSdkVersion - targetSdk rootProject.ext.targetSdkVersion - versionCode rootProject.ext.versionCode - versionName project.property('moduleVersion') as String ?: "1.0.0 (Default)" - multiDexEnabled = true - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = rootProject.ext.kotlinJvmTarget - } -} - -configurations.configureEach { - resolutionStrategy.cacheChangingModulesFor 0, 'seconds' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:${rootProject.ext.kotlinVersion}" - implementation 'androidx.core:core-ktx:1.3.2' - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'com.google.android.material:material:1.3.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - implementation 'androidx.navigation:navigation-fragment:2.3.3' - implementation 'androidx.navigation:navigation-ui:2.3.3' - implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' - implementation 'androidx.navigation:navigation-fragment-ktx:2.3.3' - implementation 'androidx.navigation:navigation-ui-ktx:2.3.3' - - implementation project(':edgeidentity') - - implementation "com.adobe.marketing.mobile:core:2.+" - implementation 'com.adobe.marketing.mobile:identity:2.+' - implementation ('com.adobe.marketing.mobile:edgeconsent:2.+') { - transitive = false - } - implementation 'com.adobe.marketing.mobile:assurance:2.+' - implementation ('com.adobe.marketing.mobile:edge:2.+') { - transitive = false - } - - /* Ad ID implementation (pt. 1/5) - implementation("com.google.android.gms:play-services-ads-lite:20.6.0") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0") - /* Ad ID implementation (pt. 1/5) */ - implementation("androidx.multidex:multidex:2.0.1") -} diff --git a/code/app/build.gradle.kts b/code/app/build.gradle.kts new file mode 100644 index 00000000..60dce045 --- /dev/null +++ b/code/app/build.gradle.kts @@ -0,0 +1,91 @@ +import com.adobe.marketing.mobile.gradle.BuildConstants + +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("com.diffplug.spotless") +} + +val mavenCoreVersion: String by project + +configure { + kotlin { + target("src/*/java/**/*.kt") + ktlint(BuildConstants.Versions.KTLINT) + licenseHeader(BuildConstants.ADOBE_LICENSE_HEADER) + } +} + +android { + namespace = "com.adobe.marketing.edge.identity.testapp" + + compileSdk = BuildConstants.Versions.COMPILE_SDK_VERSION + + defaultConfig { + applicationId = "com.adobe.marketing.edge.identity.testapp" + minSdk = BuildConstants.Versions.MIN_SDK_VERSION + compileSdk = BuildConstants.Versions.COMPILE_SDK_VERSION + targetSdk = BuildConstants.Versions.TARGET_SDK_VERSION + versionCode = BuildConstants.Versions.VERSION_CODE + versionName = BuildConstants.Versions.VERSION_NAME + multiDexEnabled = true + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = BuildConstants.Versions.JAVA_SOURCE_COMPATIBILITY + targetCompatibility = BuildConstants.Versions.JAVA_TARGET_COMPATIBILITY + } + + kotlinOptions { + jvmTarget = BuildConstants.Versions.KOTLIN_JVM_TARGET + } +} + +configurations.configureEach { + resolutionStrategy.cacheChangingModulesFor(0, "seconds") +} + +dependencies { + implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.21") + implementation("com.google.android.material:material:1.3.0") + implementation(project(":edgeidentity")) + + //TO DO update to release versions + implementation("com.adobe.marketing.mobile:core:$mavenCoreVersion-SNAPSHOT") + implementation("com.adobe.marketing.mobile:identity:2.+") + implementation("com.adobe.marketing.mobile:edgeconsent:2.0.0") { + exclude(group = "com.adobe.marketing.mobile", module = "edge") + } + implementation("com.adobe.marketing.mobile:assurance:2.+") + implementation("com.adobe.marketing.mobile:edge:2.0.0") { + exclude(group = "com.adobe.marketing.mobile", module = "core") + exclude(group = "com.adobe.marketing.mobile", module = "edgeidentity") + } + implementation("androidx.core:core-ktx:1.3.2") + implementation("androidx.appcompat:appcompat:1.2.0") + implementation("androidx.legacy:legacy-support-v4:1.0.0") + implementation("com.google.android.material:material:1.3.0") + implementation("androidx.constraintlayout:constraintlayout:2.0.4") + implementation("androidx.navigation:navigation-fragment:2.3.3") + implementation("androidx.navigation:navigation-ui:2.3.3") + implementation("androidx.lifecycle:lifecycle-extensions:2.2.0") + implementation("androidx.navigation:navigation-fragment-ktx:2.3.3") + implementation("androidx.navigation:navigation-ui-ktx:2.3.3") + + implementation("androidx.multidex:multidex:2.0.1") +} + + /* Ad ID implementation (pt. 1/5) + implementation("com.google.android.gms:play-services-ads-lite:20.6.0") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0") + /* Ad ID implementation (pt. 1/5) */ + +} diff --git a/code/app/src/main/AndroidManifest.xml b/code/app/src/main/AndroidManifest.xml index 6ee920b2..8ccc02c2 100644 --- a/code/app/src/main/AndroidManifest.xml +++ b/code/app/src/main/AndroidManifest.xml @@ -5,7 +5,7 @@ diff --git a/code/build.gradle b/code/build.gradle deleted file mode 100644 index 744530db..00000000 --- a/code/build.gradle +++ /dev/null @@ -1,40 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -plugins { - id 'com.android.application' version '7.3.0' apply false - id 'com.android.library' version '7.3.0' apply false - id 'com.diffplug.gradle.spotless' version '6.11.0' apply false - id 'org.jetbrains.kotlin.android' version "1.6.21" apply false -} - -ext { - // android config - minSdkVersion = 19 - targetSdkVersion = 33 - compileSdkVersion = 33 - versionCode = 1 - - // java config - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - - // kotlin config - kotlinVersion = "1.6.21" - kotlinJvmTarget = "1.8" - - // test dependencies - junitVersion = "1.1.3" - mockitoVersion = "4.5.1" - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - - // spotless - prettierVersion = "2.7.1" - prettierPluginJavaVersion = "1.6.2" - - // jacoco - jacocoVersion = "0.8.8" -} - -tasks.register('clean', Delete) { - delete rootProject.buildDir -} \ No newline at end of file diff --git a/code/build.gradle.kts b/code/build.gradle.kts new file mode 100644 index 00000000..99924f5d --- /dev/null +++ b/code/build.gradle.kts @@ -0,0 +1,24 @@ +/* + * Copyright 2024 Adobe. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + * OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +apply(plugin = "aep-license") +buildscript { + repositories { + gradlePluginPortal() + google() + mavenCentral() + maven { url = uri("https://jitpack.io") } + mavenLocal() + } + dependencies { + classpath("com.github.adobe:aepsdk-commons:884c937705") + } +} \ No newline at end of file diff --git a/code/edgeidentity/build.gradle b/code/edgeidentity/build.gradle deleted file mode 100644 index a38f3cbe..00000000 --- a/code/edgeidentity/build.gradle +++ /dev/null @@ -1,234 +0,0 @@ -plugins { - id 'com.android.library' - id 'jacoco' - id 'maven-publish' - id 'signing' - id 'com.diffplug.spotless' -} - -jacoco { - toolVersion = rootProject.ext.jacocoVersion -} - -preBuild.dependsOn spotlessApply - -spotless { - java { - toggleOffOn("format:off", "format:on") - target "src/*/java/**/*.java" - removeUnusedImports() - prettier(['prettier': rootProject.ext.prettierVersion, 'prettier-plugin-java': rootProject.ext.prettierPluginJavaVersion]) - .config(['parser': 'java', 'tabWidth': 4, 'useTabs': true, 'printWidth': 120]) - endWithNewline() - licenseHeaderFile "../../config/formatter/adobe.header.txt" - } -} - -android { - namespace 'com.adobe.marketing.mobile.edge.identity' - - compileSdk rootProject.ext.compileSdkVersion - - defaultConfig { - minSdk rootProject.ext.minSdkVersion - targetSdk rootProject.ext.targetSdkVersion - - testInstrumentationRunner rootProject.ext.testInstrumentationRunner - consumerProguardFiles "consumer-rules.pro" - } - - flavorDimensions = ["target"] - productFlavors { - phone { - dimension "target" - } - } - - buildTypes { - debug { - testCoverageEnabled true - debuggable true - } - - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - - testOptions { - unitTests.returnDefaultValues = true - } - - compileOptions { - sourceCompatibility rootProject.ext.sourceCompatibility - targetCompatibility rootProject.ext.targetCompatibility - } -} - -afterEvaluate { - tasks.withType(Javadoc).tap { - configureEach { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - classpath += files(android.libraryVariants.collect { variant -> - variant.javaCompileProvider.get().classpath.files - }) - - options { - source = "8" - links "https://developer.android.com/reference" - } - } - } -} - -tasks.register('javadocInternal', Javadoc) { - destinationDir = reporting.file("javadocInternal") - options.memberLevel = JavadocMemberLevel.PRIVATE -} - -tasks.register('javadocPublic', Javadoc) { - destinationDir = reporting.file("javadocPublic") - options.memberLevel = JavadocMemberLevel.PUBLIC -} - -tasks.register('javadocPublish', Jar) { - from javadocPublic - archiveClassifier.set('javadoc') -} - -def isReleaseBuild() { - return hasProperty('release') -} - -version = isReleaseBuild() ? rootProject.moduleVersion : rootProject.moduleVersion+"-SNAPSHOT" - -publish.dependsOn('assemblePhone') - -publishing { - publications { - release(MavenPublication) { - groupId = 'com.adobe.marketing.mobile' - artifactId = rootProject.moduleName - version = version - artifact("$buildDir/outputs/aar/${rootProject.moduleAARName}") - artifact javadocPublish - - pom { - name = mavenRepoName - description = mavenRepoDescription - url = 'https://developer.adobe.com/client-sdks' - licenses { - license { - name = 'The Apache License, Version 2.0' - url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' - distribution = 'repo' - } - } - developers { - developer { - id = 'adobe' - name = 'adobe' - email = 'adobe-mobile-testing@adobe.com' - } - } - scm { - connection = 'scm:git:github.com//adobe/aepsdk-edgeidentity-android.git' - developerConnection = 'scm:git:ssh://github.com//adobe/aepsdk-edgeidentity-android.git' - url = 'https://github.com/adobe/aepsdk-edgeidentity-android' - } - withXml { - def dependenciesNode = asNode().appendNode('dependencies') - - def coreDependencyNode = dependenciesNode.appendNode('dependency') - coreDependencyNode.appendNode('groupId', 'com.adobe.marketing.mobile') - coreDependencyNode.appendNode('artifactId', 'core') - coreDependencyNode.appendNode('version', mavenCoreVersion) - } - } - } - } - repositories { - maven { - name = "sonatype" - url = version.endsWith('SNAPSHOT') ? "https://oss.sonatype.org/content/repositories/snapshots/" : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - credentials { - username = System.getenv("SONATYPE_USERNAME") - password = System.getenv("SONATYPE_PASSWORD") - } - } - } -} - -ext."signing.gnupg.executable"="gpg" -ext."signing.gnupg.keyName"=System.getenv("GPG_KEY_ID") -ext."signing.gnupg.passphrase"=System.getenv("GPG_PASSPHRASE") - -signing { - useGpgCmd() - required { - tasks.withType(PublishToMavenRepository).find { - gradle.taskGraph.hasTask it - } - } - sign publishing.publications -} - -tasks.register('platformUnitTestJacocoReport', JacocoReport) { - dependsOn "testPhoneDebugUnitTest" - def excludeRegex = ['**/BuildConfig.class'] - def debugTree = fileTree(dir: "${project.buildDir}/intermediates/javac/phoneDebug/classes/com/adobe/marketing/mobile", excludes: excludeRegex) - - additionalClassDirs.setFrom files([debugTree]) - additionalSourceDirs.setFrom files(android.sourceSets.main.java.sourceFiles) - sourceDirectories.setFrom files(android.sourceSets.phone.java.sourceFiles) - executionData "$buildDir/outputs/unit_test_code_coverage/phoneDebugUnitTest/testPhoneDebugUnitTest.exec" - - reports { - xml.required = true - csv.required = false - html.required = true - } -} - -tasks.register('platformFunctionalTestJacocoReport', JacocoReport) { - dependsOn "createPhoneDebugCoverageReport" - def excludeRegex = ['**/BuildConfig.class'] - def debugTree = fileTree(dir: "${project.buildDir}/intermediates/javac/phoneDebug/classes/com/adobe/marketing/mobile", excludes: excludeRegex) - - additionalClassDirs.setFrom files([debugTree]) - additionalSourceDirs.setFrom files(android.sourceSets.main.java.sourceFiles) - sourceDirectories.setFrom files(android.sourceSets.phone.java.sourceFiles) - executionData fileTree(dir: "$buildDir", includes: [ - "outputs/code_coverage/phoneDebugAndroidTest/connected/*coverage.ec" - ]) - - reports { - xml.required = true - csv.required = false - html.required = true - } -} - -dependencies { - // Adobe Mobile SDK Core - implementation "com.adobe.marketing.mobile:core:${rootProject.mavenCoreVersion}" - implementation "androidx.annotation:annotation:${rootProject.androidxAnnotationVersion}" - - testImplementation "androidx.test.ext:junit:${rootProject.ext.junitVersion}" - testImplementation "org.mockito:mockito-core:${rootProject.ext.mockitoVersion}" - testImplementation 'com.fasterxml.jackson.core:jackson-databind:2.9.9' - testImplementation 'org.json:json:20180813' - - androidTestImplementation "androidx.test.ext:junit:${rootProject.ext.junitVersion}" - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' - androidTestImplementation 'com.fasterxml.jackson.core:jackson-databind:2.9.9' - androidTestImplementation 'com.adobe.marketing.mobile:identity:2.+' -} - -tasks.withType(Test).configureEach { - testLogging { - showStandardStreams = true - } -} diff --git a/code/edgeidentity/build.gradle.kts b/code/edgeidentity/build.gradle.kts new file mode 100644 index 00000000..c8d4ee28 --- /dev/null +++ b/code/edgeidentity/build.gradle.kts @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Adobe. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + * OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +plugins { + id("aep-library") +} + +val mavenCoreVersion: String by project + +aepLibrary { + namespace = "com.adobe.marketing.mobile.edge.identity" + enableSpotless = true + enableSpotlessPrettierForJava = true + + publishing { + gitRepoName = "aepsdk-edgeidentity-android" + addCoreDependency(mavenCoreVersion) + } +} + +dependencies { + // TODO: Use 3.x versions for testing + // TODO: Remove -SNAPSHOT suffix after Core 3.0.0 is published + implementation("com.adobe.marketing.mobile:core:$mavenCoreVersion-SNAPSHOT") + + // testImplementation dependencies provided by aep-library: + // MOCKITO_CORE, JSON, ANDROIDX_TEST_EXT_JUNIT + + testImplementation ("com.fasterxml.jackson.core:jackson-databind:2.12.7") + + // androidTestImplementation dependencies provided by aep-library: + // ANDROIDX_TEST_EXT_JUNIT, ESPRESSO_CORE + + androidTestImplementation ("com.fasterxml.jackson.core:jackson-databind:2.12.7") + androidTestImplementation ("com.adobe.marketing.mobile:identity:2.+") +} diff --git a/code/edgeidentity/consumer-rules.pro b/code/edgeidentity/consumer-rules.pro deleted file mode 100644 index e69de29b..00000000 diff --git a/code/edgeidentity/proguard-rules.pro b/code/edgeidentity/proguard-rules.pro deleted file mode 100644 index 481bb434..00000000 --- a/code/edgeidentity/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/code/edgeidentity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityPublicAPITest.java b/code/edgeidentity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityPublicAPITest.java index 8da1e0d7..06a0bfef 100644 --- a/code/edgeidentity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityPublicAPITest.java +++ b/code/edgeidentity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/IdentityPublicAPITest.java @@ -50,25 +50,6 @@ public void testGetExtensionVersionAPI() { // -------------------------------------------------------------------------------------------- // Tests for Register extension API // -------------------------------------------------------------------------------------------- - @Test - public void testRegisterExtensionAPI() throws InterruptedException { - // test - //noinspection deprecation - Identity.registerExtension(); - - // now register monitor extension and start the hub - registerExtensions(Arrays.asList(MonitorExtension.EXTENSION), null); - - // verify that the extension is registered with the correct version details - Map sharedStateMap = flattenMap( - getSharedStateFor(IdentityTestConstants.SharedStateName.EVENT_HUB, 5000) - ); - assertEquals( - IdentityConstants.EXTENSION_VERSION, - sharedStateMap.get("extensions.com.adobe.edge.identity.version") - ); - } - @Test public void testRegisterExtension_withClass() throws InterruptedException { // test diff --git a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/Identity.java b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/Identity.java index 2184bfd4..502351e2 100644 --- a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/Identity.java +++ b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/Identity.java @@ -51,25 +51,6 @@ public static String extensionVersion() { return IdentityConstants.EXTENSION_VERSION; } - /** - * Registers the extension with the Mobile SDK. This method should be called only once in your application class. - * - * @deprecated as of 2.0.0, use {@link MobileCore#registerExtensions(List, AdobeCallback)} with {@link Identity#EXTENSION} instead. - */ - @Deprecated - @SuppressWarnings("deprecation") - public static void registerExtension() { - MobileCore.registerExtension( - IdentityExtension.class, - extensionError -> - Log.error( - LOG_TAG, - LOG_SOURCE, - "There was an error registering the Edge Identity extension: " + extensionError.getErrorName() - ) - ); - } - /** * Returns the Experience Cloud ID. An empty string is returned if the Experience Cloud ID was previously cleared. * diff --git a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityConstants.java b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityConstants.java index 23692922..17465891 100644 --- a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityConstants.java +++ b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityConstants.java @@ -16,7 +16,7 @@ final class IdentityConstants { static final String LOG_TAG = "EdgeIdentity"; static final String EXTENSION_NAME = "com.adobe.edge.identity"; static final String EXTENSION_FRIENDLY_NAME = "Edge Identity"; - static final String EXTENSION_VERSION = "2.0.1"; + static final String EXTENSION_VERSION = "3.0.0"; static final class Default { diff --git a/code/edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityTestUtil.java b/code/edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityTestUtil.java index 1abe2035..4a2ef43d 100644 --- a/code/edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityTestUtil.java +++ b/code/edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityTestUtil.java @@ -16,6 +16,7 @@ import com.adobe.marketing.mobile.EventType; import com.adobe.marketing.mobile.LoggingMode; import com.adobe.marketing.mobile.MobileCore; +import com.adobe.marketing.mobile.services.Log; import com.adobe.marketing.mobile.util.JSONUtils; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -36,6 +37,8 @@ * Util class used by both Functional and Unit tests */ class IdentityTestUtil { + private static final String LOG_SOURCE = "IdentityTestUtil"; + private static final String LOG_TAG = "FunctionalTestUtils"; /** * Helper method to create IdentityXDM Map using {@link TestItem}s @@ -131,7 +134,7 @@ static Map flattenMap(final Map map) { addKeys("", new ObjectMapper().readTree(jsonObject.toString()), payloadMap); return payloadMap; } catch (IOException e) { - MobileCore.log(LoggingMode.ERROR, "FunctionalTestUtils", "Failed to parse JSON object to tree structure."); + Log.error(LOG_TAG, LOG_SOURCE, "Failed to parse JSON object to tree structure."); } return Collections.emptyMap(); diff --git a/code/edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityTests.java b/code/edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityTests.java index 713cff69..8c5a3bbf 100644 --- a/code/edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityTests.java +++ b/code/edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityTests.java @@ -28,8 +28,6 @@ import com.adobe.marketing.mobile.Event; import com.adobe.marketing.mobile.EventSource; import com.adobe.marketing.mobile.EventType; -import com.adobe.marketing.mobile.ExtensionError; -import com.adobe.marketing.mobile.ExtensionErrorCallback; import com.adobe.marketing.mobile.MobileCore; import com.adobe.marketing.mobile.util.JSONUtils; import java.util.ArrayList; @@ -66,33 +64,6 @@ public void test_extensionVersionAPI() { ); } - // ======================================================================================== - // registerExtension - // ======================================================================================== - @Test - public void testRegistration() { - try (MockedStatic mockedStaticMobileCore = Mockito.mockStatic(MobileCore.class)) { - // test - Identity.registerExtension(); - - // verify - final ArgumentCaptor callbackCaptor = ArgumentCaptor.forClass( - ExtensionErrorCallback.class - ); - mockedStaticMobileCore.verify(() -> - MobileCore.registerExtension(eq(IdentityExtension.class), callbackCaptor.capture()) - ); - - final ExtensionErrorCallback extensionErrorCallback = callbackCaptor.getValue(); - assertNotNull("The extension callback should not be null", extensionErrorCallback); - - // verify that the callback invocation does not throw an exception - extensionErrorCallback.error(ExtensionError.UNEXPECTED_ERROR); - } catch (final Exception e) { - fail(e.getMessage()); - } - } - // ======================================================================================== // getExperienceCloudId API // ======================================================================================== diff --git a/code/gradle.properties b/code/gradle.properties index 067e76e1..a758f17a 100644 --- a/code/gradle.properties +++ b/code/gradle.properties @@ -1,20 +1,13 @@ -# Project-wide Gradle settings. - org.gradle.jvmargs=-Xmx2048m -android.useAndroidX=true -android.disableAutomaticComponentCreation=true - -moduleProjectName=edgeidentity moduleName=edgeidentity -moduleAARName=edgeidentity-phone-release.aar -moduleVersion=2.0.1 +moduleVersion=3.0.0 +mavenCoreVersion=3.0.0 mavenRepoName=AdobeMobileEdgeIdentitySdk mavenRepoDescription=Adobe Experience Platform Edge Identity extension for the Adobe Experience Platform Mobile SDK mavenUploadDryRunFlag=false -# production versions for production build -mavenCoreVersion=2.0.0 -androidxAnnotationVersion=1.0.0 +android.useAndroidX=true + diff --git a/code/gradle/wrapper/gradle-wrapper.properties b/code/gradle/wrapper/gradle-wrapper.properties index 5e4cdd73..f2191f28 100644 --- a/code/gradle/wrapper/gradle-wrapper.properties +++ b/code/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Mon Nov 07 08:48:57 PST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/code/settings.gradle b/code/settings.gradle deleted file mode 100644 index 9782bf67..00000000 --- a/code/settings.gradle +++ /dev/null @@ -1,21 +0,0 @@ -pluginManagement { - repositories { - gradlePluginPortal() - google() - mavenCentral() - } -} - -dependencyResolutionManagement { - repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) - repositories { - google() - mavenCentral() - maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } - maven { url 'https://jitpack.io' } - } -} - -include ':app' -include ':edgeidentity' -rootProject.name = "edgeidentity-sdk" \ No newline at end of file diff --git a/code/settings.gradle.kts b/code/settings.gradle.kts new file mode 100755 index 00000000..ebe3aa9b --- /dev/null +++ b/code/settings.gradle.kts @@ -0,0 +1,36 @@ +/* + * Copyright 2024 Adobe. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + * OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + mavenLocal() + } +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + mavenLocal() + maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") } + maven { url = uri("https://jitpack.io") } + } +} + +rootProject.name = "aepsdk-edgeidentity-android" +include ( + ":app", + ":edgeidentity" +) \ No newline at end of file diff --git a/config/formatter/adobe.header.txt b/config/formatter/adobe.header.txt deleted file mode 100644 index 7afb5252..00000000 --- a/config/formatter/adobe.header.txt +++ /dev/null @@ -1,11 +0,0 @@ -/* - Copyright $YEAR Adobe. All rights reserved. - This file is licensed to you under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. You may obtain a copy - of the License at http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under - the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS - OF ANY KIND, either express or implied. See the License for the specific language - governing permissions and limitations under the License. -*/ - diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 00000000..22a389f5 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,21 @@ +# +# Copyright 2024 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +# + +jdk: + - openjdk17 +# before_install: +# - ./custom_setup.sh +install: + - echo "Running a custom install command" + - make ci-publish-maven-local-jitpack +# env: +# MYVAR: "custom environment variable" diff --git a/scripts/version.sh b/scripts/version.sh new file mode 100755 index 00000000..804a35c6 --- /dev/null +++ b/scripts/version.sh @@ -0,0 +1,131 @@ +#!/bin/bash + +# Make this script executable from terminal: +# chmod 755 version.sh +set -e # Any subsequent(*) commands which fail will cause the shell script to exit immediately + +ROOT_DIR=$(git rev-parse --show-toplevel) +LINE="================================================================================" +VERSION_REGEX="[0-9]+\.[0-9]+\.[0-9]+" + +GRADLE_PROPERTIES_FILE=$ROOT_DIR"/code/gradle.properties" +CONSTANTS_FILE=$ROOT_DIR"/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityConstants.java" +# Java files +EXTENSION_VERSION_REGEX="^.*String EXTENSION_VERSION *= *" +# Kotlin files +#EXTENSION_VERSION_REGEX="^ +const val VERSION *= *" + +help() +{ + echo "" + echo "Usage: $0 -v VERSION -d DEPENDENCIES" + echo "" + echo -e " -v\t- Version to update or verify for the extension. \n\t Example: 3.0.2\n" + echo -e " -d\t- Comma seperated dependecies to update along with their version. \n\t Example: "Core 3.1.1, Edge 3.2.1"\n" + echo -e " -u\t- Updates the version. If this flag is absent, the script verifies if the version is correct\n" + exit 1 # Exit script after printing help +} + +sed_platform() { + # Ensure sed works properly in linux and mac-os. + if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' "$@" + else + sed -i "$@" + fi +} + +update() { + echo "Changing version to $VERSION" + + # Replace version in Constants file + echo "Changing 'EXTENSION_VERSION' to '$VERSION' in '$CONSTANTS_FILE'" + sed_platform -E "/$EXTENSION_VERSION_REGEX/{s/$VERSION_REGEX/$VERSION/;}" $CONSTANTS_FILE + + # Replace version in gradle.properties + echo "Changing 'moduleVersion' to '$VERSION' in '$GRADLE_PROPERTIES_FILE'" + sed_platform -E "/^moduleVersion/{s/$VERSION_REGEX/$VERSION/;}" $GRADLE_PROPERTIES_FILE + + # Replace dependencies in gradle.properties + if [ "$DEPENDENCIES" != "none" ]; then + IFS="," + dependenciesArray=($(echo "$DEPENDENCIES")) + + IFS=" " + for dependency in "${dependenciesArray[@]}"; do + dependencyArray=(${dependency// / }) + dependencyName=${dependencyArray[0]} + dependencyVersion=${dependencyArray[1]} + + if [ "$dependencyVersion" != "" ]; then + echo "Changing 'maven${dependencyName}Version' to '$dependencyVersion' in '$GRADLE_PROPERTIES_FILE'" + sed_platform -E "/^maven${dependencyName}Version/{s/$VERSION_REGEX/$dependencyVersion/;}" $GRADLE_PROPERTIES_FILE + fi + done + fi +} + +verify() { + echo "Verifing version is $VERSION" + + if ! grep -E "$EXTENSION_VERSION_REGEX\"$VERSION\"" "$CONSTANTS_FILE" >/dev/null; then + echo "'EXTENSION_VERSION' does not match '$VERSION' in '$CONSTANTS_FILE'" + exit 1 + fi + + if ! grep -E "^moduleVersion=.*$VERSION" "$GRADLE_PROPERTIES_FILE" >/dev/null; then + echo "'moduleVersion' does not match '$VERSION' in '$GRADLE_PROPERTIES_FILE'" + exit 1 + fi + + if [ "$DEPENDENCIES" != "none" ]; then + IFS="," + dependenciesArray=($(echo "$DEPENDENCIES")) + + IFS=" " + for dependency in "${dependenciesArray[@]}"; do + dependencyArray=(${dependency// / }) + dependencyName=${dependencyArray[0]} + dependencyVersion=${dependencyArray[1]} + + if [ "$dependencyVersion" != "" ]; then + if ! grep -E "^maven${dependencyName}Version=.*$dependencyVersion" "$GRADLE_PROPERTIES_FILE" >/dev/null; then + echo "maven${dependencyName}Version does not match '$dependencyVersion' in '$GRADLE_PROPERTIES_FILE'" + exit 1 + fi + fi + done + fi + + echo "Success" +} + + +while getopts "v:d:u" opt +do + case "$opt" in + v ) VERSION="$OPTARG" ;; + d ) DEPENDENCIES="$OPTARG" ;; + u ) UPDATE="true" ;; + ? ) help ;; # Print help in case parameter is non-existent + esac +done + +# Print help in case parameters are empty +if [ -z "$VERSION" ] +then + echo "********** USAGE ERROR **********" + echo "Some or all of the parameters are empty. See usage below:"; + help +fi + + + +echo "$LINE" +if [[ ${UPDATE} = "true" ]]; +then + update +else + verify +fi +echo "$LINE" \ No newline at end of file From 3839f3d69cf4f05bf49816695415578df56202e3 Mon Sep 17 00:00:00 2001 From: Calise Cheung Date: Wed, 21 Feb 2024 17:59:35 -0800 Subject: [PATCH 3/7] Update Spotless and format licenses (#117) * Android 3.0.0 migration update Android 3.0.0 migration update * disable assemble-app disable assemble-app * disable assemble-phone disable assemble-phone * remove Assemble App remove Assemble App * Exclude duplicated edgeidentity and core module in App gradle Exclude duplicated edgeidentity and core module in App gradle * Update Spotless and License for all the files Update Spotless and License for all the files * update github yml file update github yml file * enable checkformat and lint enable checkformat and lint * SpotlessApply SpotlessApply * Remove extra variables Remove extra variables * Update License header to its original creation date Update License header to its original creation date --- .circleci/config.yml | 24 ++++++++++++++----- .github/ISSUE_TEMPLATE/bug_report.yml | 12 ++++++++++ .github/ISSUE_TEMPLATE/feature_request.yml | 12 ++++++++++ .github/ISSUE_TEMPLATE/project_epic.yml | 12 ++++++++++ .github/ISSUE_TEMPLATE/project_task.yml | 12 ++++++++++ .github/workflows/maven-release.yml | 4 +--- .github/workflows/maven-snapshot.yml | 2 +- Makefile | 14 +++++------ code/app/build.gradle.kts | 12 +++++++++- code/app/src/main/AndroidManifest.xml | 13 ++++++++++ .../res/drawable-anydpi/ic_menu_assurance.xml | 13 ++++++++++ .../main/res/drawable-v21/ic_menu_camera.xml | 13 ++++++++++ .../main/res/drawable-v21/ic_menu_gallery.xml | 13 ++++++++++ .../res/drawable-v21/ic_menu_slideshow.xml | 13 ++++++++++ .../drawable-v24/ic_launcher_foreground.xml | 13 ++++++++++ code/app/src/main/res/drawable/border.xml | 13 ++++++++++ .../res/drawable/ic_launcher_background.xml | 13 ++++++++++ .../src/main/res/drawable/side_nav_bar.xml | 13 ++++++++++ .../app/src/main/res/layout/activity_main.xml | 13 ++++++++++ code/app/src/main/res/layout/app_bar_main.xml | 13 ++++++++++ code/app/src/main/res/layout/content_main.xml | 13 ++++++++++ .../main/res/layout/fragment_assurance.xml | 13 ++++++++++ .../res/layout/fragment_custom_identity.xml | 13 ++++++++++ .../main/res/layout/fragment_get_identity.xml | 13 ++++++++++ .../res/layout/fragment_multiple_identity.xml | 13 ++++++++++ .../src/main/res/layout/nav_header_main.xml | 13 ++++++++++ .../main/res/menu/activity_main_drawer.xml | 13 ++++++++++ code/app/src/main/res/menu/main.xml | 13 ++++++++++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 13 ++++++++++ .../mipmap-anydpi-v26/ic_launcher_round.xml | 13 ++++++++++ .../main/res/navigation/mobile_navigation.xml | 13 ++++++++++ code/app/src/main/res/values/colors.xml | 13 ++++++++++ code/app/src/main/res/values/dimens.xml | 13 ++++++++++ code/app/src/main/res/values/drawables.xml | 13 ++++++++++ code/app/src/main/res/values/secrets.xml | 13 ++++++++++ code/app/src/main/res/values/strings.xml | 13 ++++++++++ code/app/src/main/res/values/styles.xml | 13 ++++++++++ .../main/res/xml/network_security_config.xml | 13 ++++++++++ .../edge/identity/util/MonitorExtension.java | 3 +-- .../edgeidentity/src/main/AndroidManifest.xml | 13 ++++++++++ .../mobile/edge/identity/Identity.java | 3 +-- .../edge/identity/IdentityExtension.java | 9 +++---- .../mobile/edge/identity/IdentityItem.java | 9 +++---- .../mobile/edge/identity/IdentityMap.java | 9 +++---- .../mobile/edge/identity/IdentityState.java | 3 +-- .../edge/identity/IdentityTestUtil.java | 3 +-- code/gradle.properties | 12 ++++++++++ codecov.yml | 12 ++++++++++ 48 files changed, 513 insertions(+), 44 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 37a614fc..cb7fd64a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,3 +1,15 @@ +# +# Copyright 2021 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +# + version: 2.1 orbs: # Use the circleci android orb version that supports OpenJDK17 required by AGP 8.2+ @@ -31,13 +43,13 @@ jobs: - android/restore-build-cache - # - run: - # name: Check Format - # command: make checkformat + - run: + name: Check Format + command: make checkformat - # - run: - # name: Lint - # command: make lint + - run: + name: Lint + command: make lint - android/save-gradle-cache diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 7ef16c91..ab1b096a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,3 +1,15 @@ +# +# Copyright 2023 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +# + name: Bug report description: Create a bug report to help us improve. Use this template if you encountered an issue while integrating with or implementing the APIs of this SDK. labels: [bug, triage-required] diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index b220d582..35d5e3dc 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,3 +1,15 @@ +# +# Copyright 2023 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +# + name: Feature request description: Suggest an idea for this project. labels: [feature-request, triage-required] diff --git a/.github/ISSUE_TEMPLATE/project_epic.yml b/.github/ISSUE_TEMPLATE/project_epic.yml index eec745ae..90ed153f 100644 --- a/.github/ISSUE_TEMPLATE/project_epic.yml +++ b/.github/ISSUE_TEMPLATE/project_epic.yml @@ -1,3 +1,15 @@ +# +# Copyright 2023 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +# + name: Project epic description: Create an internal epic that represents the top level parent of multiple tasks. labels: [epic] diff --git a/.github/ISSUE_TEMPLATE/project_task.yml b/.github/ISSUE_TEMPLATE/project_task.yml index f4334a3b..a7624f9e 100644 --- a/.github/ISSUE_TEMPLATE/project_task.yml +++ b/.github/ISSUE_TEMPLATE/project_task.yml @@ -1,3 +1,15 @@ +# +# Copyright 2023 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +# + name: Project task description: Create an internal task that can be completed as a standalone code change or is part of an epic. labels: [task] diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml index 2e56dc05..50f8a207 100644 --- a/.github/workflows/maven-release.yml +++ b/.github/workflows/maven-release.yml @@ -1,5 +1,5 @@ # -# Copyright 2024 Adobe. All rights reserved. +# Copyright 2021 Adobe. All rights reserved. # This file is licensed to you under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. You may obtain a copy # of the License at http://www.apache.org/licenses/LICENSE-2.0 @@ -27,8 +27,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - with: - ref: main - name: Set up Java uses: actions/setup-java@v3 diff --git a/.github/workflows/maven-snapshot.yml b/.github/workflows/maven-snapshot.yml index a72603a9..990e3245 100644 --- a/.github/workflows/maven-snapshot.yml +++ b/.github/workflows/maven-snapshot.yml @@ -1,5 +1,5 @@ # -# Copyright 2024 Adobe. All rights reserved. +# Copyright 2021 Adobe. All rights reserved. # This file is licensed to you under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. You may obtain a copy # of the License at http://www.apache.org/licenses/LICENSE-2.0 diff --git a/Makefile b/Makefile index b9e629f1..042736c5 100644 --- a/Makefile +++ b/Makefile @@ -11,15 +11,15 @@ format: (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) spotlessApply) (./code/gradlew -p code/$(TEST-APP-FOLDER-NAME) spotlessApply) -# format-license: -# (./code/gradlew -p code licenseFormat) +format-license: + (./code/gradlew -p code licenseFormat) -# checkformat: -# (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) spotlessCheck) -# (./code/gradlew -p code/$(TEST-APP-FOLDER-NAME) spotlessCheck) +checkformat: + (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) spotlessCheck) + (./code/gradlew -p code/$(TEST-APP-FOLDER-NAME) spotlessCheck) -# lint: -# (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) lint) +lint: + (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) lint) unit-test: (./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) testPhoneDebugUnitTest) diff --git a/code/app/build.gradle.kts b/code/app/build.gradle.kts index 60dce045..0f3e7aa5 100644 --- a/code/app/build.gradle.kts +++ b/code/app/build.gradle.kts @@ -1,3 +1,14 @@ +/* + * Copyright 2024 Adobe. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + * OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ import com.adobe.marketing.mobile.gradle.BuildConstants plugins { @@ -58,7 +69,6 @@ dependencies { implementation("com.google.android.material:material:1.3.0") implementation(project(":edgeidentity")) - //TO DO update to release versions implementation("com.adobe.marketing.mobile:core:$mavenCoreVersion-SNAPSHOT") implementation("com.adobe.marketing.mobile:identity:2.+") implementation("com.adobe.marketing.mobile:edgeconsent:2.0.0") { diff --git a/code/app/src/main/AndroidManifest.xml b/code/app/src/main/AndroidManifest.xml index 8ccc02c2..1c187653 100644 --- a/code/app/src/main/AndroidManifest.xml +++ b/code/app/src/main/AndroidManifest.xml @@ -1,4 +1,17 @@ + diff --git a/code/app/src/main/res/drawable-anydpi/ic_menu_assurance.xml b/code/app/src/main/res/drawable-anydpi/ic_menu_assurance.xml index 5fb811cb..d702dd55 100644 --- a/code/app/src/main/res/drawable-anydpi/ic_menu_assurance.xml +++ b/code/app/src/main/res/drawable-anydpi/ic_menu_assurance.xml @@ -1,3 +1,16 @@ + + diff --git a/code/app/src/main/res/drawable/ic_launcher_background.xml b/code/app/src/main/res/drawable/ic_launcher_background.xml index fec9f007..b13fc588 100644 --- a/code/app/src/main/res/drawable/ic_launcher_background.xml +++ b/code/app/src/main/res/drawable/ic_launcher_background.xml @@ -1,4 +1,17 @@ + + + + + + + + + + diff --git a/code/app/src/main/res/menu/main.xml b/code/app/src/main/res/menu/main.xml index a2411e31..83fb1eea 100644 --- a/code/app/src/main/res/menu/main.xml +++ b/code/app/src/main/res/menu/main.xml @@ -1,4 +1,17 @@ + + diff --git a/code/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/code/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index eca70cfe..22c0b5a7 100644 --- a/code/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/code/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -1,4 +1,17 @@ + diff --git a/code/app/src/main/res/navigation/mobile_navigation.xml b/code/app/src/main/res/navigation/mobile_navigation.xml index 6d190e47..0a319554 100644 --- a/code/app/src/main/res/navigation/mobile_navigation.xml +++ b/code/app/src/main/res/navigation/mobile_navigation.xml @@ -1,4 +1,17 @@ + + #6200EE diff --git a/code/app/src/main/res/values/dimens.xml b/code/app/src/main/res/values/dimens.xml index 031cc232..6b2aa756 100644 --- a/code/app/src/main/res/values/dimens.xml +++ b/code/app/src/main/res/values/dimens.xml @@ -1,3 +1,16 @@ + diff --git a/code/app/src/main/res/values/drawables.xml b/code/app/src/main/res/values/drawables.xml index 2aa1db21..fe5c5492 100644 --- a/code/app/src/main/res/values/drawables.xml +++ b/code/app/src/main/res/values/drawables.xml @@ -1,3 +1,16 @@ + @android:drawable/ic_menu_camera diff --git a/code/app/src/main/res/values/secrets.xml b/code/app/src/main/res/values/secrets.xml index 60442f75..e7a4759a 100644 --- a/code/app/src/main/res/values/secrets.xml +++ b/code/app/src/main/res/values/secrets.xml @@ -1,4 +1,17 @@ + diff --git a/code/app/src/main/res/values/strings.xml b/code/app/src/main/res/values/strings.xml index 0387fe1a..d0517c66 100644 --- a/code/app/src/main/res/values/strings.xml +++ b/code/app/src/main/res/values/strings.xml @@ -1,3 +1,16 @@ + Edge Identity App diff --git a/code/app/src/main/res/values/styles.xml b/code/app/src/main/res/values/styles.xml index 6cf52464..9a1d8b5a 100644 --- a/code/app/src/main/res/values/styles.xml +++ b/code/app/src/main/res/values/styles.xml @@ -1,3 +1,16 @@ + diff --git a/code/app/src/main/res/xml/network_security_config.xml b/code/app/src/main/res/xml/network_security_config.xml index e1eb89e5..ea5cb39c 100644 --- a/code/app/src/main/res/xml/network_security_config.xml +++ b/code/app/src/main/res/xml/network_security_config.xml @@ -1,4 +1,17 @@ + diff --git a/code/edgeidentity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/util/MonitorExtension.java b/code/edgeidentity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/util/MonitorExtension.java index 1e458885..12293119 100644 --- a/code/edgeidentity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/util/MonitorExtension.java +++ b/code/edgeidentity/src/androidTest/java/com/adobe/marketing/mobile/edge/identity/util/MonitorExtension.java @@ -46,8 +46,7 @@ protected MonitorExtension(ExtensionApi extensionApi) { super(extensionApi); } - @NonNull - @Override + @NonNull @Override protected String getName() { return "MonitorExtension"; } diff --git a/code/edgeidentity/src/main/AndroidManifest.xml b/code/edgeidentity/src/main/AndroidManifest.xml index 61363294..eb6c2273 100644 --- a/code/edgeidentity/src/main/AndroidManifest.xml +++ b/code/edgeidentity/src/main/AndroidManifest.xml @@ -1 +1,14 @@ + \ No newline at end of file diff --git a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/Identity.java b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/Identity.java index 502351e2..010e5800 100644 --- a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/Identity.java +++ b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/Identity.java @@ -46,8 +46,7 @@ private Identity() {} * * @return The version as {@code String} */ - @NonNull - public static String extensionVersion() { + @NonNull public static String extensionVersion() { return IdentityConstants.EXTENSION_VERSION; } diff --git a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityExtension.java b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityExtension.java index 07169b30..f54e5a9e 100644 --- a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityExtension.java +++ b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityExtension.java @@ -68,20 +68,17 @@ protected IdentityExtension(ExtensionApi extensionApi) { this.state = state; } - @NonNull - @Override + @NonNull @Override protected String getName() { return IdentityConstants.EXTENSION_NAME; } - @NonNull - @Override + @NonNull @Override protected String getFriendlyName() { return IdentityConstants.EXTENSION_FRIENDLY_NAME; } - @NonNull - @Override + @NonNull @Override protected String getVersion() { return IdentityConstants.EXTENSION_VERSION; } diff --git a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityItem.java b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityItem.java index b324d5c9..8ae8921d 100644 --- a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityItem.java +++ b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityItem.java @@ -89,8 +89,7 @@ public IdentityItem(@NonNull final IdentityItem item) { * * @return The id for this identity item */ - @NonNull - public String getId() { + @NonNull public String getId() { return id; } @@ -99,8 +98,7 @@ public String getId() { * * @return Current {@link AuthenticatedState} for this item */ - @NonNull - public AuthenticatedState getAuthenticatedState() { + @NonNull public AuthenticatedState getAuthenticatedState() { return authenticatedState; } @@ -114,8 +112,7 @@ public boolean isPrimary() { return primary; } - @NonNull - @Override + @NonNull @Override public String toString() { // format:off return "{" diff --git a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityMap.java b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityMap.java index c0114c33..5a50b2eb 100644 --- a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityMap.java +++ b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityMap.java @@ -45,8 +45,7 @@ public class IdentityMap { * @param namespace namespace for the list of identities to retrieve * @return IdentityItem for the namespace */ - @NonNull - public List getIdentityItemsForNamespace(@NonNull final String namespace) { + @NonNull public List getIdentityItemsForNamespace(@NonNull final String namespace) { final List copyItems = new ArrayList<>(); if (StringUtils.isNullOrEmpty(namespace)) { @@ -71,8 +70,7 @@ public List getIdentityItemsForNamespace(@NonNull final String nam * * @return a list of all the namespaces for this {@link IdentityMap}, or an empty string if this {@code IdentityMap} is empty */ - @NonNull - public List getNamespaces() { + @NonNull public List getNamespaces() { return new ArrayList<>(identityItems.keySet()); } @@ -117,8 +115,7 @@ public boolean isEmpty() { return identityItems.isEmpty(); } - @NonNull - @Override + @NonNull @Override public String toString() { final StringBuilder b = new StringBuilder(); b.append("{\"").append(IdentityConstants.XDMKeys.IDENTITY_MAP).append("\": {"); diff --git a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityState.java b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityState.java index eeec0c41..b77b2978 100644 --- a/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityState.java +++ b/code/edgeidentity/src/main/java/com/adobe/marketing/mobile/edge/identity/IdentityState.java @@ -57,8 +57,7 @@ class IdentityState { /** * @return The current {@link IdentityProperties} for this identity state */ - @NonNull - IdentityProperties getIdentityProperties() { + @NonNull IdentityProperties getIdentityProperties() { return identityProperties; } diff --git a/code/edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityTestUtil.java b/code/edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityTestUtil.java index 4a2ef43d..a5d48883 100644 --- a/code/edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityTestUtil.java +++ b/code/edgeidentity/src/test/java/com/adobe/marketing/mobile/edge/identity/IdentityTestUtil.java @@ -14,8 +14,6 @@ import com.adobe.marketing.mobile.Event; import com.adobe.marketing.mobile.EventSource; import com.adobe.marketing.mobile.EventType; -import com.adobe.marketing.mobile.LoggingMode; -import com.adobe.marketing.mobile.MobileCore; import com.adobe.marketing.mobile.services.Log; import com.adobe.marketing.mobile.util.JSONUtils; import com.fasterxml.jackson.databind.JsonNode; @@ -37,6 +35,7 @@ * Util class used by both Functional and Unit tests */ class IdentityTestUtil { + private static final String LOG_SOURCE = "IdentityTestUtil"; private static final String LOG_TAG = "FunctionalTestUtils"; diff --git a/code/gradle.properties b/code/gradle.properties index a758f17a..28118d9b 100644 --- a/code/gradle.properties +++ b/code/gradle.properties @@ -1,3 +1,15 @@ +# +# Copyright 2021 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +# + org.gradle.jvmargs=-Xmx2048m moduleName=edgeidentity diff --git a/codecov.yml b/codecov.yml index f5d749f4..a934c92a 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1,15 @@ +# +# Copyright 2021 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +# + codecov: notify: require_ci_to_pass: yes From 56a59de88a7ccfa64edf33d4b8bd48c7b96aa9dc Mon Sep 17 00:00:00 2001 From: Calise Cheung Date: Wed, 21 Feb 2024 18:44:36 -0800 Subject: [PATCH 4/7] Create CI build path parameter (#118) * Android 3.0.0 migration update Android 3.0.0 migration update * disable assemble-app disable assemble-app * disable assemble-phone disable assemble-phone * remove Assemble App remove Assemble App * Exclude duplicated edgeidentity and core module in App gradle Exclude duplicated edgeidentity and core module in App gradle * Update Spotless and License for all the files Update Spotless and License for all the files * update github yml file update github yml file * enable checkformat and lint enable checkformat and lint * Make build path parameter Make build path parameter * SpotlessApply SpotlessApply * Remove extra variables Remove extra variables * Update License header to its original creation date Update License header to its original creation date --------- Co-authored-by: Kevin Lind <40409666+kevinlind@users.noreply.github.com> --- .circleci/config.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cb7fd64a..8c96c3c5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,6 +16,11 @@ orbs: android: circleci/android@2.4.0 codecov: codecov/codecov@4.0.1 +parameters: + build_path: + type: string + default: "code/edgeidentity/build" + # Workflows orchestrate a set of jobs to be run; workflows: version: 2 @@ -57,7 +62,7 @@ jobs: # Store Lint report - store_artifacts: - path: code/edgeidentity/build/reports + path: << pipeline.parameters.build_path >>/reports build-and-unit-test: executor: @@ -77,7 +82,7 @@ jobs: command: make javadoc - store_artifacts: - path: code/edgeidentity/build/docs/javadoc + path: << pipeline.parameters.build_path >>/docs/javadoc - run: name: Assemble Phone @@ -91,17 +96,17 @@ jobs: test-command: make unit-test-coverage - store_artifacts: - path: code/edgeidentity/build/reports/tests + path: << pipeline.parameters.build_path >>/reports/tests - store_test_results: - path: code/edgeidentity/build/test-results/testPhoneDebugUnitTest + path: << pipeline.parameters.build_path >>/test-results/testPhoneDebugUnitTest - android/save-gradle-cache - android/save-build-cache - codecov/upload: - file: code/edgeidentity/build/reports/coverage/test/phone/debug/report.xml + file: << pipeline.parameters.build_path >>/reports/coverage/test/phone/debug/report.xml flags: unit-tests functional-test: @@ -130,11 +135,11 @@ jobs: - android/save-build-cache - codecov/upload: - file: code/edgeidentity/build/reports/coverage/androidTest/phone/debug/connected/report.xml + file: << pipeline.parameters.build_path >>/reports/coverage/androidTest/phone/debug/connected/report.xml flags: functional-tests - store_artifacts: - path: code/edgeidentity/build/reports/androidTests + path: << pipeline.parameters.build_path >>/reports/androidTests - store_test_results: - path: code/edgeidentity/build/outputs/androidTest-results \ No newline at end of file + path: << pipeline.parameters.build_path >>/outputs/androidTest-results From 99d44932bd3d16cddb3b0a4ae9d2cc31a0d1e020 Mon Sep 17 00:00:00 2001 From: Calise Cheung Date: Wed, 6 Mar 2024 17:56:02 -0800 Subject: [PATCH 5/7] Remove deprecated API, update bom file setup in the docs and update gradle to use snapshot build (#120) * Remove deprecated API in the doc and update gradle to use snapshot build Remove deprecated registerExtension API in the doc Update bom file setup in the documentation Update gradle to use snapshots * run spotlessApply for app run spotlessApply for app --- Documentation/api-reference.md | 35 ------------------- Documentation/frequently-asked-questions.md | 11 +++--- Documentation/getting-started.md | 11 +++--- code/app/build.gradle.kts | 10 ++++-- .../testapp/ui/MultipleIdentityFragment.kt | 7 +++- code/edgeidentity/build.gradle.kts | 6 +++- code/gradle.properties | 3 +- 7 files changed, 31 insertions(+), 52 deletions(-) diff --git a/Documentation/api-reference.md b/Documentation/api-reference.md index 28610439..52ba6d26 100644 --- a/Documentation/api-reference.md +++ b/Documentation/api-reference.md @@ -12,7 +12,6 @@ Refer to the [Getting Started Guide](getting-started.md) | [getExperienceCloudId](#getExperienceCloudId) | | [getIdentities](#getIdentities) | | [getUrlVariables](#getUrlVariables) | -| [registerExtension](#registerExtension) | | [removeIdentity](#removeIdentity) | | [resetIdentities](#resetIdentities) | | [setAdvertisingIdentifier](#setAdvertisingIdentifier) | @@ -167,40 +166,6 @@ Identity.getUrlVariables { urlVariablesString -> ------ -### registerExtension - -Registers the Identity for Edge Network extension with the Mobile Core extension. - -> **Warning** -> Deprecated as of 2.0.0. Use the [MobileCore.registerExtensions API](https://github.com/adobe/aepsdk-core-android/blob/main/Documentation/MobileCore/api-reference.md) instead. - -> **Note** -> If your use-case covers both Edge Network and Adobe Experience Cloud Solutions extensions, you need to register Identity for Edge Network and Identity for Experience Cloud Identity Service from Mobile Core extensions. For more details, see the [frequently asked questions](frequently-asked-questions.md). - -#### Java - -##### Syntax -```java -public static void registerExtension() -``` - -##### Example -```java -import com.adobe.marketing.mobile.edge.identity.Identity - -... -Identity.registerExtension(); -``` - -#### Kotlin - -##### Example -```kotlin -Identity.registerExtension() -``` - ------- - ### removeIdentity Remove the identity from the stored client-side [IdentityMap](#identitymap). The Identity extension will stop sending the identifier to the Edge Network. Using this API does not remove the identifier from the server-side User Profile Graph or Identity Graph. diff --git a/Documentation/frequently-asked-questions.md b/Documentation/frequently-asked-questions.md index c39706bb..6db856d4 100644 --- a/Documentation/frequently-asked-questions.md +++ b/Documentation/frequently-asked-questions.md @@ -14,11 +14,12 @@ Download and import the Identity and Identity for Edge Network extensions 1. Add the Mobile Core and Edge extensions to your project using the app's Gradle file. - ```java - implementation 'com.adobe.marketing.mobile:core:2.+' - implementation 'com.adobe.marketing.mobile:identity:2.+' - implementation 'com.adobe.marketing.mobile:edge:2.+' - implementation 'com.adobe.marketing.mobile:edgeidentity:2.+' + ```kotlin + implementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+")) + implementation("com.adobe.marketing.mobile:core") + implementation("com.adobe.marketing.mobile:identity") + implementation("com.adobe.marketing.mobile:edge") + implementation("com.adobe.marketing.mobile:edgeidentity") ``` > **Warning** > Using dynamic dependency versions is not recommended for production apps. Refer to this [page](https://github.com/adobe/aepsdk-core-android/blob/main/Documentation/MobileCore/gradle-dependencies.md) for managing gradle dependencies. diff --git a/Documentation/getting-started.md b/Documentation/getting-started.md index 95c1d4ae..8cabd51d 100644 --- a/Documentation/getting-started.md +++ b/Documentation/getting-started.md @@ -23,11 +23,12 @@ The Adobe Experience Platform Identity for Edge Network extension depends on the 1. Add the Mobile Core, Edge, and Edge Identity extensions to your project using the app's Gradle file: -```gradle -implementation 'com.adobe.marketing.mobile:core:2.+' -implementation 'com.adobe.marketing.mobile:edge:2.+' -implementation 'com.adobe.marketing.mobile:edgeidentity:2.+' - ``` +```kotlin +implementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+")) +implementation("com.adobe.marketing.mobile:core") +implementation("com.adobe.marketing.mobile:edge") +implementation("com.adobe.marketing.mobile:edgeidentity") +``` > **Warning** > Using dynamic dependency versions is not recommended for production apps. Refer to this [page](https://github.com/adobe/aepsdk-core-android/blob/main/Documentation/MobileCore/gradle-dependencies.md) for managing gradle dependencies. diff --git a/code/app/build.gradle.kts b/code/app/build.gradle.kts index 0f3e7aa5..d851888d 100644 --- a/code/app/build.gradle.kts +++ b/code/app/build.gradle.kts @@ -70,12 +70,16 @@ dependencies { implementation(project(":edgeidentity")) implementation("com.adobe.marketing.mobile:core:$mavenCoreVersion-SNAPSHOT") - implementation("com.adobe.marketing.mobile:identity:2.+") - implementation("com.adobe.marketing.mobile:edgeconsent:2.0.0") { + implementation("com.adobe.marketing.mobile:identity:3.0.0-SNAPSHOT") { + exclude(group = "com.adobe.marketing.mobile", module = "core") + } + implementation("com.adobe.marketing.mobile:edgeconsent:3.0.0-SNAPSHOT") { exclude(group = "com.adobe.marketing.mobile", module = "edge") + exclude(group = "com.adobe.marketing.mobile", module = "core") + } implementation("com.adobe.marketing.mobile:assurance:2.+") - implementation("com.adobe.marketing.mobile:edge:2.0.0") { + implementation("com.adobe.marketing.mobile:edge:3.0.0-SNAPSHOT") { exclude(group = "com.adobe.marketing.mobile", module = "core") exclude(group = "com.adobe.marketing.mobile", module = "edgeidentity") } diff --git a/code/app/src/main/java/com/adobe/marketing/edge/identity/testapp/ui/MultipleIdentityFragment.kt b/code/app/src/main/java/com/adobe/marketing/edge/identity/testapp/ui/MultipleIdentityFragment.kt index a4e40d4d..2b44d70e 100644 --- a/code/app/src/main/java/com/adobe/marketing/edge/identity/testapp/ui/MultipleIdentityFragment.kt +++ b/code/app/src/main/java/com/adobe/marketing/edge/identity/testapp/ui/MultipleIdentityFragment.kt @@ -25,9 +25,11 @@ import com.adobe.marketing.edge.identity.testapp.R import com.adobe.marketing.edge.identity.testapp.model.SharedViewModel import com.adobe.marketing.mobile.Edge import com.adobe.marketing.mobile.ExperienceEvent +import com.adobe.marketing.mobile.Extension import com.adobe.marketing.mobile.MobileCore import com.adobe.marketing.mobile.MobilePrivacyStatus import com.adobe.marketing.mobile.VisitorID +import java.util.Arrays import kotlin.random.Random class MultipleIdentityFragment : Fragment() { @@ -77,7 +79,10 @@ class MultipleIdentityFragment : Fragment() { directRegisteredRadioButton.setOnClickListener { // There is no API to unregister an extension, so only handle registration case if (sharedViewModel.isDirectIdentityRegistered.value == false) { - com.adobe.marketing.mobile.Identity.registerExtension() + val extensions: List> = Arrays.asList( + com.adobe.marketing.mobile.Identity.EXTENSION, + ) + MobileCore.registerExtensions(extensions) {} sharedViewModel.toggleDirectIdentityRegistration() } } diff --git a/code/edgeidentity/build.gradle.kts b/code/edgeidentity/build.gradle.kts index c8d4ee28..705fe3a7 100644 --- a/code/edgeidentity/build.gradle.kts +++ b/code/edgeidentity/build.gradle.kts @@ -14,6 +14,7 @@ plugins { } val mavenCoreVersion: String by project +val functionalTestIdentityVersion: String by project aepLibrary { namespace = "com.adobe.marketing.mobile.edge.identity" @@ -40,5 +41,8 @@ dependencies { // ANDROIDX_TEST_EXT_JUNIT, ESPRESSO_CORE androidTestImplementation ("com.fasterxml.jackson.core:jackson-databind:2.12.7") - androidTestImplementation ("com.adobe.marketing.mobile:identity:2.+") + androidTestImplementation("com.adobe.marketing.mobile:identity:$functionalTestIdentityVersion-SNAPSHOT") + { + exclude(group = "com.adobe.marketing.mobile", module = "core") + } } diff --git a/code/gradle.properties b/code/gradle.properties index 28118d9b..77c382e8 100644 --- a/code/gradle.properties +++ b/code/gradle.properties @@ -21,5 +21,4 @@ mavenRepoDescription=Adobe Experience Platform Edge Identity extension for the A mavenUploadDryRunFlag=false android.useAndroidX=true - - +functionalTestIdentityVersion=3.0.0 \ No newline at end of file From 712b9e3d9c966622fb894d91daa1d75e296b4419 Mon Sep 17 00:00:00 2001 From: Calise Cheung Date: Wed, 27 Mar 2024 17:03:53 -0700 Subject: [PATCH 6/7] cleanup before the release (#124) * cleanup before the release cleanup before the release * update config.yml update config.yml * Update config.yml Update config.yml * add cache-prefix add cache-prefix to match with other extensions. * update config.yml and gradle properties update config.yml and gradle properties * add cache-prefix add cache-prefix * update header size for docs update header size for docs --- .circleci/config.yml | 74 +++++++++++++++++---- Documentation/frequently-asked-questions.md | 28 ++++++-- Documentation/getting-started.md | 10 +++ README.md | 1 - code/build.gradle.kts | 2 +- code/gradle.properties | 1 + 6 files changed, 96 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8c96c3c5..0be66e3a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,6 +17,12 @@ orbs: codecov: codecov/codecov@4.0.1 parameters: + gradle-cache-prefix: + type: string + default: v1 + build-cache-prefix: + type: string + default: v1 build_path: type: string default: "code/edgeidentity/build" @@ -33,6 +39,14 @@ workflows: - functional-test: requires: - validate-code + - build-test-app: + requires: + - validate-code + filters: + branches: + only: + - main + - staging jobs: validate-code: @@ -44,9 +58,11 @@ jobs: steps: - checkout - - android/restore-gradle-cache + - android/restore-gradle-cache: + cache-prefix: << pipeline.parameters.gradle-cache-prefix >> - - android/restore-build-cache + - android/restore-build-cache: + cache-prefix: << pipeline.parameters.gradle-cache-prefix >> - run: name: Check Format @@ -56,9 +72,11 @@ jobs: name: Lint command: make lint - - android/save-gradle-cache + - android/save-gradle-cache: + cache-prefix: << pipeline.parameters.gradle-cache-prefix >> - - android/save-build-cache + - android/save-build-cache: + cache-prefix: << pipeline.parameters.gradle-cache-prefix >> # Store Lint report - store_artifacts: @@ -73,9 +91,11 @@ jobs: steps: - checkout - - android/restore-gradle-cache + - android/restore-gradle-cache: + cache-prefix: << pipeline.parameters.gradle-cache-prefix >> - - android/restore-build-cache + - android/restore-build-cache: + cache-prefix: << pipeline.parameters.gradle-cache-prefix >> - run: name: Javadoc @@ -88,10 +108,6 @@ jobs: name: Assemble Phone command: make assemble-phone - - run: - name: Assemble App - command: make assemble-app - - android/run-tests: test-command: make unit-test-coverage @@ -101,9 +117,11 @@ jobs: - store_test_results: path: << pipeline.parameters.build_path >>/test-results/testPhoneDebugUnitTest - - android/save-gradle-cache + - android/save-gradle-cache: + cache-prefix: << pipeline.parameters.gradle-cache-prefix >> - - android/save-build-cache + - android/save-build-cache: + cache-prefix: << pipeline.parameters.gradle-cache-prefix >> - codecov/upload: file: << pipeline.parameters.build_path >>/reports/coverage/test/phone/debug/report.xml @@ -118,7 +136,8 @@ jobs: steps: - checkout - - android/restore-build-cache + - android/restore-build-cache: + cache-prefix: << pipeline.parameters.gradle-cache-prefix >> - run: name: List available emulator images @@ -132,7 +151,8 @@ jobs: # The test command test-command: make functional-test-coverage - - android/save-build-cache + - android/save-build-cache: + cache-prefix: << pipeline.parameters.gradle-cache-prefix >> - codecov/upload: file: << pipeline.parameters.build_path >>/reports/coverage/androidTest/phone/debug/connected/report.xml @@ -143,3 +163,29 @@ jobs: - store_test_results: path: << pipeline.parameters.build_path >>/outputs/androidTest-results + + build-test-app: + executor: + name: android/android-docker + resource-class: medium + tag: 2024.01.1-node + + steps: + - checkout + + - android/restore-gradle-cache: + cache-prefix: << pipeline.parameters.gradle-cache-prefix >> + + - android/restore-build-cache: + cache-prefix: << pipeline.parameters.gradle-cache-prefix >> + + - run: + name: Assemble App + command: make assemble-app + + - android/save-gradle-cache: + cache-prefix: << pipeline.parameters.gradle-cache-prefix >> + + - android/save-build-cache: + cache-prefix: << pipeline.parameters.gradle-cache-prefix >> + diff --git a/Documentation/frequently-asked-questions.md b/Documentation/frequently-asked-questions.md index 6db856d4..c6a78cce 100644 --- a/Documentation/frequently-asked-questions.md +++ b/Documentation/frequently-asked-questions.md @@ -10,24 +10,44 @@ When using both Adobe Experience Platform Edge and Adobe Solutions extensions, b The following instructions are for configuring an application using both Edge Network and Adobe Solutions mobile extensions. If an application will include only Adobe Experience Platform Edge extensions, follow the instructions here. Download and import the Identity and Identity for Edge Network extensions -#### Java 1. Add the Mobile Core and Edge extensions to your project using the app's Gradle file. - ```kotlin + #### Kotlin + ```kotlin implementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+")) implementation("com.adobe.marketing.mobile:core") implementation("com.adobe.marketing.mobile:identity") implementation("com.adobe.marketing.mobile:edge") implementation("com.adobe.marketing.mobile:edgeidentity") - ``` + ``` + + #### Groovy + + ```groovy + implementation platform('com.adobe.marketing.mobile:sdk-bom:3.+') + implementation 'com.adobe.marketing.mobile:core' + implementation 'com.adobe.marketing.mobile:edge' + implementation 'com.adobe.marketing.mobile:edgeidentity' + ``` + > **Warning** > Using dynamic dependency versions is not recommended for production apps. Refer to this [page](https://github.com/adobe/aepsdk-core-android/blob/main/Documentation/MobileCore/gradle-dependencies.md) for managing gradle dependencies. 2. Import the Mobile Core and Edge extensions in your application class. + #### Java ```java - import com.adobe.marketing.mobile.*; + import com.adobe.marketing.mobile.MobileCore; + import com.adobe.marketing.mobile.Edge; + import com.adobe.marketing.mobile.edge.identity.Identity; + ``` + #### Kotlin + + ```kotlin + import com.adobe.marketing.mobile.MobileCore + import com.adobe.marketing.mobile.Edge + import com.adobe.marketing.mobile.edge.identity.Identity ``` Register the Identity and Identity for Edge Network extensions with Mobile Core diff --git a/Documentation/getting-started.md b/Documentation/getting-started.md index 8cabd51d..341aa8b4 100644 --- a/Documentation/getting-started.md +++ b/Documentation/getting-started.md @@ -23,12 +23,22 @@ The Adobe Experience Platform Identity for Edge Network extension depends on the 1. Add the Mobile Core, Edge, and Edge Identity extensions to your project using the app's Gradle file: +#### Kotlin ```kotlin implementation(platform("com.adobe.marketing.mobile:sdk-bom:3.+")) implementation("com.adobe.marketing.mobile:core") implementation("com.adobe.marketing.mobile:edge") implementation("com.adobe.marketing.mobile:edgeidentity") ``` + +#### Groovy + +```groovy +implementation platform('com.adobe.marketing.mobile:sdk-bom:3.+') +implementation 'com.adobe.marketing.mobile:core' +implementation 'com.adobe.marketing.mobile:edge' +implementation 'com.adobe.marketing.mobile:edgeidentity' +``` > **Warning** > Using dynamic dependency versions is not recommended for production apps. Refer to this [page](https://github.com/adobe/aepsdk-core-android/blob/main/Documentation/MobileCore/gradle-dependencies.md) for managing gradle dependencies. diff --git a/README.md b/README.md index 2d00cd29..19319447 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,6 @@ make init | [Edge Network extension](https://github.com/adobe/aepsdk-edge-android) | The Edge Network extension allows you to send data to the Adobe Edge Network from a mobile application. | | [Consent for Edge Network extension](https://github.com/adobe/aepsdk-edgeconsent-android) | The Consent extension enables consent preferences collection from your mobile app when using the AEP SDK and the Edge Network extension. | | [Assurance extension](https://github.com/adobe/aepsdk-assurance-android) | The Assurance extension enables validation workflows for your SDK implementation. | -| [Adobe Experience Platform sample app for Android](https://github.com/adobe/aepsdk-sample-app-android) | Contains a fully implemented Android sample app using the Experience Platform SDKs. | ## Documentation diff --git a/code/build.gradle.kts b/code/build.gradle.kts index 99924f5d..017d4ff4 100644 --- a/code/build.gradle.kts +++ b/code/build.gradle.kts @@ -19,6 +19,6 @@ buildscript { mavenLocal() } dependencies { - classpath("com.github.adobe:aepsdk-commons:884c937705") + classpath("com.github.adobe:aepsdk-commons:gp-3.0.0") } } \ No newline at end of file diff --git a/code/gradle.properties b/code/gradle.properties index 77c382e8..8a00eb70 100644 --- a/code/gradle.properties +++ b/code/gradle.properties @@ -11,6 +11,7 @@ # org.gradle.jvmargs=-Xmx2048m +org.gradle.caching=true moduleName=edgeidentity moduleVersion=3.0.0 From da9daa83b80ea76c751af8b183a05ee313c820a8 Mon Sep 17 00:00:00 2001 From: Kevin Lind <40409666+kevinlind@users.noreply.github.com> Date: Mon, 1 Apr 2024 17:04:43 -0700 Subject: [PATCH 7/7] Update Core dependency to 3.0.0 (non snapshot) version (#126) * Update Core dependency to 3.0.0 (non snapshot) version * Update Assurance dependency in test app to 3.0.0 * Update README with correct settings file name. * Remove exclude --- README.md | 2 +- code/app/build.gradle.kts | 11 +++-------- code/edgeidentity/build.gradle.kts | 9 ++------- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 19319447..ed133ac4 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Integrate the Identity for Edge Network mobile extension into your app by follow **Open the project** -To open and run the project, open the `code/settings.gradle` file in Android Studio. +To open and run the project, open the `code/settings.gradle.kt` file in Android Studio. **Run the test app** diff --git a/code/app/build.gradle.kts b/code/app/build.gradle.kts index d851888d..d66ea7a7 100644 --- a/code/app/build.gradle.kts +++ b/code/app/build.gradle.kts @@ -69,18 +69,13 @@ dependencies { implementation("com.google.android.material:material:1.3.0") implementation(project(":edgeidentity")) - implementation("com.adobe.marketing.mobile:core:$mavenCoreVersion-SNAPSHOT") - implementation("com.adobe.marketing.mobile:identity:3.0.0-SNAPSHOT") { - exclude(group = "com.adobe.marketing.mobile", module = "core") - } + implementation("com.adobe.marketing.mobile:core:$mavenCoreVersion") + implementation("com.adobe.marketing.mobile:identity:3.0.0") implementation("com.adobe.marketing.mobile:edgeconsent:3.0.0-SNAPSHOT") { exclude(group = "com.adobe.marketing.mobile", module = "edge") - exclude(group = "com.adobe.marketing.mobile", module = "core") - } - implementation("com.adobe.marketing.mobile:assurance:2.+") + implementation("com.adobe.marketing.mobile:assurance:3.0.0") implementation("com.adobe.marketing.mobile:edge:3.0.0-SNAPSHOT") { - exclude(group = "com.adobe.marketing.mobile", module = "core") exclude(group = "com.adobe.marketing.mobile", module = "edgeidentity") } implementation("androidx.core:core-ktx:1.3.2") diff --git a/code/edgeidentity/build.gradle.kts b/code/edgeidentity/build.gradle.kts index 705fe3a7..087915e3 100644 --- a/code/edgeidentity/build.gradle.kts +++ b/code/edgeidentity/build.gradle.kts @@ -28,9 +28,7 @@ aepLibrary { } dependencies { - // TODO: Use 3.x versions for testing - // TODO: Remove -SNAPSHOT suffix after Core 3.0.0 is published - implementation("com.adobe.marketing.mobile:core:$mavenCoreVersion-SNAPSHOT") + implementation("com.adobe.marketing.mobile:core:$mavenCoreVersion") // testImplementation dependencies provided by aep-library: // MOCKITO_CORE, JSON, ANDROIDX_TEST_EXT_JUNIT @@ -41,8 +39,5 @@ dependencies { // ANDROIDX_TEST_EXT_JUNIT, ESPRESSO_CORE androidTestImplementation ("com.fasterxml.jackson.core:jackson-databind:2.12.7") - androidTestImplementation("com.adobe.marketing.mobile:identity:$functionalTestIdentityVersion-SNAPSHOT") - { - exclude(group = "com.adobe.marketing.mobile", module = "core") - } + androidTestImplementation("com.adobe.marketing.mobile:identity:$functionalTestIdentityVersion") }