Closed iby closed 6 years ago
@ianbytchek Hi! Thanks for reporting it. It will be great if you share some sample project in which issue is reproduced.
Also how do you call get_build_number_from_plist
action? Do you use target
parameter? If so, just try to substitute it with scheme
. And let me know about results.
Yes, been using target instead of scheme. Changing to scheme gets this back on track. I used target in first place because was concerned that some schemes have multiple targets.
The issue seems to be with using $(TARGET_NAME)
in INFOPLIST_FILE
. It works fine with $(inherited)
though. Have a feeling this is universal, but if not, try this with CotEditor:
platform :mac do
lane :foo do |options|
version = get_build_number_from_plist(xcodeproj: "CotEditor/CotEditor.xcodeproj", target: 'CotEditor')
puts version
end
end
INFOPLIST_FILE
from CotEditor-Info.plist
to $(TARGET_NAME)-Info.plist
.Run from project dir: bundle exec fastlane mac foo
:
INFOPLIST_FILE
to original value or use scheme
instead of target
and everything works:
@SiarheiFedartsou wondering if this can receive any love? Can I help with anything to make this move forward?
@ianbytchek Sorry, I cannot promise, but will try to check it at one of the coming weekends.
@ianbytchek Do you really need to use variables in plist path? And why don't you want to use scheme
instead of target
?
The main issue with target
is that we use xcodeproj
gem to find INFOPLIST_FILE value and there is no obvious way to force xcodeproj
to resolve $()-shape variables. At least I didn't find it :(
We can resolve it at our side, but I think we can only support restricted subset of such variables.
Do you really need to use variables in plist path?
Yes, I have more than a few projects using this with default config based on xcconfigs – it's consistent, logical and organised, I'm happy with it.
And why don't you want to use scheme instead of target?
That's what I do as a workaround and it works. I've originally built all fastlane scripts around target
parameter – most importantly it is very explicit, but also scheme for target may not exists, scheme can build multiple targets, etc. Theoretically speaking, there might be situations, where it's not going to work, in practice, I don't imagine a lot of such cases. Not with my workflow anyway.
The main issue with target is that we use xcodeproj gem to find INFOPLIST_FILE value and there is no obvious way to force xcodeproj to resolve $()-shape variables. At least I didn't find it :( We can resolve it at our side, but I think we can only support restricted subset of such variables.
I remember looking into this back September, yes, issue was somewhere deeper, but I was under impression that xcproject does resolve them, after all, it works with scheme
and I believe I found actual evidence, but not gonna claim on this. If it doesn't, then this definitely shouldn't be fixed in this repo and the issue should be closed. Thanks for looking into this! 🤜🤛
Since version 0.2.6 I'm getting this exception with macOS target. It used to happen with 0.2.7 and I remember coming across a similar issue somewhere, apparently it was different. When I revert to 0.2.6, everything works.