Closed joprice closed 3 years ago
Could you post your Cakefile
? It looks like you have got some Info.plist
preprocessing set up.
I'm mostly using the defaults, to see what's actually needed by a empty project:
project.name = "scratch"
project.class_prefix = "APP"
application_for :ios, 9.0 do |target|
target.name = "scratch"
target.all_configurations.each { |c| c.product_bundle_identifier = "com.yourcompany.yourapp"}
unit_tests_for target
end
You're right, it looks very concise. Do you mind posting the directory structure? Or, perhaps isolate the issue to a demo project?
Here's a new project generated by xcode with a cakefile added: https://github.com/joprice/cakefile-test
Hah, I see what the problem is. It seems an Xcode bug. Xcake generates the project with the assumption that the Info.plist
is located at ${TARGET_NAME}/Supporting Files/Info.plist
.
In the project you've created, the file is located at ${TARGET_NAME}/Info.plist
. Because this is not the conventional location, the .plist
file is handled as a regular resource file.
Xcode sees that both the resource step and the build config produce the same file, and raises an error. It should have failed in an earlier stage, since ${TARGET_NAME}/Supporting Files/Info.plist
doesn't exist.
You can fix the issue you're experiencing easily by:
project.name = "scratch"
project.class_prefix = "APP"
application_for :ios, 9.0 do |target|
target.name = "scratch"
target.all_configurations.each do |c|
c.product_bundle_identifier = "com.yourcompany.yourapp"
c.settings['INFOPLIST_FILE'] = "scratchpad/Info.plist"
end
unit_tests_for target
end
Alternatively, you could create a Supporting Files
folder under your target and place the Info.plist
there.
I tried that and I'm getting the same error. I removed the tests as well to simplify it further.
My bad, the target is scratchpad
- right? I wrote scratch
because I copied from an earlier comment. Updated the comment to fix.
Oops I had two repos with those names that I was switching between. It works now. Thank you!
I must be missing something else, because the project does not seem to be runnable. I had to edit the scheme and set an executable. That added this new xml block:
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "630E33D4FA80670ADCA7CBE6"
BuildableName = "scratchpad.app"
BlueprintName = "scratchpad"
ReferencedContainer = "container:scratchpad.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Has the scheme format changed in the xcode 12?
Yeah, I looked at it and it seems that Xcode has changed its expectations of schemes, again.
Personally, I use an .xcworkspace
and keep my schemes in it (without generation by Xcake). These files aren't large and change very infrequently, making keeping them in git not too troublesome.
@igor-makarov hey Igor, is there a way to prevent Xcake from creating the xcschemes that it creates by default? I am deleting the generated xcschemes using the after_save
hook but I'm wondering if there's a better way to do that
I tried using this on a new project I created with xcode, but I get the following error: