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

docs: update quick start guides #271

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

eric-horodyski
Copy link
Member

Update the iOS and Android guides to use the Portals CLI.

Additionally:

  • Minor grammar fixes.
  • Add steps to install Portals via SPM.

@carlpoole - using the Portals CLI, there's no need for a seperate Gradle task for Windows and *nix/MacOS. Can the same .portals.yaml file be used, or would you need a separate version where directory-name uses a Windows' constructed file path?

@carlpoole
Copy link
Member

@eric-horodyski it looks like go will construct the path based on the running OS file separator so the content of the yml should match the OS its running on otherwise it could end up with a mix of the two.

@eric-horodyski
Copy link
Member Author

Fixed the Android guide to contain two separate .yaml files, one for paths built with *nix systems and one for Windows.

@jthoms1
Copy link
Member

jthoms1 commented Apr 10, 2024

Only feedback I have is the "Sync Appflow at build time" image on the iOS page shows the old instructions. Should probably recreate the screenshot with the new instructions.

Instructions on how to create the screenshot can be found here: https://www.notion.so/ionic/Docs-Screenshot-How-To-d6d6be033b0e40829cb80cd628d0c4dd?pvs=4

@eric-horodyski
Copy link
Member Author

@jthoms1 - images updated for both iOS and Android

@Steven0351
Copy link
Member

Steven0351 commented Apr 16, 2024

Fixed the Android guide to contain two separate .yaml files, one for paths built with *nix systems and one for Windows.

@eric-horodyski Sorry, just now looking at this. The methods we use in Go should actually automatically convert between filepath separators. I don't think you should need different files for *nix and windows. Specifically we use https://pkg.go.dev/path/filepath#Abs to get the absolute path to the source, which will call https://pkg.go.dev/path/filepath#Clean before returning to convert to proper separators.

project.exec {
commandLine 'cmd', '/c', 'rm', portalName + '.zip'
commandLine 'portals', 'sync'
Copy link
Member

Choose a reason for hiding this comment

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

This still needs to know the location of the asset path:

commandLine 'portals', 'sync', '--destination', assetPath

Also, I'm pretty sure that the CLI isn't going to be picked up in the PATH by android studio, so you'd still need to do:

commandLine 'cmd', '/c', 'portals', 'sync', '--destination', assetPath

Copy link
Member Author

Choose a reason for hiding this comment

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

It does through .portals.yaml:

 - app-id: 11a0971f
   channel: production
   directory-name: src/main/assets/featured_products

Copy link
Member

Choose a reason for hiding this comment

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

Unless someone has tested on both a mac and windows machine otherwise. I know it doesn't show up in the PATH on Mac during my testing on an M-series machine.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have it working in another app. I do have it set on the PATH though, maybe I should call that out.

Copy link
Member

Choose a reason for hiding this comment

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

It does through .portals.yaml:

 - app-id: 11a0971f
   channel: production
   directory-name: src/main/assets/featured_products

That's not really a portable example between iOS and android though. That would require the start dir on iOS be "src/main/assets/featured_products" if you're using the same config between ios and android

Copy link
Member Author

Choose a reason for hiding this comment

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

@Steven0351 - Finally had time to test this out:

  1. The same path for Windows and *nix will work in .portals.yaml.
  2. I figured it's good enough™️ to have a note mentioning the user needs to have the Portals CLI as part of their PATH to run the build.gradle task.

I've verified the Android build task works on both Mac and Windows -- provided it's part of the PATH.

Copy link
Member

Choose a reason for hiding this comment

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

Where is your portals cli located on your machine? Because from what I experienced if it is not in a folder that is part of the default macOS $PATH then it will not get picked up because of how the JVM forks. I was unable under any circumstances able to get it to pick up a $PATH environment variable that I set either when running the gradle task directly or through Android Studio. So, I feel like when people read this:

:::note
The Portals CLI must be registered as part of the `PATH` to run this command successfully.
:::

That they will think they can manipulate the PATH environment variable to get it to pick up, when it probably won't.

Copy link
Member Author

Choose a reason for hiding this comment

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

Interesting, I just added it to my PATH in .zshrc:

export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home
export VOLTA_HOME="$HOME/.volta"
export PORTALS_PATH="/opt/homebrew/opt/portals"
export STUDIO_PATH="/Applications/Android Studio.app/Contents/MacOS"
export PATH="$VOLTA_HOME/bin:$PORTALS_PATH:$STUDIO_PATH:$PATH"

Copy link
Member

Choose a reason for hiding this comment

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

Hm, are you opening Android Studio via the command line? Essentially the same problem should occur as with Xcode, in that it respects no PATH other than what is in /etc/paths

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. However, I am more than happy to suggest something else instead of the note, just not sure what it would be.

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.

None yet

4 participants