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

Started adding the engine hash to frameworks' Info.plist. #9847

Merged
merged 6 commits into from
Jul 16, 2019

Conversation

gaaclarke
Copy link
Member

Relevant issue: flutter/flutter#13879

@gaaclarke gaaclarke changed the title Started adding the engine hash to Flutter.framework's Info.plist on iOS. Started adding the engine hash to frameworks' Info.plist. Jul 16, 2019
text = open(sys.argv[1]).read()
engine_path = os.path.join(os.getcwd(), "..", "..", "flutter")
revision = git_revision.GetRepositoryVersion(engine_path)
text = text.replace("</dict>", """ <key>EngineVersion</key>
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make more sense to actually use an XML parser for this? If we add more features to this it may get harder to track.

Alternatively, we could just have the whole plist string in here as a template and use something like String.format, like in https://github.com/flutter/engine/blob/master/tools/gen_android_buildconfig.py

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 considered both things but decided against them. There wasn't a compelling reason to make it more complicated. I didn't want to fiddle much with the formatting and some xml parsers trip up on schemas. Ultimately I went with KISS. I'm open to either of those approaches if it becomes easier / more robust.

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 the failure mode if someone someday adds another dictionary entry to Info.plist?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I forgot dictionaries were valid in an Info.plist. I'll switch it to the template implementation in a sec.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

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

LGTM. I wonder if there's some way we can have a comment in the plist to indicate where thse things get set, but without actually having the comment end up in the output file - or at least having it in some way that would be sane in an output file.

@gaaclarke gaaclarke merged commit b7e5940 into flutter:master Jul 16, 2019
@gaaclarke
Copy link
Member Author

LGTM. I wonder if there's some way we can have a comment in the plist to indicate where thse things get set, but without actually having the comment end up in the output file - or at least having it in some way that would be sane in an output file.

Yea, one problem with using format versus a replace is that it is a bit harder to search on. Potentially the file could have been like this:

  <key>EngineVersion</key>
  <string>TEMPLATE_ENGINE_VERSION</string>

...It isn't too hard to find by just searching the filename the BUILD.gn file shows up.

@chinmaygarde
Copy link
Member

chinmaygarde added a commit that referenced this pull request Jul 16, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 17, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 17, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Jul 17, 2019
flutter/engine@e3e4b26...f336286

git log e3e4b26..f336286 --no-merges --oneline
f336286 Roll src/third_party/skia 947efe28de74..08ba11370342 (9 commits) (flutter/engine#9865)
dcac8a9 Fixed error in generated xml Info.plist. (flutter/engine#9867)
b7e5940  Started adding the engine hash to frameworks&#39; Info.plist. (flutter/engine#9847)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff ([email protected]), and stop
the roller if necessary.
johnsonmh pushed a commit to johnsonmh/flutter that referenced this pull request Jul 30, 2019
flutter/engine@e3e4b26...f336286

git log e3e4b26..f336286 --no-merges --oneline
f336286 Roll src/third_party/skia 947efe28de74..08ba11370342 (9 commits) (flutter/engine#9865)
dcac8a9 Fixed error in generated xml Info.plist. (flutter/engine#9867)
b7e5940  Started adding the engine hash to frameworks&flutter#39; Info.plist. (flutter/engine#9847)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff ([email protected]), and stop
the roller if necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants