Skip to content

Commit

Permalink
Move new TextFields into TextControls directory (#8726)
Browse files Browse the repository at this point in the history
In this PR I extract the new TextFields from the old TextFields directory. In the future, if we bring over the input chip view and text area, they will go under this new TextControls directory as well.

Closes #8684.
  • Loading branch information
andrewoverton committed Nov 7, 2019
1 parent 35188a5 commit 02f9c9f
Show file tree
Hide file tree
Showing 55 changed files with 135 additions and 63 deletions.
26 changes: 13 additions & 13 deletions MaterialComponents.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -1885,24 +1885,24 @@ Pod::Spec.new do |mdc|
end
end

mdc.subspec "TextFields+ContainedInputView" do |extension|
extension.ios.deployment_target = '9.0'
extension.public_header_files = "components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/*.h"
extension.source_files = [
"components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/*.{h,m}",
"components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/private/*.{h,m}"
mdc.subspec "TextControls" do |component|
component.ios.deployment_target = '9.0'
component.public_header_files = "components/#{component.base_name}/src/*.h"
component.source_files = [
"components/#{component.base_name}/src/*.{h,m}",
"components/#{component.base_name}/src/private/*.{h,m}"
]

extension.dependency "MaterialComponents/AnimationTiming"
extension.dependency "MaterialComponents/private/Math"
extension.dependency "MDFInternationalization"
component.dependency "MaterialComponents/AnimationTiming"
component.dependency "MaterialComponents/private/Math"
component.dependency "MDFInternationalization"

extension.test_spec 'UnitTests' do |unit_tests|
component.test_spec 'UnitTests' do |unit_tests|
unit_tests.source_files = [
"components/#{extension.base_name.split('+')[0]}/tests/unit/#{extension.base_name.split('+')[1]}/*.{h,m,swift}",
"components/#{extension.base_name.split('+')[0]}/tests/unit/#{extension.base_name.split('+')[1]}/supplemental/*.{h,m,swift}"
"components/#{component.base_name}/tests/unit/*.{h,m,swift}",
"components/#{component.base_name}/tests/unit/supplemental/*.{h,m,swift}"
]
unit_tests.resources = "components/#{extension.base_name.split('+')[0]}/tests/unit/#{extension.base_name.split('+')[1]}/resources/*"
unit_tests.resources = "components/#{component.base_name.split('+')[0]}/tests/unit/#{component.base_name.split('+')[1]}/resources/*"
end
end

Expand Down
2 changes: 1 addition & 1 deletion catalog/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ target "MDCCatalog" do
'Tabs/UnitTests',
'Tabs+Theming/UnitTests',
'TextFields/UnitTests',
'TextFields+ContainedInputView/UnitTests',
'TextControls/UnitTests',
'TextFields+Theming/UnitTests',
'Themes/UnitTests',
'Typography/UnitTests',
Expand Down
96 changes: 96 additions & 0 deletions components/TextControls/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Copyright 2017-present The Material Components for iOS Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load(
"//:material_components_ios.bzl",
"mdc_examples_objc_library",
"mdc_objc_library",
"mdc_public_objc_library",
"mdc_snapshot_objc_library",
"mdc_snapshot_test",
"mdc_unit_test_objc_library",
"mdc_unit_test_suite",
)
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")

licenses(["notice"])

mdc_objc_library(
name = "private",
hdrs = native.glob(["src/private/*.h"]),
includes = ["src/private"],
visibility = [":test_targets"],
)

package_group(
name = "test_targets",
packages = [
"//components/TextControls/...",
],
)

mdc_public_objc_library(
name = "TextControls",
sdk_frameworks = [
"QuartzCore",
],
deps = [
"//components/AnimationTiming",
"@material_internationalization_ios//:MDFInternationalization",
"//components/private/Math",
],
)

mdc_examples_objc_library(
name = "ObjcExamples",
deps = [
"TextControls",
"//components/Buttons",
"//components/schemes/Container",
],
)

mdc_unit_test_objc_library(
name = "unit_test_sources",
deps = [
":TextControls",
":private",
],
)

mdc_snapshot_objc_library(
name = "snapshot_test_lib",
sdk_frameworks = [
"CoreGraphics",
],
deps = [
":TextControls",
":private",
],
)

mdc_snapshot_test(
name = "snapshot_tests",
timeout = "long",
deps = ["snapshot_test_lib"],
)

mdc_unit_test_suite(
name = "unit_tests",
deps = [
":unit_test_sources",
],
# TODO (https://github.com/material-components/material-components-ios/issues/8249): Re-enable autobot environment.
use_autobot_environment_runner = False,
)
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import "MaterialButtons.h"
#import "MaterialContainerScheme.h"
#import "MaterialTextFields+ContainedInputView.h"
#import "MaterialTextControls.h"

static NSString *const kExampleTitle = @"MDCTextControl TextFields";
static CGFloat const kDefaultPadding = 15.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

#import <UIKit/UIKit.h>

#import "../../src/ContainedInputView/private/MDCTextControl.h"
#import "MDCBaseTextFieldTestsSnapshotTestHelpers.h"
#import "MDCTextControlSnapshotTestHelpers.h"
#import "MaterialTextFields+ContainedInputView.h"
#import "../../src/private/MDCTextControl.h"
#import "MaterialTextControls.h"
#import "supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.h"
#import "supplemental/MDCTextControlSnapshotTestHelpers.h"

@interface MDCBaseTextFieldTestsSnapshotTests : MDCSnapshotTestCase
@property(strong, nonatomic) MDCBaseTextField *textField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

#import <UIKit/UIKit.h>

#import "../../src/ContainedInputView/private/MDCTextControl.h"
#import "MDCBaseTextFieldTestsSnapshotTestHelpers.h"
#import "MDCTextControlSnapshotTestHelpers.h"
#import "MaterialTextFields+ContainedInputView.h"
#import "../../src/private/MDCTextControl.h"
#import "MaterialTextControls.h"
#import "supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.h"
#import "supplemental/MDCTextControlSnapshotTestHelpers.h"

@interface MDCFilledTextFieldTestsSnapshotTests : MDCSnapshotTestCase
@property(strong, nonatomic) MDCFilledTextField *textField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

#import <UIKit/UIKit.h>

#import "../../src/ContainedInputView/private/MDCTextControl.h"
#import "MDCBaseTextFieldTestsSnapshotTestHelpers.h"
#import "MDCTextControlSnapshotTestHelpers.h"
#import "MaterialTextFields+ContainedInputView.h"
#import "../../src/private/MDCTextControl.h"
#import "MaterialTextControls.h"
#import "supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.h"
#import "supplemental/MDCTextControlSnapshotTestHelpers.h"

@interface MDCOutlinedTextFieldTestsSnapshotTests : MDCSnapshotTestCase
@property(strong, nonatomic) MDCOutlinedTextField *textField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import <UIKit/UIKit.h>

#import "MaterialTextFields+ContainedInputView.h"
#import "MaterialTextControls.h"

@interface MDCBaseTextFieldTestsSnapshotTestHelpers : NSObject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import <UIKit/UIKit.h>

#import "../../src/ContainedInputView/private/MDCTextControl.h"
#import "../../../src/private/MDCTextControl.h"

@interface MDCTextControlSnapshotTestHelpers : NSObject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import <UIKit/UIKit.h>

#import "../../src/ContainedInputView/MaterialTextFields+ContainedInputView.h"
#import "MaterialTextControls.h"

#import "MDCTextControlSnapshotTestHelpers.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

#import <XCTest/XCTest.h>

#import "../../../src/ContainedInputView/private/MDCBaseTextFieldLayout.h"
#import "../../../src/ContainedInputView/private/MDCTextControlAssistiveLabelView.h"
#import "../../../src/ContainedInputView/private/MDCTextControlVerticalPositioningReferenceBase.h"
#import "MaterialTextFields+ContainedInputView.h"
#import "MaterialTextControls.h"

#import "../../src/private/MDCBaseTextFieldLayout.h"
#import "../../src/private/MDCTextControlAssistiveLabelView.h"
#import "../../src/private/MDCTextControlVerticalPositioningReferenceBase.h"

@interface MDCBaseTextFieldLayout (Testing)
- (CGFloat)textHeightWithFont:(UIFont *)font;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

#import <XCTest/XCTest.h>

#import "MaterialTextFields+ContainedInputView.h"
#import "MaterialTextControls.h"

#import "../../../src/ContainedInputView/private/MDCTextControlLabelState.h"
#import "../../src/private/MDCTextControlLabelState.h"

@interface MDCBaseTextField (Private)
@property(nonatomic, assign) UIUserInterfaceLayoutDirection layoutDirection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#import <XCTest/XCTest.h>

#import "MaterialTextFields+ContainedInputView.h"
#import "MaterialTextControls.h"

@interface MDCFilledTextFieldTests : XCTestCase
@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#import <XCTest/XCTest.h>

#import "MaterialTextFields+ContainedInputView.h"
#import "MaterialTextControls.h"

@interface MDCOutlinedTextFieldTests : XCTestCase
@end
Expand Down
25 changes: 0 additions & 25 deletions components/TextFields/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,6 @@ mdc_public_objc_library(
],
)

mdc_extension_objc_library(
name = "ContainedInputView",
deps = [
"//components/AnimationTiming",
"@material_internationalization_ios//:MDFInternationalization",
"//components/private/Math",
],
)

mdc_extension_objc_library(
name = "Theming",
deps = [
Expand Down Expand Up @@ -105,7 +96,6 @@ mdc_examples_objc_library(
name = "ObjcExamples",
deps = [
":ColorThemer",
":ContainedInputView",
":TextFields",
":TypographyThemer",
"//components/Buttons",
Expand All @@ -123,23 +113,10 @@ mdc_examples_swift_library(
],
)

mdc_objc_library(
name = "ContainedInputViewPrivateHeaders",
hdrs = native.glob(["src/ContainedInputView/private/*.h"]),
includes = ["src/private"],
visibility = ["//visibility:private"],
)

mdc_unit_test_objc_library(
name = "unit_test_sources",
extra_srcs = glob([
"tests/unit/ContainedInputView/*.m",
"tests/unit/ContainedInputView/private/*.m",
]),
deps = [
":ColorThemer",
":ContainedInputView",
":ContainedInputViewPrivateHeaders",
":FontThemer",
":TextFields",
":TypographyThemer",
Expand All @@ -158,8 +135,6 @@ mdc_snapshot_objc_library(
],
deps = [
":ColorThemer",
":ContainedInputView",
":ContainedInputViewPrivateHeaders",
":FontThemer",
":TextFields",
":TypographyThemer",
Expand Down

0 comments on commit 02f9c9f

Please sign in to comment.