Code Monkey home page Code Monkey logo

xcodeproj's People

Contributors

adamkhazi avatar allcontributors[bot] avatar alvarhansen avatar artemnovichkov avatar briantkelley avatar cognitivedisson avatar damirdavletov avatar dangthaison91 avatar dependabot-preview[bot] avatar dependabot[bot] avatar depfu[bot] avatar drekka avatar fortmarek avatar giginet avatar gubikmic avatar ileitch avatar ilyapuchka avatar keith avatar kwridan avatar llinardos avatar marciniwanicki avatar maxwelle avatar michaeleisel avatar mxcl avatar pepicrft avatar renovate[bot] avatar timbaev avatar toshi0383 avatar turekj avatar yonaskolb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xcodeproj's Issues

Lack of Examples

This project looks like it has great potential and I'm really trying to integrate it into one of my own swift command line tools, but the lack of examples/documentation makes it extremely difficult to use and understand. The README shows how to read and write, but it lacks the most important feature of all in my opinion, modifying components of the project.

Is there any plans to add more examples in the future?
Thanks! ๐Ÿ˜„

Adding files to a PBXGroup

#43 Greatly clarified how to create a new group and add it to an already existing group. However, I am now very uncertain on how to add actual source code files (that are already created) to a group. Is PBXFileElement the object I should be using or is there something else? Any help would be appreciated!

Thanks! ๐Ÿ‘

Creating a PBXGroup

Is it possible to create a new PBXGroup and append it to the Xcode project?

I've tried this:

let project = try! XcodeProj(path: "MyProject.xcodeproj")
let pbxproj = project.pbxproj
let group = PBXGroup(reference: "CustomPBXGroup", children: [], sourceTree: sourceTree)
pbxproj.objects.groups.append(group)

but groups is read only property.

Is there a way to do this?

Add contribution guidelines

Add a document that drives people through the basics of the project:

  • What tools are necessary.
  • How to setup the project.
  • Important things to keep in mind.
  • How to find answers to their questions.

Fully qualified Names of source files

Hey,

sorry if this is the wrong place to ask, but I can't find anything anywhere else.

Is there an option to get the fully qualified name of the sourcefiles? In project.pbxproj.objects I can only find the direct filename.

Thanks

Remove UUID and use String instead

What

Remove UUID typealias and use String instead.

Context

After using it around xcodeproj , I noticed that there's no big advantage on using the typealias instead of String. The purpose of this issue is removing the typealias from the project.

Proposal

  • Replace all usages of UUID with `String.

Mapping error in PBXFileReference section

Context

I tried to parse one of my projects.

What

Simple initialization:

let project = try XcodeProj(path: "ProjectName.xcodeproj")

Related to the error: [UnboxError] An error occurred while unboxing path "fileRef": The key "fileRef" is missing.
As I understand, the problem is here:

0AEBC6F01F2F0F28000441DB /* VideoPickerPageInteractor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoPickerPageInteractor.swift; sourceTree = "<group>"; };

Proposal

Update mapping of PBXFileReference project to handle this case.

Unit testing strategy for writing

Context

We're not currently unit testing the writes of different models. The only test that we have is an integration test that ensures that the project can be read and written to disk. That test doesn't check individually if all the objects that have been written have the right format. This leads to inconsistencies in the read and the written format of the project objects.

By adding unit tests to the writes we could validate the format and prevent inconsistencies between the input/output projects.

What

Think about the strategy that we can take to unit test the objects writes.

Proposal

  • Option 1: Traverse the output dictionary and assert properties individually. Since some comments are generated reading info from the project, this method would require passing a project with valid data for the test. The process of testing can be a bit cumbersome.

Error operation, ignore It.

Context

Provide information that helps with understanding your issue. For example your use case that the project doesn't cover, what you were doing when you found the bug... You can also provide the version of the library that you were using, how you integrated it with your project, the platform version...

What

Describe here your issue, a bug you found, an idea that you had, something that you think can be improved...

Proposal

Attach your own proposal (if you have it). We'll discuss in on the issue to find the best one that fits into the library.

Remove Unbox dependency

Context

After the project has been migrated to Swift 4 we can remove the Unbox dependency and use the language encoding/decoding feature.

What

Use the language encoding/decoding feature instead of Unbox.

Proposal

  • Update all the models that support decoding.

Swift PM error

The current version of xcodeproj doesn't seem to work as a dependency in other Swift PM projects. The current package is only compatible with Xcode 9, but using the swift CI tools from Xcode 9 and referencing xcodeproj as a dependency leads to the error

The product dependency 'xcodepro' was not found

I haven't been able to work out the problem. The branch https://github.com/carambalabs/xcodeproj/tree/feature/single_target tries to solve it by exposing only a single target, but that didn't seem to help.

Support Carthage

Context

Some developers might build a macOS app that leverages xcodeproj. To make the integration easy, you could support Carthage from xcodeproj. Compared to CocoaPods Carthage provides more control for developers and less version screw ups.

What

Support Carthage (dynamic framework necessary)

Proposal

Create xcodeproj as a framework to support Carthage

Cleanup comment generation

Context

There's some duplication in the way comments are generated for ProjectElements. Some of them implement their own private function that generates the comment, finding other elements in the PBXProj model. Here is an example of that kind of functions.

What

Extract these methods, as we already did, and update the models to use these methods instead.

Proposal

  • Check which models are providing their own implementation when the plist dictionary is generated.
  • Move the implementation to the PBXProj model extension.
  • Check out if there's already a similar method that we can reuse.

From structs to classes

Context

All the models in xcodeproj are defined as structs. Although immutability has some advantages like thread safety it makes it forces us to come up with it forces us to extend the interfaces with methods to provide mutated copies of the models with the changes.

You can read more from this issue #43 (comment) that @Daltron reported.

Proposal

Move the project models to classes and clean up the interfaces removing the methods that are not necessary anymore.

Support CocoaPods

Context

Some developers might build a macOS app that leverages xcodeproj. To make the integration easy, we could support CocoaPods from xcodeproj.

What

Support CocoaPods.

Proposal

Support CocoaPods and include the deployment to CocoaPods in the release process

Mutable properties

Since everything is a Struct, should we make all the properties mutable?

  • mutability of a struct can be controlled by using let by whatever contains it, doesn't need to be enforced my it's members
  • makes it easier to change values of properties to edit projects (if allowed by above)
  • removes the need for functions that return a copy (like adding(object:), or removing(object:) functions in PBXProj)
  • no danger of things changing from under you like with Classes, where immutable properties pattern would be useful

Thoughts @pepibumur?

PBXReferenceProxy Support

Context

I tried to parse my project that contains multiple projects for downloadable IAPs

What

Simple initialization:

let project = try XcodeProj(path: "ProjectName.xcodeproj")

PBXReferenceProxy section:

/* Begin PBXReferenceProxy section */
		2E12F4BE1F6665C800E994A6 /* iap2 */ = {
			isa = PBXReferenceProxy;
			fileType = folder;
			path = iap2;
			remoteRef = 2E12F4BD1F6665C800E994A6 /* PBXContainerItemProxy */;
			sourceTree = BUILT_PRODUCTS_DIR;
		};
		2E2578961F6281A20080638D /* unlock.all */ = {
			isa = PBXReferenceProxy;
			fileType = folder;
			path = unlock.all;
			remoteRef = 2E2578951F6281A20080638D /* PBXContainerItemProxy */;
			sourceTree = BUILT_PRODUCTS_DIR;
		};
		2E2A42AF1F613B6000330926 /* iap */ = {
			isa = PBXReferenceProxy;
			fileType = folder;
			path = iap;
			remoteRef = 2E2A42AE1F613B6000330926 /* PBXContainerItemProxy */;
			sourceTree = BUILT_PRODUCTS_DIR;
		};
/* End PBXReferenceProxy section */

Related to the error: The element PBXReferenceProxy is not supported

Proposal

I know that it's a rare case, but anyway ๐Ÿคทโ€โ™‚๏ธ

Unescaped strings in pbxproj

Content that is written to a pbxproj is invalid if certain properties contains spaces or are empty:

For example

name = My cool name;

should be escaped to

name = "My cool name";

Default scripts

I released Carting for adding and updating Carthage script. There are a few scripts using in almost every project, for example, Fabric, Carthage and SwiftLint. What do you think about adding of default scripts for your framework? And maybe I can help you with it.

Generate UUIDs

It would also be nice to:

  • generate reference UUIDs automatically
  • generate them so they are deterministic

Crash when opening Framework

Context

Hey !

First, thanks for your work!

I'm building a project that uses your library to get all the files within a given Xcode project. It works well for getting the information on iOS/macOS projects but it crashed when I try it on Frameworks (e.g. Alamofire).

I'm on macOS 10.12.6 and I'm using the version 0.0.9.

What

When I try to open a Framework, it crashed at this line because the attribute runnableDebuggingMode does not exist.

The function is called on this line and the attribute BuildableProductRunnable passed in parameter does not exist either.

Proposal

I saw on this line that if the value is not present, you set it to "0" by default.

Maybe you could do something like this:

self.runnableDebuggingMode = element.attributes["runnableDebuggingMode"] ?? "0"

Where if the value does not exist, it sets the field to "0". I've tried it on my project and it works with no issue. If you're ok with it, I can do a pull request.

Thanks !

Swift 4 migration

Context

Today the new version of Xcode is officially released together with Swift 4. We should migrate xcodeproj to the new version of Swift, including the Package.swift syntax.

What

Migrate xcodeproj to Swift 4

Proposal

  • Migrate syntax.
  • Migrate dependencies to their Swift 4 versions.

Error in empty project

Context

I tried to parse empty project (Xcode 8 or 9 generated).

What

Simple initialization:

let project = try XcodeProj(path: "ProjectName.xcodeproj")

Related to the error: [UnboxError] An error occurred while unboxing path "defaultConfigurationName": The key "defaultConfigurationName" is missing.

Linux and Crypto

It seems that CommonCrypto is the only holdout for getting this working on Linux. I know that usually anything to do with Xcode probably won't run in a Linux machine but it's still nice to have.

As far as I can see CommonCrypto is only used for getting an md5 of a string that is then used in generateUUID(). A hash function should work fine here as the counter is used to resolve any duplicates

Generation of unique identifiers

What

Find a way to generate unique identifiers for PBXProj objects.

Context

All objects in the PBXProj are uniquely identified. The purpose of this task is coming up with a way of generating those identifiers, making sure that they are unique across the project.

References

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.