Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release-candidate' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Verkoeyen committed Nov 3, 2017
2 parents c12d18f + 860010e commit 3fb2ea2
Show file tree
Hide file tree
Showing 32 changed files with 828 additions and 226 deletions.
26 changes: 0 additions & 26 deletions .arcconfig

This file was deleted.

45 changes: 0 additions & 45 deletions .arclint

This file was deleted.

12 changes: 0 additions & 12 deletions .arcunit

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
bazel-*
.kokoro-ios-runner

# Jazzy
docs/

Expand Down
61 changes: 61 additions & 0 deletions .kokoro
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash
#
# Copyright 2017-present The Material Motion 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.

# Fail on any error.
set -e

# Display commands to stderr.
set -x

KOKORO_RUNNER_VERSION="v3.*"

fix_bazel_imports() {
if [ -z "$KOKORO_BUILD_NUMBER" ]; then
tests_dir_prefix=""
else
tests_dir_prefix="github/repo/"
fi

# Fixes a bug in bazel where objc_library targets have a _ prefix.
find "${tests_dir_prefix}tests/unit" -type f -name '*.swift' -exec sed -i '' -E "s/import Motion(.+)/import _Motion\1/" {} + || true
# CocoaPods requires that public headers of dependent pods be implemented using framework import
# notation, while bazel requires that dependency headers be imported with quoted notation.
find "${tests_dir_prefix}src" -type f -name '*.h' -exec sed -i '' -E "s/import <MotionInterchange\/MotionInterchange\.h>/import \"MotionInterchange.h\"/" {} + || true
stashed_dir=$(pwd)
reset_imports() {
# Undoes our source changes from above.
find "${stashed_dir}/${tests_dir_prefix}tests/unit" -type f -name '*.swift' -exec sed -i '' -E "s/import _Motion(.+)/import Motion\1/" {} + || true
find "${stashed_dir}/${tests_dir_prefix}src" -type f -name '*.h' -exec sed -i '' -E "s/import \"MotionInterchange.h\"/import <MotionInterchange\/MotionInterchange.h>/" {} + || true
}
trap reset_imports EXIT
}

if [ ! -d .kokoro-ios-runner ]; then
git clone https://github.com/material-foundation/kokoro-ios-runner.git .kokoro-ios-runner
fi

pushd .kokoro-ios-runner
git fetch > /dev/null
# https://stackoverflow.com/questions/21394536/how-to-simulate-sort-v-on-mac-osx
TAG=$(git tag --sort=v:refname -l "$KOKORO_RUNNER_VERSION" | tail -n1)
git checkout "$TAG" > /dev/null
popd

fix_bazel_imports

./.kokoro-ios-runner/bazel.sh test //:UnitTests 8.1.0

echo "Success!"
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ osx_image: xcode8.1
sudo: false
before_install:
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
- git clone https://github.com/phacility/arcanist.git
- git clone https://github.com/phacility/libphutil.git
- git clone --recursive https://github.com/material-foundation/material-arc-tools.git
- pod install --repo-update
script:
- set -o pipefail
- arcanist/bin/arc unit --everything --trace
- xcodebuild build -workspace MotionAnimator.xcworkspace -scheme MotionAnimatorCatalog -sdk "iphonesimulator10.1" -destination "name=iPhone 6s,OS=10.1" ONLY_ACTIVE_ARCH=YES | xcpretty -c;
after_success:
- bash <(curl -s https://codecov.io/bash)
74 changes: 74 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Copyright 2017-present The Material Motion 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.
#
# Description:
# A Motion Animator creates performant, interruptible animations from motion specs.

load("@bazel_ios_warnings//:strict_warnings_objc_library.bzl", "strict_warnings_objc_library")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test")
load("@build_bazel_rules_apple//apple:swift.bzl", "swift_library")

licenses(["notice"]) # Apache 2.0

exports_files(["LICENSE"])

strict_warnings_objc_library(
name = "MotionAnimator",
srcs = glob([
"src/*.m",
"src/private/*.m",
]),
hdrs = glob([
"src/*.h",
"src/private/*.h",
]),
deps = [
"@motion_interchange_objc//:MotionInterchange"
],
enable_modules = 1,
includes = ["src"],
visibility = ["//visibility:public"],
)

swift_library(
name = "UnitTestsSwiftLib",
srcs = glob([
"tests/unit/*.swift",
]),
deps = [":MotionAnimator"],
visibility = ["//visibility:private"],
)

objc_library(
name = "UnitTestsLib",
srcs = glob([
"tests/unit/*.m",
]),
hdrs = glob([
"tests/unit/*.h",
]),
enable_modules = 1,
deps = [":MotionAnimator"],
visibility = ["//visibility:private"],
)

ios_unit_test(
name = "UnitTests",
deps = [
":UnitTestsLib",
":UnitTestsSwiftLib"
],
timeout = "short",
visibility = ["//visibility:private"],
)
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,70 @@
# 2.0.0

This major release includes several new APIs, bug fixes, and internal cleanup.

## Breaking changes

The animator now adds non-additive animations with the keyPath as the animation key. This is a
behavioral change in that animations will now remove the current animation with the same key.

## Bug fixes

Implicit animations are no longer created when adding animations within a UIView animation block.

## New features

New keypath constants:

- backgroundColor
- position
- rotation
- strokeStart
- strokeEnd

New APIs on CATransaction for setting a transaction-specific timeScaleFactor:

```swift
CATransaction.begin()
CATransaction.mdm_setTimeScaleFactor(0.5)
animator.animate...
CATransaction.commit()
```

## Source changes

* [Add support for customizing the timeScaleFactor as part of a CATransaction (#25)](https://github.com/material-motion/motion-animator-objc/commit/17601b94b19320eb4542fca12ba1fa5a2b487271) (featherless)
* [[breaking] Use the keyPath as the key when the animator is not additive. (#22)](https://github.com/material-motion/motion-animator-objc/commit/bb42e617fc80604e056aee618f953d076f5c8928) (featherless)
* [Disable implicit animations when adding explicit animations in the animator (#20)](https://github.com/material-motion/motion-animator-objc/commit/8be151c06d3769540a5efce9d9f00bbc7e6f1555) (featherless)
* [Move private APIs to the private folder. (#17)](https://github.com/material-motion/motion-animator-objc/commit/ee19fdaad12d8a02f5b8ec655363662dfecc30cc) (featherless)
* [Add rotation, strokeStart, and strokeEnd key paths. (#19)](https://github.com/material-motion/motion-animator-objc/commit/ccdffd5597d5888f63c0a3ef0204cfc9efba2a1f) (featherless)
* [Extract a MDMCoreAnimationTraceable protocol from MotionAnimator. (#18)](https://github.com/material-motion/motion-animator-objc/commit/dbe5c3b5d597e6bad50bfc89b53cf0af95c435bc) (featherless)
* [Add position and backgroundColor as key paths. (#15)](https://github.com/material-motion/motion-animator-objc/commit/38907aef8ec0e29aa01ce9b3c13851226802b464) (featherless)
* [Replace arc with kokoro and bazel support for continuous integration. (#13)](https://github.com/material-motion/motion-animator-objc/commit/2ac68fb1ac4cdf61ba6fc7563a59417d39938074) (featherless)

## API changes

### CATransaction

**new** method: `mdm_timeScaleFactor`.

**new** method: `mdm_setTimeScaleFactor:`.

### Animatable key paths

**new** constant: `MDMKeyPathBackgroundColor`

**new** constant: `MDMKeyPathPosition`

**new** constant: `MDMKeyPathRotation`

**new** constant: `MDMKeyPathStrokeStart`

**new** constant: `MDMKeyPathStrokeEnd`

### MDMCoreAnimationTraceable

**new** protocol: MDMCoreAnimationTraceable

# 1.1.3

This patch release resolves an Xcode 9 build warning.
Expand Down
2 changes: 1 addition & 1 deletion MotionAnimator.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "MotionAnimator"
s.summary = "A Motion Animator creates performant, interruptible animations from motion specs."
s.version = "1.1.3"
s.version = "2.0.0"
s.authors = "The Material Motion Authors"
s.license = "Apache 2.0"
s.homepage = "https://github.com/material-motion/motion-animator-objc"
Expand Down
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- CatalogByConvention (2.1.1)
- MotionAnimator (1.1.3):
- MotionAnimator (2.0.0):
- MotionInterchange
- MotionInterchange (1.0.1)

Expand All @@ -14,7 +14,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
CatalogByConvention: c3a5319de04250a7cd4649127fcfca5fe3322a43
MotionAnimator: f241c4acd49dea603c3a2ea131727d57853a281b
MotionAnimator: 38933cf4bdfe0183ba3ed1f8a8963b98e83a4bca
MotionInterchange: 7a7c355ba2ed5d36c5cf2ceb76cacd3d3680dbf5

PODFILE CHECKSUM: 3c50d819e57d8329e39f3f5677139bf93ac34b8b
Expand Down
31 changes: 31 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2017-present The Material Motion 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.

git_repository(
name = "build_bazel_rules_apple",
remote = "https://github.com/bazelbuild/rules_apple.git",
commit = "7ea0557",
)

git_repository(
name = "bazel_ios_warnings",
remote = "https://github.com/material-foundation/bazel_ios_warnings.git",
tag = "v1.0.1",
)

git_repository(
name = "motion_interchange_objc",
remote = "https://github.com/material-motion/motion-interchange-objc.git",
tag = "v1.1.1",
)
2 changes: 1 addition & 1 deletion examples/CalendarCardExpansionExample.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#import "CalendarChipMotionSpec.h"

#import <MotionAnimator/MotionAnimator.h>
#import "MotionAnimator.h"

// This example demonstrates how to use a motion timing specification to build a complex
// bi-directional animation using the MDMMotionAnimator object. MDMMotionAnimator is designed for
Expand Down
Loading

0 comments on commit 3fb2ea2

Please sign in to comment.