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

Handle eas build locally thorugh buildCommand in launch.json #833

Merged

Conversation

maciekstosio
Copy link
Contributor

@maciekstosio maciekstosio commented Dec 6, 2024

Fixes #824

customBuild.buildCommand assumes the last line of the output is a path to the binary. This PR changes this behavior to look for all paths in the last line of the output; if it does exist, it takes the first path and extracts the tar file if necessary (this is how iOS is bundled). This seems to be a common use case (especially with eas --local) and, currently, we have no other way of handling eas build command locally. In the feature, I believe we should extend eas.* launch config to handle local flag.

How Has This Been Tested:

{
   // Use IntelliSense to learn about possible attributes.
   // Hover to view descriptions of existing attributes.
   // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
   "version": "0.2.0",
   "configurations": [
      {
         "type": "radon-ide",
         "request": "launch",
         "name": "Radon IDE panel",
         "customBuild": {
            "ios": {
               "buildCommand": "npx eas build --platform ios --profile development --local --non-interactive",
            },
            "android": {
               "buildCommand": "npx eas build --platform android --profile development --local --non-interactive",
            }
         },
         "ios": {
            "configuration": "Debug"
         },
         "android": {
            "buildType": "debug"
         }
      }
   ]
}
  • verify that the app builds (it takes a long time especially on iOS)and IDE works

Copy link

vercel bot commented Dec 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
radon-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 14, 2025 0:12am

@maciekstosio maciekstosio marked this pull request as draft December 6, 2024 16:28
Copy link
Member

@kmagiera kmagiera left a comment

Choose a reason for hiding this comment

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

changes look good, but we also should plan docs updates to explain the changes better in configuration docs.


type Env = Record<string, string> | undefined;

const EXPO_LOCAL_BUILD_PATH_REGEX = new RegExp("You can find the build artifacts in (.*)");
Copy link
Member

Choose a reason for hiding this comment

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

if we only scan the last line I think we could relax it much more and just take the file paths that are present in the final line of output

@maciekstosio
Copy link
Contributor Author

Docs update: #897

Copy link
Member

@kmagiera kmagiera left a comment

Choose a reason for hiding this comment

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

Looks good, left some comments inline


type TarCommandArgs = { archivePath: string; extractDir: string };
function tarCommand({ archivePath, extractDir }: TarCommandArgs) {
return exec("tar", ["-xf", archivePath, "-C", extractDir]);
Copy link
Member

Choose a reason for hiding this comment

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

perhaps would be better to use some existing module like node-tar this way making this work cross platform and resistant to some PATH related issues

}

// assuming that the archive contains only one app file
const appName = (await readdir(pathToExtract)).find(
Copy link
Member

Choose a reason for hiding this comment

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

instead of having this here both here and in runExternalBuild maybe we should just make this metod return a single extracted file and then only make the file extension checks in runExternalBuild

@maciekstosio maciekstosio merged commit 7dc0384 into main Jan 14, 2025
4 checks passed
@maciekstosio maciekstosio deleted the @maciekstosio/Handle-eas-build-output-in-customBuild-command branch January 14, 2025 12:14
kmagiera pushed a commit that referenced this pull request Jan 15, 2025
Update docs about `customBuild` command after changes from
#833.
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.

Support for EAS local builds
2 participants