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 Oct 19, 2017
2 parents 8558bf3 + 054bd84 commit da10725
Show file tree
Hide file tree
Showing 13 changed files with 147 additions and 98 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
36 changes: 36 additions & 0 deletions .kokoro
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Fail on any error.
set -e

# Display commands to stderr.
set -x

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
TAG=$(git tag -l "v3*" | sort | tail -n1)
git checkout $TAG > /dev/null
popd

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
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
}
trap reset_imports EXIT

./.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 MotionInterchange.xcworkspace -scheme MotionInterchangeCatalog -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)
56 changes: 56 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Description:
# Motion interchange format.

licenses(["notice"]) # Apache 2.0

exports_files(["LICENSE"])

load("@bazel_ios_warnings//:strict_warnings_objc_library.bzl", "strict_warnings_objc_library")

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

load("@build_bazel_rules_apple//apple:swift.bzl", "swift_library")

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

objc_library(
name = "UnitTestsLib",
srcs = glob([
"tests/unit/*.m",
]),
deps = [":MotionInterchange"],
visibility = ["//visibility:private"],
)

load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test")

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

This patch release migrates the project's continuous integration pipeline from arc to bazel and
kokoro.

## New features

Continuous integration can now be run locally by executing `./.kokoro` from the root of the git
repo. Requires [bazel](http://bazel.io/).

## Source changes

* [Replace arc with bazel and Kokoro continuous integration. (#9)](https://github.com/material-motion/motion-interchange-objc/commit/2ef4dfbf95a7beb3f0e323e259576b6797420202) (featherless)
* [Fix warning in unit tests. (#8)](https://github.com/material-motion/motion-interchange-objc/commit/d3203a2857648f74d478525514c0f10cb6552b19) (featherless)
* [Add missing import.](https://github.com/material-motion/motion-interchange-objc/commit/445091dbbd68cd0a75e4dd86195cb431b0717e71) (Jeff Verkoeyen)

# 1.1.0

This minor release introduces two new APIs for working with timing curves.
Expand Down
2 changes: 1 addition & 1 deletion MotionInterchange.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "MotionInterchange"
s.summary = "Motion interchange format."
s.version = "1.1.0"
s.version = "1.1.1"
s.authors = "The Material Motion Authors"
s.license = "Apache 2.0"
s.homepage = "https://github.com/material-motion/motion-interchange-objc"
Expand Down
10 changes: 5 additions & 5 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
PODS:
- CatalogByConvention (2.1.1)
- MotionInterchange (1.1.0)
- MotionInterchange (1.1.1)

DEPENDENCIES:
- CatalogByConvention
- MotionInterchange (from `./`)

EXTERNAL SOURCES:
MotionInterchange:
:path: "./"
:path: ./

SPEC CHECKSUMS:
CatalogByConvention: c3a5319de04250a7cd4649127fcfca5fe3322a43
MotionInterchange: b600100244df56c4f462bdacbcd11c44e6305d05
MotionInterchange: 3556642f403549449a49f05653da3bd932a5e072

PODFILE CHECKSUM: '09090d12db5aab00a13fe82da94f338ebd03f5dc'
PODFILE CHECKSUM: 09090d12db5aab00a13fe82da94f338ebd03f5dc

COCOAPODS: 1.2.1
COCOAPODS: 1.3.1
11 changes: 11 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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",
commit = "3e61cb5b60f52c8b9c77b5d62364d8b4d25e528f",
)
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,12 @@
files = (
);
inputPaths = (
"${SRCROOT}/../../../Pods/Target Support Files/Pods-UnitTests/Pods-UnitTests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/MotionInterchange/MotionInterchange.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MotionInterchange.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand All @@ -386,9 +389,14 @@
files = (
);
inputPaths = (
"${SRCROOT}/../../../Pods/Target Support Files/Pods-MotionInterchangeCatalog/Pods-MotionInterchangeCatalog-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/CatalogByConvention/CatalogByConvention.framework",
"${BUILT_PRODUCTS_DIR}/MotionInterchange/MotionInterchange.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CatalogByConvention.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MotionInterchange.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand All @@ -401,13 +409,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-MotionInterchangeCatalog-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
ACE41FB9B6C92F7B4625CB2E /* [CP] Check Pods Manifest.lock */ = {
Expand All @@ -416,13 +427,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-UnitTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
B7150A802D70B33666362149 /* [CP] Copy Pods Resources */ = {
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/MDMMotionCurveTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@

#import <XCTest/XCTest.h>

@import MotionInterchange;
#import "MotionInterchange.h"

@interface MDMMotionCurveTests : XCTestCase
@end

@implementation MDMMotionCurveTests

- (void)testBezierCurveData {
MDMMotionCurve curve = MDMMotionCurveMakeBezier(0.1, 0.2, 0.3, 0.4);
MDMMotionCurve curve = MDMMotionCurveMakeBezier(0.1f, 0.2f, 0.3f, 0.4f);
XCTAssertEqualWithAccuracy(curve.data[MDMBezierMotionCurveDataIndexP1X], 0.1, 0.001);
XCTAssertEqualWithAccuracy(curve.data[MDMBezierMotionCurveDataIndexP1Y], 0.2, 0.001);
XCTAssertEqualWithAccuracy(curve.data[MDMBezierMotionCurveDataIndexP2X], 0.3, 0.001);
XCTAssertEqualWithAccuracy(curve.data[MDMBezierMotionCurveDataIndexP2Y], 0.4, 0.001);
}

- (void)testSpringCurveData {
MDMMotionCurve curve = MDMMotionCurveMakeSpring(0.1, 0.2, 0.3);
MDMMotionCurve curve = MDMMotionCurveMakeSpring(0.1f, 0.2f, 0.3f);
XCTAssertEqualWithAccuracy(curve.data[MDMSpringMotionCurveDataIndexMass], 0.1, 0.001);
XCTAssertEqualWithAccuracy(curve.data[MDMSpringMotionCurveDataIndexTension], 0.2, 0.001);
XCTAssertEqualWithAccuracy(curve.data[MDMSpringMotionCurveDataIndexFriction], 0.3, 0.001);
Expand Down

0 comments on commit da10725

Please sign in to comment.