Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Gradle files to use aep-plugin library #131

Merged
merged 21 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e7ffb1c
Replace groovy Gradle files with Kotlin integrated with AEP plugin.
kevinlind Feb 9, 2024
ec1b63b
remove proguard-rules files as they are taken from AEP plugin now
kevinlind Feb 9, 2024
bfdbcf2
Add Spotless configuration to :edge module
kevinlind Feb 9, 2024
125c169
Run 'format' to correct code formatting.
kevinlind Feb 9, 2024
95d3a6c
Add the 'aep-license' pluging to format all non source files with lic…
kevinlind Feb 9, 2024
51a893f
Remove Edge transient dependency when using Edge Consent in test apps.
kevinlind Feb 9, 2024
54a2025
Add Makefile target for Maven Local Jitpack
kevinlind Feb 9, 2024
c35db56
Update to latest aepsdk-commons version
kevinlind Feb 9, 2024
bb7dda3
Reorder targets in Makefile for consistency with other projects.
kevinlind Feb 9, 2024
f1cba9c
Rename Makefile target to checkformat
kevinlind Feb 9, 2024
4c25ab8
Rename steps in CircleCi config for consistency with other projects.
kevinlind Feb 9, 2024
de0a805
Add assemble for jitpack step in CircleCI config
kevinlind Feb 9, 2024
ea44e05
Update CircleCi config orb versions and machine images
kevinlind Feb 9, 2024
6681b6f
Fix use of system environment variables in integration tests.
kevinlind Feb 9, 2024
7c94a87
Update GH Workflow publish scripts
kevinlind Feb 9, 2024
d41fe9e
Add version.sh script and update-version GH workflow.
kevinlind Feb 9, 2024
fb1fe4a
Remove addition of checkstyle. If desired, add as separate PR with st…
kevinlind Feb 12, 2024
3ad42c7
Remove environment ID from Kotlin test app.
kevinlind Feb 12, 2024
4da3c14
Use CircleCi images bundled with Node
kevinlind Feb 12, 2024
55b88fd
Add copyright to update-version.yml script.
kevinlind Feb 13, 2024
a941e2b
Remove 'assemble-phone-release' dependency to 'ci-publsh' targets in …
kevinlind Feb 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 14 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

version: 2.1
orbs:
android: circleci/android@2.1.2
codecov: codecov/codecov@3.2.4
android: circleci/android@2.4.0
codecov: codecov/codecov@4.0.1

# Workflows orchestrate a set of jobs to be run;
workflows:
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
# List of available Android Docker images: https://circleci.com/developer/images/image/cimg/android#image-tags
executor:
name: android/android-docker
tag: 2022.09.2-node
tag: 2024.01.1-node
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's difference between 2024.01.1-node and 2024.01.1?
Other extensions are using 2024.01.1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-node includes Node.js in the image, which is required when using Spotless + Prettier.


steps:
- checkout
Expand All @@ -71,11 +71,11 @@ jobs:
cache-prefix: << parameters.build-cache-prefix >>

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

- run:
name: Lint Code
name: Lint
command: make lint

- android/save-gradle-cache:
Expand All @@ -99,7 +99,7 @@ jobs:
# List of available Android Docker images: https://circleci.com/developer/images/image/cimg/android#image-tags
executor:
name: android/android-docker
tag: 2022.09.2-node
tag: 2024.01.1-node

steps:
- checkout
Expand All @@ -116,13 +116,17 @@ jobs:
path: code/edge/build/dokka/javadoc

- run:
name: Build
name: Assemble Phone
command: make assemble-phone

- run:
name: Build App
name: Assemble App
command: make assemble-app

- run:
name: Assemble for Jitpack
command: make ci-publish-maven-local-jitpack

- android/run-tests:
test-command: make unit-test-coverage

Expand Down Expand Up @@ -156,7 +160,7 @@ jobs:
executor:
name: android/android-machine
resource-class: large
tag: 2022.09.1
tag: 2024.01.1
steps:
- checkout

Expand Down
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
#
# 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: 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]
Expand Down
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
#
# 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: Feature request
description: Suggest an idea for this project.
labels: [feature-request, triage-required]
Expand Down
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/project_epic.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
#
# 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: Project epic
description: Create an internal epic that represents the top level parent of multiple tasks.
labels: [epic]
Expand Down
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/project_task.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
#
# 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: Project task
description: Create an internal task that can be completed as a standalone code change or is part of an epic.
labels: [task]
Expand Down
48 changes: 39 additions & 9 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,66 @@
#

name: Publish Release
on:
push:
branches:
- main
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

- 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 }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}
run: |
echo $GPG_SECRET_KEYS | base64 --decode | gpg --import --no-tty --batch --yes
echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust --no-tty --batch --yes
- name: Publish to maven central staging repository

- name: Publish to Maven Central Repository
run: make ci-publish
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
17 changes: 9 additions & 8 deletions .github/workflows/maven-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@

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:
Expand All @@ -37,11 +38,11 @@ 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 }}

36 changes: 36 additions & 0 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update Version
on:
workflow_dispatch:
inputs:
version:
description: 'New version to use for the Edge extension. Example: 3.0.0'
required: true

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

identity-dependency:
description: '[Optional] Update Edge Identity 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
run: (./scripts/version.sh -u -v ${{ github.event.inputs.version }} -d "Core ${{ github.event.inputs.core-dependency }}, EdgeIdentity ${{ github.event.inputs.identity-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 }}
31 changes: 13 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

EXTENSION-LIBRARY-FOLDER-NAME = edge

TEST-APP-FOLDER-NAME = app
TEST-APP-FOLDER-NAME-JAVA = app
TEST-APP-FOLDER-NAME-KOTLIN = app-kotlin

init:
git config core.hooksPath .githooks
Expand All @@ -22,11 +23,13 @@ clean:

format:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) spotlessApply)
(./code/gradlew -p code/$(TEST-APP-FOLDER-NAME) spotlessApply)
(./code/gradlew -p code/$(TEST-APP-FOLDER-NAME-JAVA) spotlessApply)
(./code/gradlew -p code/$(TEST-APP-FOLDER-NAME-KOTLIN) spotlessApply)

format-check:
checkformat:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) spotlessCheck)
(./code/gradlew -p code/$(TEST-APP-FOLDER-NAME) spotlessCheck)
(./code/gradlew -p code/$(TEST-APP-FOLDER-NAME-JAVA) spotlessCheck)
(./code/gradlew -p code/$(TEST-APP-FOLDER-NAME-KOTLIN) spotlessCheck)

format-license:
(./code/gradlew -p code licenseFormat)
Expand Down Expand Up @@ -65,22 +68,14 @@ assemble-phone-release:
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) assemblePhoneRelease)

assemble-app:
(./code/gradlew -p code/$(TEST-APP-FOLDER-NAME) assemble)
(./code/gradlew -p code/$(TEST-APP-FOLDER-NAME-JAVA) assemble)
(./code/gradlew -p code/$(TEST-APP-FOLDER-NAME-KOTLIN) assemble)

ci-publish: clean assemble-phone-release
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) publishReleasePublicationToSonatypeRepository -Prelease)
ci-publish-maven-local-jitpack: assemble-phone-release
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) publishReleasePublicationToMavenLocal -Pjitpack -x signReleasePublication)

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

# 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/edge/src/main/java/com/adobe/marketing/mobile/EdgeConstants.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
ci-publish: clean assemble-phone-release
(./code/gradlew -p code/$(EXTENSION-LIBRARY-FOLDER-NAME) publishReleasePublicationToSonatypeRepository -Prelease)
kevinlind marked this conversation as resolved.
Show resolved Hide resolved