Skip to content

Skip podspec Swift Search Path validation if only swift file is Package.swift - #6627

Merged
auto-submit[bot] merged 4 commits into
flutter:mainfrom
vashworth:skip_swift_search_path_for_package_swift
Apr 30, 2024
Merged

Skip podspec Swift Search Path validation if only swift file is Package.swift#6627
auto-submit[bot] merged 4 commits into
flutter:mainfrom
vashworth:skip_swift_search_path_for_package_swift

Conversation

@vashworth

@vashworthvashworth commented Apr 29, 2024

Copy link
Copy Markdown
Contributor

Usually when an iOS plugin uses Swift files, it requires a workaround in the podspec to add Swift to the search paths. Part of the podspec-check command is validating this workaround is found. However, when the only Swift file is the Package.swift (Swift Package Manager manifest), skip this validation since having this file does not indicate the plugin uses Swift files.

Fixesflutter/flutter#147548.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@vashworth
vashworth marked this pull request as ready for review April 29, 2024 21:57
@vashworthvashworth changed the title Skip Swift Search Path validation if only swift file is Package.swiftSkip podspec and license validation for Package.swiftApr 29, 2024
@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

Also, skip license check for Package.swift files.

I don't think we should skip the license here; it's authored code, not generated code. Even though it's not very interesting, it's still non-generated.

Comment threadscript/tool/lib/src/podspec_check_command.dart Outdated
@vashworth

vashworth commented Apr 30, 2024

Copy link
Copy Markdown
ContributorAuthor

Also, skip license check for Package.swift files.

I don't think we should skip the license here; it's authored code, not generated code. Even though it's not very interesting, it's still non-generated.

I was thinking it didn't need to be licensed since we don't license the podspec file. Also, Package.swift is very picky about what comments are at the top of the file. The first comment has to be the tools version.

So to license it, it would look like

// swift-tools-version: 5.9
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import PackageDescription
letpackage=Package(...

Is that okay?

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

That should be fine; it's similar to how bash script files have a #! comment before the license block section since that also has to be the very first line.

@vashworthvashworth changed the title Skip podspec and license validation for Package.swiftSkip podspec Swift Search Path validation if only swift file is Package.swiftApr 30, 2024

@stuartmorgan-gstuartmorgan-g left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@vashworthvashworth added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 30, 2024
@auto-submit
auto-submitBot merged commit aea93d2 into flutter:mainApr 30, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 1, 2024
auto-submitBot pushed a commit to flutter/flutter that referenced this pull request May 1, 2024
flutter/packages@cc47b06...aea93d2
2024-04-30 15619084+vashworth@users.noreply.github.com Skip podspec Swift Search Path validation if only swift file is Package.swift (flutter/packages#6627)
2024-04-30 ditman@gmail.com [go_router_builder] Tweaks for latest analyzer-6.5.0 (flutter/packages#6632)
2024-04-30 engine-flutter-autoroll@skia.org Roll Flutter from db8c475 to b597dd2 (23 revisions) (flutter/packages#6631)
2024-04-30 44902066+waleedf112@users.noreply.github.com [flutter_adaptive_scaffold] use `MediaQuery.sizeOf` instead of `MediaQuery.of` to prevent unnecessary rebuilds (flutter/packages#6544)
2024-04-30 34871572+gmackall@users.noreply.github.com [image_picker] Update documentation to note that Photo Picker use is non-optional on Android 13+ (flutter/packages#6569)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submitBot pushed a commit that referenced this pull request May 2, 2024
…ge.swift for darwin plugins (#6635)
Fix for iOS was added in #6627, but neglected to handle when plugin uses darwin directory.
Supplemental fix for flutter/flutter#147548.
TecHaxter pushed a commit to TecHaxter/flutter_packages that referenced this pull request May 22, 2024
…ge.swift (flutter#6627)
Usually when an iOS plugin uses Swift files, it requires a workaround in the podspec to add Swift to the search paths. Part of the `podspec-check` command is validating this workaround is found. However, when the only Swift file is the `Package.swift` (Swift Package Manager manifest), skip this validation since having this file does not indicate the plugin uses Swift files.
Fixesflutter/flutter#147548.
TecHaxter pushed a commit to TecHaxter/flutter_packages that referenced this pull request May 22, 2024
…ge.swift for darwin plugins (flutter#6635)
Fix for iOS was added in flutter#6627, but neglected to handle when plugin uses darwin directory.
Supplemental fix for flutter/flutter#147548.
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…ge.swift (flutter#6627)
Usually when an iOS plugin uses Swift files, it requires a workaround in the podspec to add Swift to the search paths. Part of the `podspec-check` command is validating this workaround is found. However, when the only Swift file is the `Package.swift` (Swift Package Manager manifest), skip this validation since having this file does not indicate the plugin uses Swift files.
Fixesflutter/flutter#147548.
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…ge.swift for darwin plugins (flutter#6635)
Fix for iOS was added in flutter#6627, but neglected to handle when plugin uses darwin directory.
Supplemental fix for flutter/flutter#147548.
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
…ge.swift (flutter#6627)
Usually when an iOS plugin uses Swift files, it requires a workaround in the podspec to add Swift to the search paths. Part of the `podspec-check` command is validating this workaround is found. However, when the only Swift file is the `Package.swift` (Swift Package Manager manifest), skip this validation since having this file does not indicate the plugin uses Swift files.
Fixesflutter/flutter#147548.
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
…ge.swift for darwin plugins (flutter#6635)
Fix for iOS was added in flutter#6627, but neglected to handle when plugin uses darwin directory.
Supplemental fix for flutter/flutter#147548.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmitMerge PR when tree becomes green via auto submit App

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skip Package.swift when validating in flutter/packages

2 participants

@vashworth@stuartmorgan-g