Search in sources :

Example 31 with PBXProject

use of com.facebook.buck.apple.xcode.xcodeproj.PBXProject in project buck by facebook.

the class XcodeprojSerializerTest method testEmptyProject.

@Test
public void testEmptyProject() {
    PBXProject project = new PBXProject("TestProject");
    XcodeprojSerializer xcodeprojSerializer = new XcodeprojSerializer(new GidGenerator(ImmutableSet.of()), project);
    NSDictionary rootObject = xcodeprojSerializer.toPlist();
    assertEquals(project.getGlobalID(), ((NSString) rootObject.get("rootObject")).getContent());
    NSDictionary objects = ((NSDictionary) rootObject.get("objects"));
    NSDictionary projectObject = (NSDictionary) objects.get(project.getGlobalID());
    String[] requiredKeys = { "mainGroup", "targets", "buildConfigurationList", "compatibilityVersion", "attributes" };
    for (String key : requiredKeys) {
        assertTrue(projectObject.containsKey(key));
    }
}
Also used : NSDictionary(com.dd.plist.NSDictionary) PBXProject(com.facebook.buck.apple.xcode.xcodeproj.PBXProject) NSString(com.dd.plist.NSString) Test(org.junit.Test)

Aggregations

PBXProject (com.facebook.buck.apple.xcode.xcodeproj.PBXProject)31 BuildTarget (com.facebook.buck.model.BuildTarget)27 Test (org.junit.Test)27 PBXTarget (com.facebook.buck.apple.xcode.xcodeproj.PBXTarget)18 FakeSourcePath (com.facebook.buck.rules.FakeSourcePath)18 NSString (com.dd.plist.NSString)14 PBXFileReference (com.facebook.buck.apple.xcode.xcodeproj.PBXFileReference)12 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)12 PBXGroup (com.facebook.buck.apple.xcode.xcodeproj.PBXGroup)11 DefaultBuildTargetSourcePath (com.facebook.buck.rules.DefaultBuildTargetSourcePath)6 Path (java.nio.file.Path)5 PBXReference (com.facebook.buck.apple.xcode.xcodeproj.PBXReference)4 PBXResourcesBuildPhase (com.facebook.buck.apple.xcode.xcodeproj.PBXResourcesBuildPhase)4 PBXShellScriptBuildPhase (com.facebook.buck.apple.xcode.xcodeproj.PBXShellScriptBuildPhase)4 SourceTreePath (com.facebook.buck.apple.xcode.xcodeproj.SourceTreePath)4 PathSourcePath (com.facebook.buck.rules.PathSourcePath)4 SourcePath (com.facebook.buck.rules.SourcePath)3 FrameworkPath (com.facebook.buck.rules.coercer.FrameworkPath)3 NSDictionary (com.dd.plist.NSDictionary)2 PBXHeadersBuildPhase (com.facebook.buck.apple.xcode.xcodeproj.PBXHeadersBuildPhase)2