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

Commit

Permalink
Migrate fastlane to be a mono gem (fastlane#7436)
Browse files Browse the repository at this point in the history
* Remove license files from sub-directories

* Remove version files from sub-directories

* Remove gemspecs

* Remove Gemfiles

* Migrate executables

* Update root rake files

* Add new bin dir

* Version bump

* New gemspec

* Add proxy for all tools

* Show warning in bin proxy

* Add explicit names to all tools

* Restore fastlane executable

* Fix fastlane bin stub

* Change all versions to use the fastlane version

* Add spaceship playground support

* Fix code style

* Update rspec dependency

* Move out ::DESCRIPTION into main module definition

* Remove watchbuild from main repo

* Remove danger device grid plugin

* Add plugins to fastlane

* Move description back to fastlane version.rb

Otherwise all of fastlane will have to be pulled in just to include version information

* Command generator for spaceship / fix spaceship executable for monogem (fastlane#7479)

* implement commands_generator for spaceship

* Remove watchbuild

* Fix for spaceauth executable

* Pass parrameter list to exec

Otherwise `spaceauth -u [email protected]` thinks `-u [email protected]` is a single param

* Add comment to explain  exec invocation

* Add fastlane-credentials bin

* Update install instructions to use `fastlane` instead of other gems (fastlane#7496)

* Update install instructions to use `fastlane` instead of other gems

* Update snapshot, sigh, match and gym instructions for mono gem

* Update supply, spaceship, screengrab, scan, produce and pilot usage instructions

* Update pem and gym instructions

* Update readmes

* Refactor mono gem tests to be mono also (fastlane#7478)

Refactor mono gem tests to be mono also

* Improve wording of binary error message

* Add support for emoji binaries

* Update update_fastlane action to only update the fastlane gem

* Add new `exclude` option to `ensure_no_debug_code` action

* Update the fastlane deployment pipline to work with the mono gem

* Fix `fastlane bump` for mono gem

* Add Pluginfile

* Update persistence file path for failed rspec tests

* Update auto-rubocop-config copy script for fastlane plugins

* Improve fastlane dependencies

* Add comment to plugin’s default gemspec to avoid circular dependencies

* Fix shell escaping for parameters with space

* Fix snapshot report generation

This was still using the old API to fetch an asset file

* Add missing dotenv dependency

* Enable fastlane releases

* Simplify json dependency

* Remove binary proxies for initial fastlane 2.0 release

* Update tests for fastlane version with no binaries for sub-tools

* Fix code style

* Add rb-readline as development dependency to fix pry issues

* Use rake to run tests

* Version bump

* [fastlane] Version bump

* Fix action collector specs
  • Loading branch information
KrauseFx authored Dec 15, 2016
1 parent a43a210 commit 6649d0d
Show file tree
Hide file tree
Showing 362 changed files with 1,676 additions and 4,869 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Thanks for contributing to _fastlane_! Before you submit your pull request, please make sure to check the following boxes:

- [ ] Run `bundle exec rspec` from the subdirectory of each tool you modified. Alternatively, run `rake test_all` from the root directory.
- [ ] Run `bundle exec rspec` from the root directory.
- [ ] Run `bundle exec rubocop -a` to ensure the code style is valid
- [ ] Read the [Contribution Guidelines](https://github.com/fastlane/fastlane/blob/master/CONTRIBUTING.md)
- [ ] We currently don't accept new actions, please publish a plugin instead, more information in [Plugins.md](https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Plugins.md)
Expand Down
8 changes: 7 additions & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
--color --require spec_helper --format d
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

--require ./spec_helper
--color
--format d
19 changes: 3 additions & 16 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
source "https://rubygems.org"

# Needed for CI
gem "danger", "~> 0.10"
gemspec path: "."

# Local fastlane, important to be included using `gemspec`, as this will
# also include development dependencies
gemspec path: File.join(Dir.pwd, "fastlane")

plugins_path = File.join(Dir.pwd, 'fastlane', 'fastlane', 'Pluginfile')
eval(File.read(plugins_path), binding) if File.exist?(plugins_path)

# Use the local copy of all tools
require "fastlane/tools.rb"
tools = Fastlane::TOOLS + [:fastlane_core, :credentials_manager]
tools.each do |tool_name|
next if tool_name == :fastlane
gem tool_name.to_s, path: File.join(Dir.pwd, tool_name.to_s)
end
plugins_path = File.join(File.expand_path("..", __FILE__), 'fastlane', 'Pluginfile')
eval(File.read(plugins_path), binding)
59 changes: 4 additions & 55 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,10 @@
require "bundler/gem_tasks"

GEMS = %w(fastlane fastlane_core deliver snapshot frameit pem sigh produce cert gym pilot credentials_manager spaceship scan supply watchbuild match screengrab danger-device_grid)
RAILS = %w(boarding refresher enhancer)

SECONDS_PER_DAY = 60 * 60 * 24

#####################################################
# @!group Everything to be executed in the root folder containing all fastlane repos
#####################################################

desc 'Setup the fastlane development environment'
task :bootstrap do
system('gem install bundler') unless system('which bundle')
Rake::Task[:install].invoke

box 'You are up and running'
end

desc 'Run `bundle update` for all the gems.'
task :bundle do
GEMS.each do |repo|
sh "cd #{repo} && bundle update"
end
end

desc 'Run `bundle update` and `rake install` for all the gems.'
task install: :bundle do
GEMS.each do |repo|
sh "cd #{repo} && rake install"
end
end

task :rubygems_admins do
names = ["KrauseFx", "ohayon", "hemal", "asfalcone", "mpirri", "mfurtak", "milch"]
(GEMS + ["krausefx-shenzhen"]).each do |gem_name|
Expand All @@ -38,35 +14,8 @@ task :rubygems_admins do
end
end

task :update_dependencies do
puts "Updating all internal fastlane dependencies"

# This requires all version numbers to be x.x.x (3 components)
regex = %r{spec.add_dependency .(.+).\, .\>\= (\d+\.\d+\.\d+).\, .\< \d+\.\d+\.\d+.}

Dir["./**/*.gemspec"].each do |current_gemspec_path|
content = File.read(current_gemspec_path)

content.gsub!(regex) do |full_match|
gem_name = $1
current_version_number = Gem::Version.new($2) # used to detect if we actually changed something

version_path = "./#{gem_name}/lib/#{gem_name}/version.rb"
if File.exist?(version_path) && gem_name != "screengrab" # internal dependency
version = Gem::Version.new(File.read(version_path).match(/VERSION.=..(\d+\.\d+\.\d+)./)[1])
next_major_version = Gem::Version.new("#{version.segments[0] + 1}.0.0")

puts "🚀 Updating #{gem_name} from #{current_version_number} to #{version} for #{gem_name}" if version != current_version_number

"spec.add_dependency \"#{gem_name}\", \">= #{version}\", \"< #{next_major_version}\""
else
full_match # external dependency
end
end

puts "✅ Writing to #{current_gemspec_path}"
File.write(current_gemspec_path, content)
end
task :test_all do
sh "rspec --pattern */spec/*_spec.rb"
end

#####################################################
Expand Down
4 changes: 2 additions & 2 deletions RespondingToIssuesAndPullRequests.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Each tool has it’s own label, e.g. `fastlane`, `fastlane_core` and `gym`.
- Repeat the last step for each of the related PRs that the user submitted.
- After checking out a user’s code, you should always make sure that the tests are still working.
- Run `bundle install` to make sure all dependencies are installed
- Use `bundle exec rake test_all` from the _fastlane_ root to run all tests
- Use `bundle exec rspec` in a tool’s directory to run all tests for a specific tool
- Use `bundle exec rspec` from the _fastlane_ root to run all tests
- Use `bundle exec rspec [tool_name]` to run all tests for a specific tool
- Use `bundle exec rubocop -a` to run the linter and autocorrect many of the issues it found

If you have commit access, instead of adding each person's fork as a remote, you can also quickly test a single PR with the following commands:
Expand Down
19 changes: 19 additions & 0 deletions bin/bin-proxy
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env ruby

require "colored"
require "shellwords"

tool_name = File.basename($0)

full_params = ARGV.shelljoin

puts "[WARNING] You are calling #{tool_name} directly. Usage of the tool name without the `fastlane` prefix is deprecated in fastlane 2.0".yellow
puts "Please update your scripts to use `fastlane #{tool_name} #{full_params}` instead.".yellow

exec_arr = ["fastlane", tool_name] + ARGV

# The * turns the array into a parameter list
# This is using the form of exec which takes a variable parameter list, e.g. `exec(command, param1, param2, ...)`
# We need to use that, because otherwise invocations like
# `spaceauth -u [email protected]` would recognize "-u [email protected]" as a single parameter and throw errors
exec(*exec_arr)
File renamed without changes.
7 changes: 0 additions & 7 deletions cert/.rspec

This file was deleted.

3 changes: 0 additions & 3 deletions cert/Gemfile

This file was deleted.

21 changes: 0 additions & 21 deletions cert/LICENSE

This file was deleted.

10 changes: 5 additions & 5 deletions cert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Get in contact with the developers on Twitter: [@FastlaneTools](https://twitter.

**Note**: It is recommended to use [match](https://github.com/fastlane/fastlane/tree/master/match) according to the [codesigning.guide](https://codesigning.guide) for generating and maintaining your certificates. Use `cert` directly only if you want full control over what's going on and know more about codesigning.

sudo gem install cert
sudo gem install fastlane

Make sure, you have the latest version of the Xcode command line tools installed:

Expand All @@ -79,7 +79,7 @@ In the gif I used `cert && sigh`, which will first create an iOS code signing ce

# Usage

cert
fastlane cert

This will check if any of the available signing certificates is installed on your local machine.

Expand All @@ -96,17 +96,17 @@ Only if a new certificate needs to be created, `cert` will

You can pass your Apple ID:

cert -u [email protected]
fastlane cert -u [email protected]

For a list of available commands run

cert --help
fastlane cert --help

Keep in mind, there is no way for `cert` to download existing certificates + private keys from the Apple Developer Portal, as the private key never leaves your computer.

## Environment Variables

Run `cert --help` to get a list of all available environment variables.
Run `fastlane cert --help` to get a list of all available environment variables.

## Use with [`sigh`](https://github.com/fastlane/fastlane/tree/master/sigh)

Expand Down
13 changes: 0 additions & 13 deletions cert/bin/cert

This file was deleted.

39 changes: 0 additions & 39 deletions cert/cert.gemspec

This file was deleted.

1 change: 0 additions & 1 deletion cert/lib/cert.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require 'cert/version'
require 'cert/runner'
require 'cert/options'

Expand Down
5 changes: 1 addition & 4 deletions cert/lib/cert/commands_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@ class CommandsGenerator
include Commander::Methods

def self.start
FastlaneCore::UpdateChecker.start_looking_for_update('cert')
self.new.run
ensure
FastlaneCore::UpdateChecker.show_update_status('cert', Cert::VERSION)
end

def run
program :name, 'cert'
program :version, Cert::VERSION
program :version, Fastlane::VERSION
program :description, 'CLI for \'cert\' - Create new iOS code signing certificates'
program :help, 'Author', 'Felix Krause <[email protected]>'
program :help, 'Website', 'https://fastlane.tools'
Expand Down
4 changes: 2 additions & 2 deletions cert/lib/cert/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def login
def run
FileUtils.mkdir_p(Cert.config[:output_path])

FastlaneCore::PrintTable.print_values(config: Cert.config, hide_keys: [:output_path], title: "Summary for cert #{Cert::VERSION}")
FastlaneCore::PrintTable.print_values(config: Cert.config, hide_keys: [:output_path], title: "Summary for cert #{Fastlane::VERSION}")

login

Expand All @@ -43,7 +43,7 @@ def run

# Command method for the :revoke_expired sub-command
def revoke_expired_certs!
FastlaneCore::PrintTable.print_values(config: Cert.config, hide_keys: [:output_path], title: "Summary for cert #{Cert::VERSION}")
FastlaneCore::PrintTable.print_values(config: Cert.config, hide_keys: [:output_path], title: "Summary for cert #{Fastlane::VERSION}")

login

Expand Down
3 changes: 0 additions & 3 deletions cert/lib/cert/version.rb

This file was deleted.

13 changes: 1 addition & 12 deletions cert/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
require 'coveralls'
Coveralls.wear_merged! unless ENV["FASTLANE_SKIP_UPDATE_CHECK"]

require 'cert'
require 'webmock/rspec'
require 'stubbing.rb'

# This module is only used to check the environment is currently a testing env
module SpecHelper
end

WebMock.disable_net_connect!(allow: 'coveralls.io')
require_relative 'stubbing.rb'
7 changes: 2 additions & 5 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ machine:
version: "7.3"
dependencies:
override:
- rake bundle_install_all
cache_directories:
- ~/.fastlane_bundle
- bundle install --jobs=4 --retry=3
test:
override:
# - bundle exec danger
- bundle exec rake test_all
# - bundle exec danger
- bundle exec rubocop
8 changes: 0 additions & 8 deletions credentials_manager/.rspec

This file was deleted.

3 changes: 0 additions & 3 deletions credentials_manager/Gemfile

This file was deleted.

21 changes: 0 additions & 21 deletions credentials_manager/LICENSE

This file was deleted.

11 changes: 0 additions & 11 deletions credentials_manager/bin/fastlane-credentials

This file was deleted.

Loading

0 comments on commit 6649d0d

Please sign in to comment.