From 29a4aa114462e569281e8f821cb67506f629c5e8 Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Tue, 1 Dec 2009 16:43:55 +0100 Subject: Fixed NAR-26 --- src/main/java/org/apache/maven/plugin/nar/Library.java | 14 +++++++++++++- .../java/org/apache/maven/plugin/nar/NarCompileMojo.java | 6 ++++++ .../org/apache/maven/plugin/nar/NarTestCompileMojo.java | 6 ++++++ 3 files changed, 25 insertions(+), 1 deletion(-) (limited to 'src/main/java/org/apache/maven') diff --git a/src/main/java/org/apache/maven/plugin/nar/Library.java b/src/main/java/org/apache/maven/plugin/nar/Library.java index 3f5588a..f819a65 100644 --- a/src/main/java/org/apache/maven/plugin/nar/Library.java +++ b/src/main/java/org/apache/maven/plugin/nar/Library.java @@ -50,7 +50,14 @@ public class Library * @parameter expression="" */ private String type = SHARED; - + + /** + * Type of subsystem to generate: "gui", "console", "other". Defaults to "console". + * + * @parameter expression="" + */ + private String subSystem = "console"; + /** * Link with stdcpp if necessary Defaults to true. * @@ -163,4 +170,9 @@ public class Library sb.append( getType() ); return sb.toString(); } + + public String getSubSystem() + { + return subSystem; + } } diff --git a/src/main/java/org/apache/maven/plugin/nar/NarCompileMojo.java b/src/main/java/org/apache/maven/plugin/nar/NarCompileMojo.java index f773211..47f6dd4 100644 --- a/src/main/java/org/apache/maven/plugin/nar/NarCompileMojo.java +++ b/src/main/java/org/apache/maven/plugin/nar/NarCompileMojo.java @@ -33,6 +33,7 @@ import net.sf.antcontrib.cpptasks.CompilerDef; import net.sf.antcontrib.cpptasks.LinkerDef; import net.sf.antcontrib.cpptasks.OutputTypeEnum; import net.sf.antcontrib.cpptasks.RuntimeType; +import net.sf.antcontrib.cpptasks.SubsystemEnum; import net.sf.antcontrib.cpptasks.types.LibrarySet; import net.sf.antcontrib.cpptasks.types.LinkerArgument; import net.sf.antcontrib.cpptasks.types.SystemLibrarySet; @@ -121,6 +122,11 @@ public class NarCompileMojo // configure task CCTask task = new CCTask(); task.setProject( antProject ); + + // subsystem + SubsystemEnum subSystem = new SubsystemEnum(); + subSystem.setValue( library.getSubSystem() ); + task.setSubsystem( subSystem ); // set max cores task.setMaxCores( getMaxCores( getAOL() ) ); diff --git a/src/main/java/org/apache/maven/plugin/nar/NarTestCompileMojo.java b/src/main/java/org/apache/maven/plugin/nar/NarTestCompileMojo.java index 70fcd8b..d59cc0a 100644 --- a/src/main/java/org/apache/maven/plugin/nar/NarTestCompileMojo.java +++ b/src/main/java/org/apache/maven/plugin/nar/NarTestCompileMojo.java @@ -29,6 +29,7 @@ import net.sf.antcontrib.cpptasks.CUtil; import net.sf.antcontrib.cpptasks.CompilerDef; import net.sf.antcontrib.cpptasks.OutputTypeEnum; import net.sf.antcontrib.cpptasks.RuntimeType; +import net.sf.antcontrib.cpptasks.SubsystemEnum; import net.sf.antcontrib.cpptasks.types.LibrarySet; import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum; @@ -77,6 +78,11 @@ public class NarTestCompileMojo CCTask task = new CCTask(); task.setProject( antProject ); + // subsystem + SubsystemEnum subSystem = new SubsystemEnum(); + subSystem.setValue( "console" ); + task.setSubsystem( subSystem ); + // outtype OutputTypeEnum outTypeEnum = new OutputTypeEnum(); outTypeEnum.setValue( Library.EXECUTABLE ); -- cgit v1.2.3