Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 62 additions & 41 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
version: 2.1

orbs:
rn: react-native-community/react-native@5.1.0
rn: react-native-community/react-native@5.5.0
windows: circleci/windows@2.4.0

jobs:
checkout_code:
Expand All @@ -11,7 +12,8 @@ jobs:
- persist_to_workspace:
root: .
paths: .
analyse:

verify:
executor: rn/linux_js
steps:
- attach_workspace:
Expand All @@ -23,16 +25,49 @@ jobs:
- run:
name: Flow
command: yarn run validate:flow

test:
executor: rn/linux_js
steps:
- attach_workspace:
at: .
- rn/yarn_install
- run:
name: Jest
name: Run unit tests with Jest
command: yarn run test:jest
# TODO: Uncomment after fixing detox setup
# - run:
# name: Build Android JavaScript Bundle
# command: yarn run test:detox:android:bundle:release
# - run:
# name: Build iOS JavaScript Bundle
# command: yarn run test:detox:ios:bundle:release

build_example_windows:
executor:
name: windows/default
shell: powershell
steps:
- checkout
- run:
name: Install examples
command: cd src; yarn install; cd ../example; yarn install --force --frozen-lockfile
- run:
name: "Restore NuGet packages for Components"
command: nuget restore .\example\windows\SliderTestWindows.sln
- run:
name: "Restore .NET dependencies"
command: msbuild -t:restore .\example\windows\SliderTestWindows.sln
- run:
name: Build example Windows
command: cd example; npx react-native run-windows --no-packager --no-launch --arch x64 --logging --no-deploy

build_example_ios:
executor: rn/macos
steps:
- checkout
- run:
name: Install deps
command: cd src && yarn install && cd ../example && yarn install --force --frozen-lockfile
- run:
name: Install Pods
command: cd example && npx pod-install
- run:
name: Build the iOS example project
command: cd example/ios && export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace example.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 11' -scheme example -parallelizeTargets -configuration Debug -derivedDataPath build -UseModernBuildSystem=YES

# To be uncommented as a part of https://github.com/react-native-community/react-native-slider/issues/34
# publish:
Expand All @@ -46,41 +81,27 @@ jobs:
# command: yarn ci:publish

workflows:
test:
slider-full-ci:
jobs:
- checkout_code
- analyse:
- verify:
requires:
- checkout_code
# Disabled until Detox works correctly with 0.60
# - rn/android_build:
# name: build_android_debug
# project_path: "example/android"
# build_type: debug
# requires:
# - analyse
# - rn/android_build:
# name: build_android_release
# project_path: "example/android"
# build_type: release
# requires:
# - analyse
# - rn/android_test:
# detox_configuration: "android.emu.release"
# detox_loglevel: "trace"
# requires:
# - build_android_release
# - rn/ios_build_and_test:
# project_path: "example/ios/example.xcworkspace"
# derived_data_path: "example/ios/build"
# device: "iPhone X"
# build_configuration: "Release"
# scheme: "example"
# detox_configuration: "ios.sim.release"
# detox_loglevel: "trace"
# requires:
# - analyse
# To be uncommented as a part of https://github.com/react-native-community/react-native-slider/issues/34
- test:
requires:
- verify
- build_example_windows:
requires:
- verify
- rn/android_build:
name: build_android_debug
project_path: "example/android"
build_type: debug
requires:
- verify
- build_example_ios:
requires:
- verify
# - publish:
# requires:
# - analyse
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#
.DS_Store

# Windows OS
#
msbuild.binlog

# Xcode
#
build/
Expand Down
13 changes: 13 additions & 0 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,19 @@ task copyDownloadableDepsToLibs(type: Copy) {
into 'libs'
}

task downloadDependencies() {
description 'Download all dependencies to the Gradle cache'
doLast {
configurations.findAll().each { config ->
if (config.name.contains("minReactNative") && config.canBeResolved) {
print config.name
print '\n'
config.files
}
}
}
}

apply from: file("../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle");
// set custom root because we're in a monorepo
applyNativeModulesAppBuildGradle(project)
6 changes: 0 additions & 6 deletions example/e2e/config.json

This file was deleted.

19 changes: 0 additions & 19 deletions example/e2e/init.js

This file was deleted.

3 changes: 0 additions & 3 deletions example/e2e/testCases/example.e2e.js

This file was deleted.

2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"run:web": "expo web"
},
"dependencies": {
"@react-native-community/slider": "^4.0.0-rc.2",
"@react-native-community/slider": "file:../src/",
"babel-preset-expo": "^8.2.1",
"expo": "^37.0.12",
"react-dom": "~16.9.0",
Expand Down
4 changes: 2 additions & 2 deletions example/windows/SliderTestWindows/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

<Identity
Name="sliderExample"
Publisher="CN=igklemen"
Publisher="CN=Bartosz Klonowski"
Version="1.0.0.0" />

<mp:PhoneIdentity PhoneProductId="359e3698-40e8-432a-a406-1213a9404462" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

<Properties>
<DisplayName>SliderTestWindows</DisplayName>
<PublisherDisplayName>igklemen</PublisherDisplayName>
<PublisherDisplayName>BartoszKlonowski</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>

Expand Down
6 changes: 4 additions & 2 deletions example/windows/SliderTestWindows/SliderTestWindows.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.16299.0</WindowsTargetPlatformMinVersion>
<PackageCertificateKeyFile>SliderTestWindows_TemporaryKey.pfx</PackageCertificateKeyFile>
<PackageCertificateThumbprint>2B865F049A8EC254802CBE811120971BD5F2CDB5</PackageCertificateThumbprint>
<WindowsTargetPlatformMinVersion>10.0.16299.0</WindowsTargetPlatformMinVersion>
<PackageCertificateThumbprint>F4D37D3346135805DB0E33DEE0E9A100AB53BE42</PackageCertificateThumbprint>
<PackageCertificatePassword>password</PackageCertificatePassword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
Expand Down Expand Up @@ -146,6 +146,7 @@
<ItemGroup>
<None Include="packages.config" />
<None Include="PropertySheet.props" />
<None Include="SliderTestWindows_TemporaryKey.pfx" />
<Text Include="readme.txt">
<DeploymentContent>false</DeploymentContent>
</Text>
Expand All @@ -158,6 +159,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<PropertyGroup Label="ReactNativeWindowsNodeProps">
<ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
</PropertyGroup>
<ImportGroup Label="ReactNativeWindowsNodeTargets">
<Import Project="$(ReactNativeWindowsDir)PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.props" Condition="Exists('$(ReactNativeWindowsDir)PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.props')" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<ItemGroup>
<None Include="PropertySheet.props" />
<None Include="packages.config" />
<None Include="SliderTestWindows_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<Text Include="readme.txt" />
Expand Down
Binary file not shown.
31 changes: 1 addition & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"jest": {
"preset": "react-native",
"verbose": true,
"modulePathIgnorePatterns": [
"/e2e/"
]
Expand All @@ -19,35 +20,5 @@
"bracketSpacing": false,
"jsxBracketSameLine": true,
"parser": "flow"
},
"detox": {
"test-runner": "jest",
"runner-config": "example/e2e/config.json",
"configurations": {
"ios.sim.debug": {
"binaryPath": "example/ios/build/Build/Products/Debug-iphonesimulator/example.app",
"build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace example/ios/example.xcworkspace -destination 'platform=iOS Simulator,name=iPhone X' -scheme example -parallelizeTargets -configuration Debug -derivedDataPath example/ios/build -UseModernBuildSystem=YES",
"type": "ios.simulator",
"name": "iPhone X"
},
"ios.sim.release": {
"binaryPath": "example/ios/build/Build/Products/Release-iphonesimulator/example.app",
"build": "export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -project example/ios/example.xcworkspace -destination 'platform=iOS Simulator,name=iPhone X' -scheme example -parallelizeTargets -configuration Release -derivedDataPath example/ios/build -UseModernBuildSystem=YES",
"type": "ios.simulator",
"name": "iPhone X"
},
"android.emu.debug": {
"binaryPath": "example/android/app/build/outputs/apk/debug/app-debug.apk",
"build": "export RCT_NO_LAUNCH_PACKAGER=true && pushd example/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && popd",
"type": "android.emulator",
"name": "TestingAVD"
},
"android.emu.release": {
"binaryPath": "example/android/app/build/outputs/apk/release/app-release.apk",
"build": "export RCT_NO_LAUNCH_PACKAGER=true && pushd example/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && popd",
"type": "android.emulator",
"name": "TestingAVD"
}
}
}
}
1 change: 0 additions & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@react-native-community/eslint-config": "0.0.5",
"babel-jest": "^24.9.0",
"babel-plugin-module-resolver": "3.1.3",
"detox": "^18.9.0",
"eslint": "^6.5.1",
"flow-bin": "0.113.0",
"jest": "^24.9.0",
Expand Down
Loading