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

deliver cannot generate ipa due to wrong path #11

Closed
nandodelauni opened this issue Jan 22, 2015 · 16 comments
Closed

deliver cannot generate ipa due to wrong path #11

nandodelauni opened this issue Jan 22, 2015 · 16 comments

Comments

@nandodelauni
Copy link

I've forked fastlane trying to integrate Crashlytics distribution action but I am not able to test it because seems that deliver cannot find the proper path to the project:

Miguels-MacBook-Air-6:chicisimo miguel$ ../Desktop/fastlane/bin/fastlane beta --trace
INFO [2015-01-22 00:12:08.57]: Driving the lane 'beta'
INFO [2015-01-22 00:12:08.57]: Step: sigh
INFO [2015-01-22 00:12:11.50]: Login into iOS Developer Center
INFO [2015-01-22 00:12:26.90]: Login successful
INFO [2015-01-22 00:12:27.79]: Fetching all available provisioning profiles...
INFO [2015-01-22 00:12:28.80]: Checking if profile is available. (15 profiles found)
INFO [2015-01-22 00:12:36.85]: Downloading profile...
INFO [2015-01-22 00:12:38.08]: Successfully downloaded provisioning profile
INFO [2015-01-22 00:12:38.08]: Exported provisioning profile to '/path/to/certificate.mobileprovision'
INFO [2015-01-22 00:12:38.08]: [SHELL COMMAND]: open '/path/to/certificate.mobileprovision'
INFO [2015-01-22 00:12:38.15]: Step: deliver
error: The directory /Users/miguel/chicisimo/fastlane does not contain an Xcode project or workspace.. Use --trace to view backtrace

The project is in /Users/miguel/chicisimo and I don't see any configuration to change this. Can you bring some light?

Thanks!

@nandodelauni nandodelauni changed the title deliver cannot generate ipa due to path deliver cannot generate ipa due to wrong path Jan 22, 2015
@KrauseFx
Copy link
Member

@nandodelauni thanks for implementing Crashlytics Beta.

You haven't posted your Deliverfile. I assume you're using shenzhen for building? If so, the ipa block in your Deliverfile should look like this:

ipa do
  system("cd ..; ipa build")
  "../file_name.ipa"
end

@KrauseFx
Copy link
Member

Oh, why are you running deliver anyway? You can disable deliver in your Fastfile.

To create a new action, check out this part of the README.

@nandodelauni
Copy link
Author

Thanks! I was using deliver in order to generate the ipa. I know that deliver is intented to stuff related with metadata in iTunes connect, there is another way to generate the ipa file? This is my lane:

lane :beta do
  sigh
  deliver :skip_deploy, :beta
  crashlytics(api_token:"...", build_secret:"...", groups:"...")
end

In my crashlytics.rb implementation (yep I am using shenzhen, same approach as hockey.rb) I am using the ENV variables for the ipa path but I am not sure if this approach is good :S

@KrauseFx
Copy link
Member

Can you share your Deliverfile as well please?

@nandodelauni
Copy link
Author

Sorry. I was using the template and only modified the beta_ipa:

beta_ipa do
    system("cd ..; ipa build -s Heisy --verbose") # customize this to build beta version
    "./ad_hoc_build.ipa" # upload ipa file using `deliver --beta`
end

You can find the implementation for crashlytics.rb here:
https://github.com/chicisimo/fastlane/blob/crashlytics/lib/fastlane/actions/crashlytics.rb

@KrauseFx
Copy link
Member

Replace
"./ad_hoc_build.ipa"
with
"../ad_hoc_build.ipa"

@nandodelauni
Copy link
Author

I have been trying out and that's not what I want, I just want deliver to generate the ipa file in order to populate ENV["DELIVER_IPA_PATH"] (for crashlytics.rb) but I don't see any option for that

@ergunkocak
Copy link

Could not find project folder i replaced :
system("ipa build --verbose") # build your project using Shenzhen
with
system("cd ..; ipa build --verbose") # build your project using Shenzhen

PS : tnx for great project 👍

@KrauseFx
Copy link
Member

@nandodelauni sorry for the late reply.

deliver's job is not to build your ipa file. Take a look at the Hockey Implementation: hockey.rb:25

The user of the hockey action needs to pass the path to the ipa file to use. I recommend using shenzhen to build your app. (ipa build)

I took a look at your good, it's a great start, but I'd recommend changing the following:

def self.assert_valid_ipa_path!(ipa_path)
  return if File.exists?(ipa_path)
  raise "IPA file on path '#{File.expand_path(ipa_path)}' not found".red
end

to

raise "IPA file on path '#{File.expand_path(ipa_path)}' not found".red unless File.exists?(ipa_path)

without having a method for each assert.

To come back to the original question: Remove deliver from your Fastfile, since it's only used to upload builds and metadata to iTunes Connect, which you don't want to do.

Does that make sense?

@nandodelauni
Copy link
Author

Totally. Closing this. I hope to make a PR with crashlytics soon :)

@KrauseFx
Copy link
Member

@nandodelauni So, you're still working on this? If not, I'd add the Crashlytics action

@nandodelauni
Copy link
Author

yep, let me come back to you late on the day

@KrauseFx
Copy link
Member

Thanks, looking forward to it 👍

@pedrogimenez
Copy link
Contributor

Hey!

I've just read your comment, I prefer to have one level of abstraction per method and I think that the guard clause makes the code more idiomatic:

def self.assert_valid_ipa_path!(ipa_path)
  return if File.exists?(ipa_path)
  raise "IPA file on path '#{File.expand_path(ipa_path)}' not found".red
end

Also, I don't like statement modifiers at the end of long lines.

without having a method for each assert.

As it is the methods have only one reason to change, If I put all the asserts in the same method there will be multiple reasons for the method to change.

@nandodelauni
Copy link
Author

@KrauseFx my colleague @pedrogimenez is opening a PR with Crashlytics support :)

@KrauseFx
Copy link
Member

Great! 👍

KrauseFx pushed a commit that referenced this issue Mar 7, 2016
Change KrauseFx references to fastlane
KrauseFx pushed a commit that referenced this issue Mar 7, 2016
Change KrauseFx references to fastlane
KrauseFx pushed a commit that referenced this issue Mar 7, 2016
Allow specifying device (by serial number or other qualifier)
@fastlane fastlane locked and limited conversation to collaborators Sep 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants