Ejemplo n.º 1
0
		public PBXNativeTarget (string name, XCConfigurationList configuration, PBXFileReference target)
		{
			this.name = name;
			this.configuration = configuration;
			this.target = target;
			this.buildphases = new List<XcodeObject> ();
		}
Ejemplo n.º 2
0
		public XcodeProject (string name, string sdkRoot, string configName)
		{
			this.name = name;
			rootGroup = new PBXGroup ("CustomTemplate");
			this.frameworksBuildPhase = new PBXFrameworksBuildPhase ();
			this.resourcesBuildPhase = new PBXResourcesBuildPhase ();
			this.sourcesBuildPhase = new PBXSourcesBuildPhase ();
			this.files = new List<PBXFileReference> ();
			this.sources = new List<PBXBuildFile> ();
			this.groups = new List<PBXGroup> ();
			this.groups.Add (rootGroup);
			
			this.target = new PBXFileReference (name, string.Format ("{0}.app", name), "BUILT_PRODUCTS_DIR");
			this.nativeConfigurationList = new XCConfigurationList ();
			this.projectConfigurationList = new XCConfigurationList ();
			this.nativeBuildConfiguration = new XCBuildConfiguration (configName);
			this.projectBuildConfiguration = new XCBuildConfiguration (configName);
			this.nativeTarget = new PBXNativeTarget (name, nativeConfigurationList, target);
			this.project = new PBXProject (projectConfigurationList, rootGroup);

			nativeBuildConfiguration.AddSetting ("ALWAYS_SEARCH_USER_PATHS", "NO");
			nativeBuildConfiguration.AddSetting ("COPY_PHASE_STRIP", "NO");
			nativeBuildConfiguration.AddSetting ("GCC_DYNAMIC_NO_PIC", "NO");
			nativeBuildConfiguration.AddSetting ("GCC_OPTIMIZATION_LEVEL", "0");
			nativeBuildConfiguration.AddSetting ("GCC_PRECOMPILE_PREFIX_HEADER", "NO");
			nativeBuildConfiguration.AddSetting ("INFOPLIST_FILE", "\"Info.plist\"");
			nativeBuildConfiguration.AddSetting ("PRODUCT_NAME", name);

			this.nativeConfigurationList.AddBuildConfiguration (nativeBuildConfiguration);

			projectBuildConfiguration.AddSetting ("ARCHS", "\"$(ARCHS_STANDARD_32_BIT)\"");
			//projectBuildConfiguration.AddSetting ("\"CODE_SIGN_IDENTITY[sdk=" + sdkRoot + "*]\"", "\"IPhone Developer\"");
			projectBuildConfiguration.AddSetting ("GCC_C_LANGUAGE_STANDARD", "c99");
			projectBuildConfiguration.AddSetting ("GCC_WARN_ABOUT_RETURN_TYPE", "YES");
			projectBuildConfiguration.AddSetting ("GCC_WARN_UNUSED_VARIABLE", "YES");
			projectBuildConfiguration.AddSetting ("PREBINDING", "NO");
			projectBuildConfiguration.AddSetting ("SDKROOT", sdkRoot);
			projectBuildConfiguration.AddSetting ("OTHER_CFLAGS", "\"\"");
			projectBuildConfiguration.AddSetting ("OTHER_LDFLAGS", "\"\"");

			this.projectConfigurationList.AddBuildConfiguration (projectBuildConfiguration);

			this.rootGroup.AddChild (this.target);
			
			this.nativeTarget.AddBuildPhase (frameworksBuildPhase);
			this.nativeTarget.AddBuildPhase (sourcesBuildPhase);
			this.nativeTarget.AddBuildPhase (resourcesBuildPhase);

			this.files.Add (target);
			this.project.AddNativeTarget (nativeTarget);
		}
Ejemplo n.º 3
0
		public void AddResourceDirectory (string name)
		{
			var fileref = new PBXFileReference (name, name, "\"<group>\"");
			files.Add (fileref);
		}
Ejemplo n.º 4
0
		public void AddPlist (string name)
		{
			var fileref = new PBXFileReference (name, name, "\"<group>\"");
			files.Add (fileref);
		}
Ejemplo n.º 5
0
		PBXBuildFile AddFile (string name, string path, string tree)
		{
			var fileref = new PBXFileReference (name, path, tree);
			var buildfile = new PBXBuildFile (fileref);

			files.Add (fileref);
			sources.Add (buildfile);
			group.AddChild (fileref);

			return buildfile;
		}
Ejemplo n.º 6
0
		public XcodeProject (string name, string sdkRoot, string configName)
		{
			this.name = name;

			frameworksGroup = new PBXGroup ("Frameworks", XcodeObjectSortDirection.Descending);
			mainGroup = new PBXGroup (null, XcodeObjectSortDirection.None);
			productsGroup = new PBXGroup ("Products");
			projectGroup = new PBXGroup (name);
			
			this.frameworksBuildPhase = new PBXFrameworksBuildPhase ();
			this.resourcesBuildPhase = new PBXResourcesBuildPhase ();
			this.sourcesBuildPhase = new PBXSourcesBuildPhase ();
			this.files = new List<PBXFileReference> ();
			this.sources = new List<PBXBuildFile> ();
			this.groups = new List<PBXGroup> ();
			
			this.groups.Add (mainGroup);
			this.groups.Add (productsGroup);
			this.groups.Add (frameworksGroup);
			this.groups.Add (projectGroup);

			mainGroup.AddChild (projectGroup);
			mainGroup.AddChild (frameworksGroup);
			mainGroup.AddChild (productsGroup);
			
			this.target = new PBXFileReference (string.Format ("{0}.app", name), "BUILT_PRODUCTS_DIR");
			productsGroup.AddChild (this.target);
			
			this.nativeConfigurationList = new XCConfigurationList ();
			this.projectConfigurationList = new XCConfigurationList ();
			this.nativeBuildConfiguration = new XCBuildConfiguration (configName);
			this.projectBuildConfiguration = new XCBuildConfiguration (configName);
			this.nativeTarget = new PBXNativeTarget (name, nativeConfigurationList, target);
			this.project = new PBXProject (name, projectConfigurationList, mainGroup, productsGroup);

			projectBuildConfiguration.AddSetting ("ALWAYS_SEARCH_USER_PATHS", "NO");
			projectBuildConfiguration.AddSetting ("ARCHS", "\"$(ARCHS_STANDARD_32_BIT)\"");
			//projectBuildConfiguration.AddSetting ("\"CODE_SIGN_IDENTITY[sdk=" + sdkRoot + "*]\"", "\"IPhone Developer\"");
			projectBuildConfiguration.AddSetting ("COPY_PHASE_STRIP", "NO");
			projectBuildConfiguration.AddSetting ("GCC_C_LANGUAGE_STANDARD", "gnu99");
			projectBuildConfiguration.AddSetting ("GCC_DYNAMIC_NO_PIC", "NO");
			projectBuildConfiguration.AddSetting ("GCC_OPTIMIZATION_LEVEL", "0");
			//projectBuildConfiguration.AddSetting ("GCC_PREPROCESSOR_DEFINITIONS", "(\"DEBUG=1\", \"$(inherited)\", )");
			projectBuildConfiguration.AddSetting ("GCC_SYMBOLS_PRIVATE_EXTERN", "NO");
			projectBuildConfiguration.AddSetting ("GCC_VERSION", "com.apple.compilers.llvm.clang.1_0");
			projectBuildConfiguration.AddSetting ("GCC_WARN_ABOUT_MISSING_PROTOTYPES", "YES");
			projectBuildConfiguration.AddSetting ("GCC_WARN_ABOUT_RETURN_TYPE", "YES");
			projectBuildConfiguration.AddSetting ("GCC_WARN_UNUSED_VARIABLE", "YES");
			//projectBuildConfiguration.AddSetting ("IPHONEOS_DEPLOYMENT_TARGET", "5.0");
			projectBuildConfiguration.AddSetting ("OTHER_CFLAGS", "\"\"");
			projectBuildConfiguration.AddSetting ("OTHER_LDFLAGS", "\"\"");
			projectBuildConfiguration.AddSetting ("SDKROOT", sdkRoot);

			this.projectConfigurationList.AddBuildConfiguration (projectBuildConfiguration);

			nativeBuildConfiguration.AddSetting ("GCC_PRECOMPILE_PREFIX_HEADER", "NO");
			//nativeBuildConfiguration.AddSetting ("INFOPLIST_FILE", "\"Info.plist\"");
			nativeBuildConfiguration.AddSetting ("PRODUCT_NAME", name);
			nativeBuildConfiguration.AddSetting ("WRAPPER_EXTENSION", "app");

			this.nativeConfigurationList.AddBuildConfiguration (nativeBuildConfiguration);

			this.nativeTarget.AddBuildPhase (sourcesBuildPhase);
			this.nativeTarget.AddBuildPhase (frameworksBuildPhase);
			this.nativeTarget.AddBuildPhase (resourcesBuildPhase);

			this.files.Add (target);
			this.project.AddNativeTarget (nativeTarget);
		}
Ejemplo n.º 7
0
		PBXBuildFile AddFile (string path, string tree, PBXGroup grp = null)
		{
			var fileref = new PBXFileReference (path, tree);
			var buildfile = new PBXBuildFile (fileref);

			files.Add (fileref);
			sources.Add (buildfile);
			if (grp == null) {
				grp = projectGroup;
				
				var parts = path.Split (new [] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries);
				for (int i = 0; i < parts.Length - 1; i ++)
					grp = (PBXGroup) (grp.GetGroup (parts [i]) ?? AddGroup (grp, parts [i]));
			}
			
			grp.AddChild (fileref);

			return buildfile;
		}
Ejemplo n.º 8
0
		PBXBuildFile AddFile (string name, string path, string tree, PBXGroup grp = null)
		{
			var fileref = new PBXFileReference (name, path, tree);
			var buildfile = new PBXBuildFile (fileref);

			files.Add (fileref);
			sources.Add (buildfile);
			(grp ?? this.rootGroup).AddChild (fileref);

			return buildfile;
		}
Ejemplo n.º 9
0
		public PBXBuildFile (PBXFileReference fileRef)
		{
			this.fileRef = fileRef;
		}
Ejemplo n.º 10
0
		public void AddChild (PBXFileReference file)
		{
			this.children.Add (file);
		}
Ejemplo n.º 11
0
 public PBXBuildFile(PBXFileReference fileRef)
 {
     this.fileRef = fileRef;
 }
Ejemplo n.º 12
0
		public PBXBuildFile (PBXFileReference fileRef)
		{
			FileReference = fileRef;
		}
Ejemplo n.º 13
0
		public void AddPlist (string path)
		{
			var fileref = new PBXFileReference (path, "\"<group>\"");
			files.Add (fileref);
		}
Ejemplo n.º 14
0
		public void AddResource (string path, PBXGroup grp = null)
		{
			string dir = Path.GetDirectoryName (path);
			PBXBuildFile buildFile;
			
			if (dir.EndsWith (".lproj")) {
				string name = Path.GetFileName (path);
				PBXVariantGroup variant = GetGroup (name) as PBXVariantGroup;
				
				if (variant == null) {
					variant = new PBXVariantGroup (name);
					groups.Add (variant);
					
					if (grp == null)
						projectGroup.AddChild (variant);
					else
						grp.AddChild (variant);
					
					buildFile = new PBXBuildFile (variant);
					resourcesBuildPhase.AddResource (buildFile);
				}
				
				string lang = dir.Substring (0, dir.LastIndexOf ('.'));
				project.KnownRegions.Add (lang);
				
				var fileref = new PBXFileReference (path, "\"<group>\"");
				variant.AddChild (fileref);
				files.Add (fileref);
			} else {
				if (grp == null)
					grp = CreateGroupFromPath (path);
				
				buildFile = AddFile (path, "\"<group>\"", grp);
				resourcesBuildPhase.AddResource (buildFile);
			}
		}