1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package com.github.maven_nar.cpptasks.compiler;
21
22 import com.github.maven_nar.cpptasks.OutputTypeEnum;
23 import com.github.maven_nar.cpptasks.SubsystemEnum;
24
25
26
27
28
29
30
31 public class LinkType {
32 private OutputTypeEnum outputType = new OutputTypeEnum();
33 private boolean staticRuntime = false;
34 private SubsystemEnum subsystem = new SubsystemEnum();
35
36
37 private boolean linkCPP = true;
38 private boolean linkFortran = false;
39 private boolean linkFortranMain = false;
40
41
42
43
44
45
46
47
48
49 public LinkType() {
50 }
51
52
53
54
55
56
57 public String getOutputType() {
58 return this.outputType.getValue();
59 }
60
61
62
63
64
65
66 public String getSubsystem() {
67 return this.subsystem.getValue();
68 }
69
70
71
72
73
74
75 public boolean isExecutable() {
76 final String value = this.outputType.getValue();
77 return value.equals("executable");
78 }
79
80 public boolean isJNIModule() {
81 final String value = this.outputType.getValue();
82 return value.equals("jni");
83 }
84
85
86
87
88
89
90 public boolean isPluginModule() {
91 final String value = this.outputType.getValue();
92 return value.equals("plugin");
93 }
94
95
96
97
98
99
100 public boolean isSharedLibrary() {
101 final String value = this.outputType.getValue();
102
103 return value.equals("shared") || value.equals("plugin") || value.equals("jni");
104 }
105
106
107
108
109
110
111 public boolean isStaticLibrary() {
112 final String value = this.outputType.getValue();
113 return value.equals("static");
114 }
115
116
117
118
119
120
121 public boolean isStaticRuntime() {
122 return this.staticRuntime;
123 }
124
125
126
127
128
129
130 public boolean isSubsystemConsole() {
131 final String value = this.subsystem.getValue();
132 return value.equals("console");
133 }
134
135
136
137
138
139
140
141 public boolean isSubsystemGUI() {
142 final String value = this.subsystem.getValue();
143 return value.equals("gui");
144 }
145
146 public boolean linkCPP() {
147 return this.linkCPP;
148 }
149
150 public boolean linkFortran() {
151 return this.linkFortran;
152 }
153
154 public boolean linkFortranMain() {
155 return this.linkFortranMain;
156 }
157
158
159
160
161 public void setLinkCPP(final boolean linkCPP) {
162 this.linkCPP = linkCPP;
163 }
164
165 public void setLinkFortran(final boolean linkFortran) {
166 this.linkFortran = linkFortran;
167 }
168
169 public void setLinkFortranMain(final boolean linkFortranMain) {
170 this.linkFortranMain = linkFortranMain;
171 }
172
173
174
175
176
177
178
179 public void setOutputType(final OutputTypeEnum outputType) {
180 if (outputType == null) {
181 throw new IllegalArgumentException("outputType");
182 }
183 this.outputType = outputType;
184 }
185
186
187
188
189
190
191
192 public void setStaticRuntime(final boolean staticRuntime) {
193 this.staticRuntime = staticRuntime;
194 }
195
196
197
198
199
200
201
202 public void setSubsystem(final SubsystemEnum subsystem) {
203 if (subsystem == null) {
204 throw new IllegalArgumentException("subsystem");
205 }
206 this.subsystem = subsystem;
207 }
208
209 }