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

Exclude more file types from resources #94

Merged
merged 1 commit into from
Oct 18, 2017
Merged

Exclude more file types from resources #94

merged 1 commit into from
Oct 18, 2017

Conversation

keith
Copy link
Collaborator

@keith keith commented Oct 17, 2017

Entitlements files, gpx files, explicit lproj directories, and apns test files should
never be included in a target's copy resources phase.

Ideally this would also include files with the plist extension, but
there are some outliers such as AppIntentVocabulary.plist.

Entitlements files, gpx files, and explicit lproj directories should
never be included in a target's copy resources phase.

Ideally this would also include files with the plist extension, but
there are some outliers such as AppIntentVocabulary.plist.
@yonaskolb
Copy link
Owner

Thanks @keith. The lproj directories should already be taken care of when the source directories are parsed, but no harm in adding it here.
Would gpx always be ignored? Wouldn't someone want to sometimes embed some gpx files?

@keith
Copy link
Collaborator Author

keith commented Oct 18, 2017

gpx should be ignored because, unless you're actually trying to vend gpx files to use at runtime, they are only used by Xcode at build time, they don't serve any purpose by being in your final app's resources directory, besides wasting a bit of space.

@yonaskolb
Copy link
Owner

yonaskolb commented Oct 18, 2017

Yeah, but there might be legitimate cases of bundling gpx files within some sort of mapping application. I agree though that in the common case they should be ignored. I'll merge this now and then we'll remove that filetype once we add the ability to exclude file types.

I've added you as a collaborator of the project by the way! 👍
There is also an open slack group where we discuss the development of XcodeGen as well as xcproj and other tools. You can join here if you're interested http://xcodeswift.herokuapp.com/

@yonaskolb yonaskolb merged commit 22b1ba9 into yonaskolb:master Oct 18, 2017
@keith
Copy link
Collaborator Author

keith commented Oct 18, 2017

Awesome thanks! Yea I think this is less important to have once exclude is supported, but for now it's nice to not have the unexpected files in your final product. Awesome I'll join!

@keith keith deleted the ks/resource-files branch October 18, 2017 16:27
@daltonclaybrook
Copy link
Contributor

We use GPX files as resources in one of our test bundles to test some routing functionality, so we need these files to be part of the copy resources phase for that target. Is there a workaround I can use to support my use-case?

@yonaskolb
Copy link
Owner

yonaskolb commented Mar 5, 2020

Hi @daltonclaybrook, this is possible by explicitly specifying the build phase for those files in a seperate target source definition.
Target sources are generated in order, and if a source file has already been generated it will use that when referenced later. You can use this to customise certain files with includes:

Target:
  sources:
    - includes: [**/*.gpx]
      path: Target
      buildPhase: resources
    - path: Target

(Note this was written on my phone, so hopefully works)

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

Successfully merging this pull request may close these issues.

3 participants