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

Multiple target support #8

Closed
nicolaslauquin opened this issue Jan 18, 2015 · 18 comments · Fixed by #28
Closed

Multiple target support #8

nicolaslauquin opened this issue Jan 18, 2015 · 18 comments · Fixed by #28

Comments

@nicolaslauquin
Copy link

First of all, thank you for the great job.

I have an Xcode proj with 8 targets, each apps has its bundleid, appid and languages. In that case, time saved thanks to fastlane would be even more important for me but how to handle this ? For now I have my custom script and I'm thinking to migrate if there is built-in support in fastlane.

I'd like to create some configuration in a centralized file "Appfile" contening all the necessary information and be able to directly call the required one (Note: Appfile and Deliverfile for now look to share some duplicate information like app_identifier).

I found this issue fastlane-old/deliver#67, it is a tips but It won't work for the multiple appstore metadata I think and it is not an official support in "fastlane".

Would you think about such an architecture support ?

Thanks for your help !

@KrauseFx
Copy link
Member

Honestly I don't think it's correct to abuse Xcode targets to be different Apps, which is why I didn't have this in mind when creating fastlane and its tools. Why don't you use different Xcode projects with a shared code base?

Currently the only good solution is to write some Ruby code in your Deliverfile, Fastfile and Appfile to work with all your apps.

@frranck
Copy link

frranck commented Jan 18, 2015

Hi, i'm in the same situation; 1 project with (a lot) of multiple targets. That sounds more easy to maintain to me. (?)

@nicolaslauquin
Copy link
Author

There are many industrial&service scenarios when we have to create multiple target. I would prefer handle simple project but the reality is that we need to use this kind of solution and it si much more efficient to use target in one project and be able to run into the simulator the wanted project by switching scheme than having to close and find&open the corresponding Xcode proj. Also, imagine you have to adapte a class or a xib by target, in one Xcode project it is much more easy to navigate, update and refactor.

Anyway, I don't want to convince you, I just I think there is a need for that kind of support.

@KrauseFx
Copy link
Member

Okay. What kind of solution would you suggest? How would your perfect 'interface' look like for fastlane and its tools?

@nicolaslauquin
Copy link
Author

My vision would be (user point of view):

  • centralize all the configuration into one unique file "App" (so it would take care of the redondant information I mentioned before).
  • keep a default usage configuration so it still work the same but allow to create some specific configuration "AppXXX" (having an extension would be even better to associate it to its favorite edition tool with associate color syntax)
  • then call the action just by be providing the config to load, like heroku command line for ex: fastline deploy --app AppXXX

@KrauseFx
Copy link
Member

To your points

  1. If you init your project, the app_identifier should only be stored in the Appfile. Older versions of deliver also stored it in the Deliverfile, not any more.
  2. Syntax highlighting can easily be enabled (at least on Sublime Text), since the file name is the extension, if there is no real extension
  3. I like that, looks good. This reminds me of this issue: add Support for more then 1 Appfile fastlane-old/credentials_manager#2

@nicolaslauquin
Copy link
Author

  1. I just did a test from scratch and confirm the issue. By doing a fastlane initI got the app_identifier & apple_id stored in Deliverfile and Appfile. I also checked that I'm up to date with fastlane & deliver. If you do not reproduce maybe we can open a new thread for that or I can send you my log by mail.
  2. Ok for one but for multiple config app it wont anymore.
  3. cool :)

@KrauseFx
Copy link
Member

  1. Oh, there must have been an error when merging, it's not there at https://github.com/KrauseFx/deliver/blob/master/lib/assets/DeliverfileExample, but still is at https://github.com/KrauseFx/deliver/blob/master/lib/assets/DeliverfileDefault, I'll push a fix
  2. True, I just followed the convention for Rakefile, Gemfile, Podfile, Makefile, which all don't have an extension

@mhilscher
Copy link

👍

@nicolaslauquin
Copy link
Author

Is this feature available ? Just tested with fastlane 0.7 the default ".env" file is well loaded but using a specific config file ".env.production" is not working:
fastlane inhouse --env production

/Library/Ruby/Gems/2.0.0/gems/fastlane-0.7.0/lib/fastlane/lane_manager.rb:38:in `cruise_lanes': undefined method `overload' for Dotenv:Module (NoMethodError)
    from /Library/Ruby/Gems/2.0.0/gems/fastlane-0.7.0/bin/fastlane:32:in `block (2 levels) in run'
    from /Library/Ruby/Gems/2.0.0/gems/commander-4.3.0/lib/commander/command.rb:179:in `call'

The command is working well with the default config file:
fastlane inhouse

INFO [2015-04-14 17:50:39.74]: -------------------------------------------------
INFO [2015-04-14 17:50:39.74]: --- Step: Verifying required fastlane version ---
INFO [2015-04-14 17:50:39.74]: -------------------------------------------------
INFO [2015-04-14 17:50:39.74]: fastlane version valid
INFO [2015-04-14 17:50:39.74]: Driving the lane 'inhouse'
ENV=ENV DEFAULT
INFO [2015-04-14 17:50:39.74]: fastlane.tools finished successfully 🎉

Files are present:

ls -al fastlane/.env*
fastlane/.env
fastlane/.env.development
fastlane/.env.production

Did I missed something? I followed the doc available here : https://github.com/KrauseFx/fastlane/blob/master/docs/Advanced.md

@KrauseFx
Copy link
Member

@joshdholtz did the .env integration, maybe he can help? 😃

@thisiscrazy4
Copy link

@KrauseFx So is it possible to have multiple sets of metadata and screenshots? 1 for each target?

@agassiyzh
Copy link

Thank you for the great job. But I need this feature! I have 63 targets^_^

@KrauseFx
Copy link
Member

@agassiyzh It is possible, have you tried using the env plugin? Do you need help on this? Do you have some Ruby experience?

Maybe @joshdholtz can add a comment on this.

@agassiyzh
Copy link

@KrauseFx Thx, I will try this plugin.

KrauseFx pushed a commit that referenced this issue Mar 7, 2016
Remove the unused reports_generator which was requiring fastimage
@lisbakke
Copy link

For anyone looking to use fastlane with multiple apps in one xcode project:

  1. make separate targets per app

  2. Make separate directories for metadata & screenshots. If you already have the apps in the appstore, run these

deliver download_metadata --metadata_path fastlane/metadata-app1 --app_identifier com.yourcompany.App1

and

deliver download_screenshots --screenshots_path fastlane/screenshots-app1 --app_identifier com.yourcompany.App1

  1. Setup your Fastfile for multiple targets / dirs:
lane :app1_appstore do
  match(type: "appstore",
  app_identifier: "com.yourcompany.App1",
  git_url: "https://github.com/username/repos")

  gym(scheme: "App 1 Scheme")
  deliver(metadata_path: "fastlane/metadata-app1",
   screenshots_path: "fastlane/screenshots-app1",
   app_identifier: "com.yourcompany.App1")
end

lane :app2_appstore do
  match(type: "appstore",
  app_identifier: "com.yourcompany.App2",
  git_url: "https://github.com/username/repos")

  gym(scheme: "App 2 Scheme")
  deliver(metadata_path: "fastlane/metadata-app2",
   screenshots_path: "fastlane/screenshots-app2",
   app_identifier: "com.yourcompany.App2")
end

@drosenstark
Copy link

Thanks to this plug you can now update the plists directly for version numbers and build: https://github.com/SiarheiFedartsou/fastlane-plugin-versioning

I'm using it like this (inside a lane):

      increment_build_number_in_plist(
        build_number: Time.now.strftime("%Y%m%d%H%M"),
        target: 'Lite'
      )

and I have one of those per lane (I'm just learning this stuff... I imagine I could DRY it out somehow?)

Big shout out to @SiarheiFedartsou for providing this necessary plug. Cool stuff, thank you!

@fastlane fastlane locked and limited conversation to collaborators Dec 22, 2016
@KrauseFx
Copy link
Member

For people coming from Google, check out the Guide to use fastlane for apps with multiple targets.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants