Skip to content

[AMSDK-10131] Archive AEPCommerceDemoApp in CI#35

Merged
kevinlind merged 37 commits intoadobe:devfrom
kevinlind:amsdk-10131
Jun 24, 2020
Merged

[AMSDK-10131] Archive AEPCommerceDemoApp in CI#35
kevinlind merged 37 commits intoadobe:devfrom
kevinlind:amsdk-10131

Conversation

@kevinlind
Copy link
Copy Markdown
Contributor

@kevinlind kevinlind commented Jun 16, 2020

Description

This PR has a lot of project file changes. I would suggest checking out the PR and opening and running the projects to verify the structures.

  • Creates new demo/AEPCommerceDemoApp Xcode project and workspace to build demo application from static library in "libs" folder
  • Keeps AEPCommerceDemoApp source in build/xcode/ACPExperiencePlatform Xcode project so we can easily build the demo app while developing. However, any file adds/deletes or any project structure changes to the demo app will also need to be added to the demo/AEPCommerceDemoApp project.
  • Adds new demo/AEPCommerceDemoApp/Makefile for building and zipping demo app
  • In both Xcode projects, I removed the xdmlib library/target and instead included the files as source to the AEPCommerceDemoApp target. It wasn't possible to link libACPExperiencePlatform.a to both xdmlib and AEPCommerceDemoApp targets as the AEPCommerceDemoApp also linked the libxdmlib.a.

To be done in another PR: README updates to detail how to use the built libs with the zipped demo app.

Related Issue

Motivation and Context

How Has This Been Tested?

Ran Makefile locally to build libs and demo app. Used built libs with extracted demo app and ran Xcode project.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

kevinlind added 18 commits June 16, 2020 13:39
New AEPCommerceDemoApp.xcodeproj is under build/xcode and will be moved in later commits to demo folder once project files are setup.
…dfile.

Creates a separate Xcode project for the AEPCommerceDemoApp which includes the ACPExperienePlatform as a library file. To use, copy the libACPExperiencePlatform.a file and ACPExperiencePlatform.swiftmodule folder to the libs/ folder. Open the AEPCommerceDemoApp.xcworkspace file and run the AEPCommerceDemoApp target.
…ExperiencePlatform project.

The AEPCommerceDemoApp files are included here as source so it is convenient to build the app while developing the extension. However, as there is a separate Xcode project for the demo app, any file additions or deletions, or any project changes will also need to be done in the demo/AEPCommerceDemoApp/AEPCommerceDemoApp.xcworkspace as well.
Move make targets for archiving demo app from build/xcode/Makefile to new demo/AEPCommerceDemoApp/Makefile. Add targets to /Makefile to build and archive demo app.
…ting.

Remove the 'master' branch check in the deploy step for testing.

- deploy:
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removing this check for now to test building the demo archive in CI. Before merging, will need to add the check back to archive the demo app only on 'master' branch.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In order to build the demo app as a verification step, the universal library needs to be built first. This means, however, that if we want to build the demo app in CI we'll need to build the lib for every build and not just on master. Per CircleCI docs, build artifacts are stored for 30 days.

import ACPCore

class ExperiencePlatformInternal : ACPExtension {
private static let version = "1.0.0-alpha"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved to static variable to make it easier to parse from Makefile.

Copy link
Copy Markdown
Contributor

@nporter-adbe nporter-adbe left a comment

Choose a reason for hiding this comment

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

LGTM 👍

This is an attempt to fix the broken Codecov uploads. A forum post suggests this may fix the issue, https://community.codecov.io/t/upload-fails-repeatedly-on-bitrise/420/5.
@codecov
Copy link
Copy Markdown

codecov bot commented Jun 17, 2020

Codecov Report

❗ No coverage uploaded for pull request base (dev@a60278f). Click here to learn what that means.
The diff coverage is 100.00%.

@@          Coverage Diff           @@
##             dev      #35   +/-   ##
======================================
  Coverage       ?   71.53%           
======================================
  Files          ?       29           
  Lines          ?      959           
  Branches       ?        0           
======================================
  Hits           ?      686           
  Misses         ?      273           
  Partials       ?        0           

@kevinlind
Copy link
Copy Markdown
Contributor Author

Here's how the artifacts will look https://app.circleci.com/pipelines/github/adobe/aepsdk-platform-ios/96/workflows/da762cb2-8e41-4200-a695-1d4b35b910cb/jobs/98/artifacts.

There are two zipped files,

  • ACPExperiencePlatform-1.0.0-alpha.zip which contains the library and swift module files
  • AEPCommerceDemoApp-1.0.0-alpha.zip which contains the source code and Xcode project for the commerce demo app. This zip does not contain the library or swift module.

…irectory and subdirectories.

In Swift 5.2.2 the compiler generates a Project folder under the swiftmodule folder. Using 'mv' to move the folders for each architecture will fail if it has subdirectories. Using tar to compress and extract the directories instead.
@emdobrin
Copy link
Copy Markdown
Contributor

Changes look good, but I am seeing the following error when running locally:
Module compiled with Swift 5.1 cannot be imported by the Swift 5.2.2 compiler: .../demo/AEPCommerceDemoApp/libs/ACPExperiencePlatform.swiftmodule/x86_64-apple-ios-simulator.swiftmodule

It seems like the machine you are running on should have the exact swift version as the one it was compiled with.
Wondering if we should start looking into publishing an alpha pod or looking into SPM to enable this for external users.

@kevinlind
Copy link
Copy Markdown
Contributor Author

These recent changes were to get the built static library to work across Swift versions.

  1. Changed CI to build with Xcode 11.1 as it appears a built Swift lib works with higher versions but not lower, so wanted to build with the lowest supported Xcode version (i.e. supports Swift 5 but CI container also has CocoaPods 1.8+)
  2. Enable BUILD_LIBRARY_FOR_DISTRIBUTION flag in AEPExperiencePlatform.xcodeproj to emit .swiftinterface files
  3. Rename class ACPExpexperiencePlatform to ExperiencePlatform and module ACPExperiencePlatform to AEPExperiencePlatform as bug in Swift compiler prevents having a type and module with same name when module stability is enabled. (renaming the module from ACP to AEP was just to update the name)

Copy link
Copy Markdown
Contributor

@emdobrin emdobrin left a comment

Choose a reason for hiding this comment

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

I am able to successfully build the test app with latest build, using Swift 5.2.4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this should only run on master too

@kevinlind kevinlind merged commit 1a0d925 into adobe:dev Jun 24, 2020
@kevinlind kevinlind deleted the amsdk-10131 branch June 24, 2020 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants