Skip to content

Commit

Permalink
[ActionSheet] Try to fix MaterialComponentsAlpha (#5541)
Browse files Browse the repository at this point in the history
With these changes I'm able to create a project with `MaterialComponentsAlpha` in its Podile and import `MaterialComponentsAlpha.MaterialActionSheet` into a Swift file in said project without getting the "Could not build Objective-C module" error message.
 
`@import MaterialComponents.MaterialTypographyScheme;` and `#import <MaterialComponents/MaterialTypographyScheme.h>` both seem to work. With the `#import` statement you can jump to the definition, and with the `@import` statement you can't, which is a little weird!

This change also brings the number of validation errors from running `pod lib lint MaterialComponentsAlpha.podspec` from 6 down to 1. I haven't figured out how to get rid of the last one, which is a little concerning, and suggests that this may not be a complete fix? Hmmm. The compilation errors seem to be fixed though!

Closes #5380. Maybe.

The necessary internal changes can be seen at cl/220325160
  • Loading branch information
andrewoverton committed Nov 7, 2018
1 parent 43a9966 commit 7472e89
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .kokoro
Expand Up @@ -49,6 +49,7 @@ fix_bazel_imports() {
rewrite_tests "s/import MaterialComponents.Material(.+)/import components_\1_\1/"
rewrite_source "s/import <Motion(.+)\/Motion.+\.h>/import \"Motion\1.h\"/"
rewrite_source "s/import <MDF(.+)\/MDF.+\.h>/import \"MDF\1.h\"/"
rewrite_source "s/import <MaterialComponents\/Material(.+)\.h>/import\/\*framework import\*\/ \"Material\1.h\"/"
rewrite_tests "s/import MDFTextAccessibility/import material_text_accessibility_ios_MDFTextAccessibility/"
rewrite_tests "s/import MDFInternationalization/import material_internationalization_ios_MDFInternationalization/"
stashed_dir="$(pwd)/"
Expand All @@ -63,6 +64,7 @@ fix_bazel_imports() {
rewrite_tests "s/import components_(.+)_(.+)/import MaterialComponents.Material\1_\2/"
rewrite_source "s/import \"Motion(.+)\.h\"/import <Motion\1\/Motion\1.h>/"
rewrite_source "s/import \"MDF(.+)\.h\"/import <MDF\1\/MDF\1.h>/"
rewrite_source "s/import\/\*framework import\*\/ \"Material(.+)\.h\"/import <MaterialComponents\/Material\1\.h>/"
rewrite_tests "s/import material_text_accessibility_ios_MDFTextAccessibility/import MDFTextAccessibility/"
rewrite_tests "s/import material_internationalization_ios_MDFInternationalization/import MDFInternationalization/"
}
Expand Down
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#import "MaterialColorScheme.h"
#import "MaterialTypographyScheme.h"
#import <MaterialComponents/MaterialColorScheme.h>
#import <MaterialComponents/MaterialTypographyScheme.h>

#import <Foundation/Foundation.h>

Expand Down
Expand Up @@ -13,10 +13,11 @@
// limitations under the License.

#import "MaterialActionSheet.h"
#import "MaterialColorScheme.h"

#import <Foundation/Foundation.h>

#import <MaterialComponents/MaterialColorScheme.h>

/**
The Material Design color system's themer for instances of MDCActionSheetController.
*/
Expand Down
2 changes: 1 addition & 1 deletion components/ActionSheet/src/MDCActionSheetController.h
Expand Up @@ -14,7 +14,7 @@

#import <UIKit/UIKit.h>

#import "MaterialBottomSheet.h"
#import <MaterialComponents/MaterialBottomSheet.h>

@class MDCActionSheetAction;

Expand Down
Expand Up @@ -13,10 +13,11 @@
// limitations under the License.

#import "MaterialActionSheet.h"
#import "MaterialTypographyScheme.h"

#import <Foundation/Foundation.h>

#import <MaterialComponents/MaterialTypographyScheme.h>

/**
The Material Design typography system's themer for instances of MDCActionSheetController.
*/
Expand Down

0 comments on commit 7472e89

Please sign in to comment.