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;
21
22 import org.apache.maven.plugin.MojoFailureException;
23 import org.apache.maven.plugins.annotations.Parameter;
24 import org.apache.tools.ant.Project;
25
26 import com.github.maven_nar.cpptasks.CUtil;
27 import com.github.maven_nar.cpptasks.types.LibraryTypeEnum;
28 import com.github.maven_nar.cpptasks.types.SystemLibrarySet;
29
30
31
32
33
34
35 public class SysLib {
36
37
38
39 @Parameter(required = true)
40 private String name;
41
42
43
44
45 @Parameter(defaultValue = "shared")
46 private String type = Library.SHARED;
47
48 public final SystemLibrarySet getSysLibSet(final Project antProject) throws MojoFailureException {
49 if (this.name == null) {
50 throw new MojoFailureException("NAR: Please specify <Name> as part of <SysLib>");
51 }
52 final SystemLibrarySet sysLibSet = new SystemLibrarySet();
53 sysLibSet.setProject(antProject);
54 sysLibSet.setLibs(new CUtil.StringArrayBuilder(this.name));
55 final LibraryTypeEnum sysLibType = new LibraryTypeEnum();
56 sysLibType.setValue(this.type);
57 sysLibSet.setType(sysLibType);
58 return sysLibSet;
59 }
60
61 @Override
62 public String toString() {
63 return this.name + " (" + this.type + ")";
64 }
65 }