5
// Geoff Norton <gnorton@novell.com>
6
// Jeffrey Stedfast <jeff@xamarin.com>
8
// Copyright (c) 2011 Novell, Inc.
9
// Copyright (c) 2011 Xamarin Inc.
11
// Permission is hereby granted, free of charge, to any person obtaining a copy
12
// of this software and associated documentation files (the "Software"), to deal
13
// in the Software without restriction, including without limitation the rights
14
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
// copies of the Software, and to permit persons to whom the Software is
16
// furnished to do so, subject to the following conditions:
18
// The above copyright notice and this permission notice shall be included in
19
// all copies or substantial portions of the Software.
21
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31
using System.Collections.Generic;
33
namespace MonoDevelop.MacDev.XcodeIntegration
35
class PBXNativeTarget : XcodeObject
37
XCConfigurationList configuration;
38
List<XcodeObject> buildphases;
40
PBXFileReference target;
42
public PBXNativeTarget (string name, XCConfigurationList configuration, PBXFileReference target)
45
this.configuration = configuration;
47
this.buildphases = new List<XcodeObject> ();
49
configuration.Target = this;
52
public override string Name {
56
public override XcodeType Type {
58
return XcodeType.PBXNativeTarget;
62
public void AddBuildPhase (XcodeObject phase)
64
buildphases.Add (phase);
67
public override string ToString ()
69
var sb = new StringBuilder ();
71
sb.AppendFormat ("{0} /* {1} */ = {{\n", Token, name);
72
sb.AppendFormat ("\t\t\tisa = {0};\n", Type);
73
sb.AppendFormat ("\t\t\tbuildConfigurationList = {0} /* {1} */;\n", configuration.Token, configuration.Name);
74
sb.AppendFormat ("\t\t\tbuildPhases = (\n");
75
foreach (XcodeObject xco in buildphases)
76
sb.AppendFormat ("\t\t\t\t{0} /* {1} */,\n", xco.Token, xco.Name);
77
sb.AppendFormat ("\t\t\t);\n");
78
sb.AppendFormat ("\t\t\tbuildRules = (\n");
79
sb.AppendFormat ("\t\t\t);\n");
80
sb.AppendFormat ("\t\t\tdependencies = (\n");
81
sb.AppendFormat ("\t\t\t);\n");
82
sb.AppendFormat ("\t\t\tname = \"{0}\";\n", name);
83
sb.AppendFormat ("\t\t\tproductName = \"{0}\";\n", name);
84
sb.AppendFormat ("\t\t\tproductReference = {0} /* {1} */;\n", target.Token, target.Name);
85
sb.AppendFormat ("\t\t\tproductType = \"com.apple.product-type.application\";\n");
86
sb.AppendFormat ("\t\t}};");
88
return sb.ToString ();