Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add XCVersionGroup support for xcdatamodeld files. Closes #21 #22

Merged
merged 1 commit into from

2 participants

Yury Korolev Eloy Durán
Yury Korolev

No description provided.

Eloy Durán
Owner

Awesome. Thanks!

Do you care for push access?

Eloy Durán alloy merged commit 11d8450 into from
Yury Korolev

Thanks, but I think it is too early for push access %)

Small fix for this PR

Eloy Durán
Owner

Ok, well, let me know when you feel up for it. It’s not meant as a responsibility burden, but just for faster turnaround time :)

Yury Korolev

ok, then %)

Thanks again

Eloy Durán
Owner

Just pushed 0.3.1.

ok, then %)

It’s not completely clear to me if you do or don’t want access at this moment :)

Yury Korolev

Yes, I want push access.

Eloy Durán
Owner

Done.

Yury Korolev

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 13, 2012
  1. Yury Korolev
This page is out of date. Refresh to see the latest.
17 lib/xcodeproj/project/object/group.rb
View
@@ -92,11 +92,28 @@ def create_group(name)
groups.new("name" => name)
end
+ def version_groups
+ children.list_by_class(XCVersionGroup)
+ end
+
def <<(child)
children << child
end
end
+ class XCVersionGroup < PBXGroup
+
+ attribute :version_group_type
+ attribute :current_version
+
+ def self.new_xcdatamodel_group(project, xcdatamodel_path)
+ group = new(project, nil, 'versionGroupType' => 'wrapper.xcdatamodel')
+ ref = group.files.new('path' => xcdatamodel_path.gsub(/xcdatamodeld$/, 'xcdatamodel'), 'sourceTree' => '<group>', 'lastKnownFileType' => 'wrapper.xcdatamodel')
+ group.current_version = ref.uuid
+ group
+ end
+ end
+
end
end
end
17 spec/project/object/group_spec.rb
View
@@ -102,6 +102,23 @@ module ProjectSpecs
@target.source_build_phases.first << file
@group.source_files.should == [file]
end
+
+ it "adds XCVersionGroups" do
+ group = @group.version_groups.new 'versionGroupType' => 'wrapper.xcdatamodel'
+ group.isa.should == 'XCVersionGroup'
+ group.version_group_type.should == 'wrapper.xcdatamodel';
+ end
+ end
+
+ describe "Xcodeproj::Project::Object::XCVersionGroup" do
+ before do
+ @group = @project.groups.new('name' => 'Resources')
+ end
+
+ it "adds xcdatamodel groups" do
+ version_group = @group.version_groups.new_xcdatamodel_group 'Model.xcdatamodeld'
+ version_group.current_version.should == @project.files.last.uuid
+ end
end
end
Something went wrong with that request. Please try again.