Permalink
Browse files

Fix CI.

  • Loading branch information...
kzaher committed Jan 29, 2019
1 parent ba930dc commit e9d711b0ec70e6a63bb736dd889d1518697e7a77
Showing with 69 additions and 33 deletions.
  1. +10 −13 .travis.yml
  2. +25 −0 Sources/RxAtomic/include/RxAtomic.h
  3. +34 −20 scripts/validate-podspec.sh
@@ -36,35 +36,36 @@ matrix:
include:
- osx_image: xcode10
os: osx
env: BUILD="pod lib lint --swift-version=4 RxSwift.podspec"
env: BUILD="TARGET=RxSwift SWIFT_VERSION=4 ./scripts/validate-podspec.sh"

- osx_image: xcode10
os: osx
env: BUILD="pod lib lint --swift-version=4 RxCocoa.podspec"
env: BUILD="TARGET=RxCocoa SWIFT_VERSION=4 ./scripts/validate-podspec.sh"

- osx_image: xcode10
os: osx
env: BUILD="pod lib lint --swift-version=4 RxBlocking.podspec"
env: BUILD="TARGET=RxBlocking SWIFT_VERSION=4 ./scripts/validate-podspec.sh"

- osx_image: xcode10
os: osx
env: BUILD="pod lib lint --swift-version=4 RxTest.podspec"
env: BUILD="TARGET=RxTest SWIFT_VERSION=4 ./scripts/validate-podspec.sh"

- osx_image: xcode10
os: osx
env: BUILD="pod lib lint --swift-version=4.2 RxSwift.podspec"
env: BUILD="TARGET=RxSwift SWIFT_VERSION=4.2 ./scripts/validate-podspec.sh"

- osx_image: xcode10
os: osx
env: BUILD="pod lib lint --swift-version=4.2 RxCocoa.podspec"
env: BUILD="TARGET=RxCocoa SWIFT_VERSION=4.2 ./scripts/validate-podspec.sh"

- osx_image: xcode10
os: osx
env: BUILD="pod lib lint --swift-version=4.2 RxBlocking.podspec"
env: BUILD="TARGET=RxBlocking SWIFT_VERSION=4.2 ./scripts/validate-podspec.sh"

- osx_image: xcode10
os: osx
env: BUILD="pod lib lint --swift-version=4.2 RxTest.podspec"
env: BUILD="TARGET=RxTest SWIFT_VERSION=4.2 ./scripts/validate-podspec.sh"


notifications:
slack: rxswift:3ykt2Z61f8GkdvhCZTYPduOL
@@ -81,11 +82,7 @@ script:
fi
-
if [[ ! -z "${BUILD}" ]] ; then
if [[ "${BUILD}" =~ ^pod[[:space:]].* ]]; then
gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet;
pod repo update;
fi;
eval "${BUILD}";
eval "TRAVIS=1 ${BUILD}";
else
if [[ "${DANGER}" -eq 1 ]] ; then
bundle install --path vendor/bundle;
@@ -40,6 +40,31 @@
return atomic_fetch_sub(&self->atom, value);\
}\
\
static __inline__ __attribute__((__always_inline__)) \
void Atomic##swift_type##_initialize(Atomic##swift_type * _Nonnull self, llvm_type value) { \
atomic_init(&self->atom, value);\
}\
\
static __inline__ __attribute__((__always_inline__)) \
llvm_type Atomic##swift_type##_load(Atomic##swift_type * _Nonnull self) { \
return atomic_load(&self->atom);\
}\
\
static __inline__ __attribute__((__always_inline__)) \
llvm_type Atomic##swift_type##_fetchOr(Atomic##swift_type * _Nonnull self, llvm_type mask) { \
return atomic_fetch_or(&self->atom, mask);\
}\
\
static __inline__ __attribute__((__always_inline__)) \
llvm_type Atomic##swift_type##_add(Atomic##swift_type * _Nonnull self, llvm_type value) { \
return atomic_fetch_add(&self->atom, value);\
}\
\
static __inline__ __attribute__((__always_inline__)) \
llvm_type Atomic##swift_type##_sub(Atomic##swift_type * _Nonnull self, llvm_type value) { \
return atomic_fetch_sub(&self->atom, value);\
}\
\

Atomic(Int, int)

@@ -3,7 +3,7 @@

set -e

BRANCH=$(git rev-parse --abbrev-ref HEAD)
BRANCH=$(git rev-parse HEAD)
ESCAPED_SOURCE=$(pwd | sed -E "s/\//\\\\\//g")

function cleanup {
@@ -15,39 +15,53 @@ function cleanup {

trap cleanup EXIT

if [[ ! -z "${TRAVIS}" ]]; then
gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet;
pod repo update;
fi;

VERSION=`cat RxSwift.podspec | grep -E "s.version\s+=" | cut -d '"' -f 2`
TARGETS=(RxTest RxCocoa RxBlocking RxAtomic RxSwift)
ROOTS=(2/e/c 3/c/1 8/5/5 f/7/9 a/b/1)
ALL_TARGETS=(RxTest RxCocoa RxBlocking RxAtomic RxSwift)

pushd ~/.cocoapods/repos/master/Specs
for TARGET in ${TARGETS[@]}
do
mkdir -p ${TARGET}/${VERSION}
done
popd
if [ ! -z "$TARGET" ]
then
TARGETS=("$TARGET")
else
TARGETS="${ALL_TARGETS}"
fi

for TARGET in ${TARGETS[@]}
do
if [ ! -z "$SWIFT_VERSION" ]
then
SWIFT_VERSION="--swift-version=${SWIFT_VERSION}"
fi

SOURCE_DIR=`pwd`

pushd ~/.cocoapods/repos/master/Specs
for ROOT in ${ROOTS[@]} ; do
mkdir -p ~/.cocoapods/repos/master/Specs/${ROOT}/${TARGET}/${VERSION}
rm ~/.cocoapods/repos/master/Specs/${ROOT}/${TARGET}/${VERSION}/* || echo
cat $TARGET.podspec |
sed -E "s/s.source [^\}]+\}/s.source = { :git => '${ESCAPED_SOURCE}', :branch => \'${BRANCH}\' }/" > ~/.cocoapods/repos/master/Specs/${ROOT}/${TARGET}/${VERSION}/${TARGET}.podspec
done
for TARGET in ${ALL_TARGETS[@]}
do
if [ ! -d "${ROOT}/${TARGET}" ]
then
continue
fi

done
mkdir -p ${ROOT}/${TARGET}/${VERSION}
rm ${ROOT}/${TARGET}/${VERSION}/* || echo
cat "${SOURCE_DIR}/$TARGET.podspec" |
sed -E "s/s.source [^\}]+\}/s.source = { :git => 'file:\/\/${ESCAPED_SOURCE}' }/" > ${ROOT}/${TARGET}/${VERSION}/${TARGET}.podspec
done
done
popd

function validate() {
local PODSPEC=$1

pod lib lint $PODSPEC --verbose --no-clean --allow-warnings
pod lib lint $PODSPEC --verbose --no-clean --allow-warnings "${SWIFT_VERSION}"
}

for TARGET in ${TARGETS[@]}
do

validate ${TARGET}.podspec

validate ${TARGET}.podspec
done

0 comments on commit e9d711b

Please sign in to comment.