From 8c046e79b56e71bd0a9f3787712963bc2523d8f1 Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Thu, 10 Dec 2009 09:32:49 +0100 Subject: Progress on NAR-21 --- .../apache/maven/plugin/nar/NarValidateMojo.java | 42 ++++++++++++---------- 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'src/main/java/org/apache/maven/plugin/nar/NarValidateMojo.java') diff --git a/src/main/java/org/apache/maven/plugin/nar/NarValidateMojo.java b/src/main/java/org/apache/maven/plugin/nar/NarValidateMojo.java index e299dfb..b303b38 100644 --- a/src/main/java/org/apache/maven/plugin/nar/NarValidateMojo.java +++ b/src/main/java/org/apache/maven/plugin/nar/NarValidateMojo.java @@ -27,7 +27,6 @@ import org.apache.maven.plugin.MojoFailureException; * * @goal nar-validate * @phase validate - * @requiresProject * @author Mark Donszelmann */ public class NarValidateMojo @@ -35,45 +34,52 @@ public class NarValidateMojo { public final void narExecute() throws MojoExecutionException, MojoFailureException - { + { // check aol - AOL aol = getAOL(); + AOL aol = getAOL(); getLog().info( "Using AOL: " + aol ); - + // check linker exists in retrieving the version number - Linker linker = getLinker(); - getLog().debug( "Using linker version: "+linker.getVersion()); - + Linker linker = getLinker(); + getLog().debug( "Using linker version: " + linker.getVersion() ); + // check compilers int noOfCompilers = 0; Compiler cpp = getCpp(); - if (cpp.getName() != null) { + if ( cpp.getName() != null ) + { noOfCompilers++; // need includes - if (cpp.getIncludes( Compiler.MAIN ).isEmpty()) { - throw new MojoExecutionException( "No includes defined for compiler "+cpp.getName() ); + if ( cpp.getIncludes( Compiler.MAIN ).isEmpty() ) + { + throw new MojoExecutionException( "No includes defined for compiler " + cpp.getName() ); } } Compiler c = getC(); - if (c.getName() != null) { + if ( c.getName() != null ) + { noOfCompilers++; // need includes - if (c.getIncludes( Compiler.MAIN ).isEmpty()) { - throw new MojoExecutionException( "No includes defined for compiler "+c.getName() ); + if ( c.getIncludes( Compiler.MAIN ).isEmpty() ) + { + throw new MojoExecutionException( "No includes defined for compiler " + c.getName() ); } } Compiler fortran = getCpp(); - if (fortran.getName() != null) { + if ( fortran.getName() != null ) + { noOfCompilers++; // need includes - if (fortran.getIncludes( Compiler.MAIN ).isEmpty()) { - throw new MojoExecutionException( "No includes defined for compiler "+fortran.getName() ); + if ( fortran.getIncludes( Compiler.MAIN ).isEmpty() ) + { + throw new MojoExecutionException( "No includes defined for compiler " + fortran.getName() ); } } // at least one compiler has to be defined - if (noOfCompilers == 0) { - throw new MojoExecutionException( "No compilers defined for linker "+linker.getName() ); + if ( noOfCompilers == 0 ) + { + throw new MojoExecutionException( "No compilers defined for linker " + linker.getName() ); } } } -- cgit v1.2.3