Skip to content
This repository has been archived by the owner on Dec 29, 2020. It is now read-only.

feat(build): REM-25979 Use shared build config #34

Merged
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
6 changes: 6 additions & 0 deletions fastlane/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
REM_FL_TESTS_SCHEME=Tests
REM_FL_TESTS_DEVICE=iPhone 8
REM_FL_TESTS_PROJECT=./RPerformanceTracking.xcodeproj
REM_FL_TESTS_WORKSPACE=./RPerformanceTracking.xcworkspace
REM_FL_TESTS_SLATHER_BASENAME=RPerformanceTracking
REM_FL_PODSPEC_FILE=RPerformanceTracking.podspec
81 changes: 4 additions & 77 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,8 @@
opt_out_usage
default_platform :ios
# Import base_config from git
import_from_git(url: 'https://github.com/rakutentech/ios-buildconfig.git')

platform :ios do
before_all do
xcversion(
version: ">= 8.0"
)
end

desc 'Run all the tests'
lane :tests do |options|
cocoapods
scan(
clean: true,
skip_build: true,
output_directory: './artifacts/unit-tests',
scheme: 'Tests',
device: 'iPhone 8',
code_coverage: true
)

slather(
output_directory: './artifacts/coverage',
scheme: 'Tests',
cobertura_xml: true,
proj: './RPerformanceTracking.xcodeproj',
workspace: './RPerformanceTracking.xcworkspace',
binary_basename: 'RPerformanceTracking',
ignore: [
'../*',
]
)
end

desc 'CI build'
desc "Build everything"
lane :ci do |options|
# Use env variables to set up config & location endpoints/keys in order
# to keep those items secret
Expand All @@ -46,49 +15,7 @@ platform :ios do
set_info_plist_value(path: "./Tests/HostApp/Info.plist",
key: "RPTSubscriptionKey",
value: ENV['REM_FL_RPT_SUBSCRIPTION_KEY'] || "SUBSCRIPTION_KEY")
tests(options)
shared_tests(options)
end

desc 'Module Pre-Release checks'
lane :release do |options|

release_tag = options[:tag]
module_name = options[:module]
release_branch = options[:branch]


# Remove the newline character from the release_tag otherwise it won't enter into if statement
release_tag = release_tag.to_s.strip

unless release_tag.empty?
if !git_tag_exists(tag: "#{release_tag}")
puts "#{release_tag} version doesn't exist, it will be tagged to master branch and push it to the remote. After the version is tagged, run 'release' lane again"

ensure_git_branch(
branch: "#{release_branch}"
)

add_git_tag(
tag: "#{release_tag}"
)
sh "git push origin #{release_tag}"

end
end

lint(options)

puts "generate documentation for #{module_name} version #{release_tag}"
documentation(
module_name: module_name,
module_version: release_tag
)
end

desc 'Lint the podspec'
lane :lint do |options|
pod_lib_lint(sources: [options[:spec_source], "https://github.com/CocoaPods/Specs"], allow_warnings: true, verbose: false)
end

end
# vim:syntax=ruby:et:sts=2:sw=2:ts=2:ff=unix: