Skip to content
This repository was archived by the owner on Dec 3, 2025. It is now read-only.

Refactor project to remove need for build.sh#336

Merged
jonahwilliams merged 16 commits intogoogle:masterfrom
jonahwilliams:add_track_widget_creation_flag
Apr 22, 2019
Merged

Refactor project to remove need for build.sh#336
jonahwilliams merged 16 commits intogoogle:masterfrom
jonahwilliams:add_track_widget_creation_flag

Conversation

@jonahwilliams
Copy link

@jonahwilliams jonahwilliams commented Apr 19, 2019

Removes indirection by moving the macOS build script to flutter_tools. This still uses the FDE asset syncing. This uses almost the same scheme/flag passing setup as the existing iOS build.

Currently the track-widget-creation flag is still broken though, it seems like some part of the process is using the regular .dill instead of the .track.dill - still investigating.

Fixed, need to make sure I referenced config file

See also: flutter/flutter#31329

runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$FDE_ROOT\"/tools/build_flutter_assets \"$PROJECT_DIR\"/..\n";
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_build_flutter_assets.sh";
Copy link
Collaborator

Choose a reason for hiding this comment

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

This creates a new requirement that flutter build must be run before the Xcode project will work; that's not an issue for a long-term flutter created version of this, but would be potentially breaking for this project. I think we should check in a Generated.xcconfig with this change that defaults to ../../../flutter to make it work in a clean checkout that uses the suggested layout. (Not perfect, since it won't handle .flutter_location_config, but better than nothing.)

Copy link
Author

Choose a reason for hiding this comment

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

Putting it together this way it doesn't quite work when i run from Xcode - possibly due to the lack of the OBJROOT, SYMROOT, and derivedData overrides? I might have my setup configured wrong.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll take a look tomorrow and see what's broken. The build output will go somewhere else if you build from Xcode, but I wouldn't expect that to break anything (it's what happens right now with build.sh vs Xcode UI).

Copy link
Collaborator

Choose a reason for hiding this comment

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

I realized while doing the Windows version that we shouldn't check in a copy of the generated settings, since it needs to be in the .gitignore, so I think we'll just live with needing to use 'fluter build' or 'flutter run' at least once. I can add a note about that to the docs.

Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

testbed/ should get the same changes—except that we can't switch away from tools/build_fluter_assets until there's local engine support in macos_build_flutter_assets.sh—since the flutter_tools side stops using build.sh.

runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$FDE_ROOT\"/tools/build_flutter_assets \"$PROJECT_DIR\"/..\n";
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_build_flutter_assets.sh";
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'll take a look tomorrow and see what's broken. The build output will go somewhere else if you build from Xcode, but I wouldn't expect that to break anything (it's what happens right now with build.sh vs Xcode UI).

Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g 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 modulo the comment below, removing Generated.xcconfig and adding it to .gitignore instead, and then duplicating most of this to testbed/

name = Frameworks;
sourceTree = "<group>";
};
D76E93BA226BCA8F00F7932B /* Recovered References */ = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The configs should be referenced in the project, rather than being considered recovered files. Please rename this group in the file tree "Configs", move it up between Resources and Frameworks, and (for ease of inspection) add Generated.xcconfig to that group as well (make sure to uncheck the option to add it to any of the targets)

Copy link
Author

Choose a reason for hiding this comment

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

We don't reference the Generated.xcconfig in our iOS projects, should this be changed in the templates for those as well?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It doesn't affect the build in any way, it just means that if you have the project open you can easily inspect all the configs. I find it helpful in general, but if nobody has ever complained it's up to you whether it's worth changing iOS.

@jonahwilliams
Copy link
Author

Looks like travis will be red until it uses the latest flutter

@stuartmorgan-g
Copy link
Collaborator

Looks like travis will be red until it uses the latest flutter

It clones from master; it's red because your other PR hasn't landed...

pubspec.lock

# Generated by flutter run and flutter build
Generated.xcconfig
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be in a .gitignore in example/macos (especially since the goal is to make those folders relocatable shortly)

pubspec.lock

# generated by flutter run/build
Generated.xcconfig
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same.

runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$FDE_ROOT\"/tools/build_flutter_assets \"$PROJECT_DIR\"/..\n";
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_build_flutter_assets.sh";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't change this yet for testbed; that would break the documented (and heavily used by me) local engine workflow.

Later we can make the Flutter scripts support local engine and migrate the workflow and docs to that.

Jonah Williams added 3 commits April 22, 2019 14:03
Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

testbed/macos/build.sh should be removed too; otherwise LGTM

@jonahwilliams jonahwilliams merged commit 349cacf into google:master Apr 22, 2019
@jonahwilliams jonahwilliams deleted the add_track_widget_creation_flag branch April 22, 2019 22:04
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants