Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document import_from_gem #1157

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
19 changes: 19 additions & 0 deletions docs/advanced/Fastfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,25 @@ end

This will also automatically import all the local actions from this repo.


rogerluan marked this conversation as resolved.
Show resolved Hide resolved
## `import_from_gem`

Import from another ruby gem, which you can use to create a single package with common `Fastfile`s and actions for all your projects.
rogerluan marked this conversation as resolved.
Show resolved Hide resolved

```ruby
import_from_gem(gem_name: 'my_gem')
# or
import_from_gem(gem_name: 'my_gem',
paths: ['fastlane/Fastfile', 'fastlane/Fastfile_*'])
Comment on lines +124 to +125
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh weird indentation? 👀 Can we do e.g.:

Suggested change
import_from_gem(gem_name: 'my_gem',
paths: ['fastlane/Fastfile', 'fastlane/Fastfile_*'])
import_from_gem(gem_name: 'my_gem', paths: ['fastlane/Fastfile', 'fastlane/Fastfile_*'])

or

Suggested change
import_from_gem(gem_name: 'my_gem',
paths: ['fastlane/Fastfile', 'fastlane/Fastfile_*'])
import_from_gem(
gem_name: 'my_gem',
paths: ['fastlane/Fastfile', 'fastlane/Fastfile_*'],
)

or

Suggested change
import_from_gem(gem_name: 'my_gem',
paths: ['fastlane/Fastfile', 'fastlane/Fastfile_*'])
import_from_gem(gem_name: 'my_gem', paths: [
'fastlane/Fastfile',
'fastlane/Fastfile_*',
])

? 🙈

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intended indentation might've been this:

Suggested change
import_from_gem(gem_name: 'my_gem',
paths: ['fastlane/Fastfile', 'fastlane/Fastfile_*'])
import_from_gem(gem_name: 'my_gem',
paths: ['fastlane/Fastfile', 'fastlane/Fastfile_*'])

But I'm not a fan, hence why I suggested the 3 others above 😂 I'd pick the first one because I don't care much about horizontal line length, but the others are fine too


lane :new_main_lane do
# ...
end
```

This will also automatically import all the local actions from this gem.


rogerluan marked this conversation as resolved.
Show resolved Hide resolved
## Note

You should import the other `Fastfile` on the top above your lane declarations. When defining a new lane _fastlane_ will make sure to not run into any name conflicts. If you want to overwrite an existing lane (from the imported one), use the `override_lane` keyword.
Expand Down