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); }
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); }