diff options
author | Vikas Rangarajan <vikas@vikas-linux.tva.tvworks.com> | 2010-03-22 15:48:57 -0700 |
---|---|---|
committer | Vikas Rangarajan <vikas@vikas-linux.tva.tvworks.com> | 2010-03-22 15:48:57 -0700 |
commit | e8c35d105cf227a9a781ac4aac79dcd0c5024a6b (patch) | |
tree | ed979c6ccf8c0a9a5a6ec6ed67ff47242acfeeea /src/main/java/org/apache/maven/plugin/nar/Compiler.java | |
parent | 2bb8e535ca23632a4df9ba291709cd1c536d39cd (diff) | |
download | maven-nar-plugin-e8c35d105cf227a9a781ac4aac79dcd0c5024a6b.tar.gz maven-nar-plugin-e8c35d105cf227a9a781ac4aac79dcd0c5024a6b.tar.bz2 maven-nar-plugin-e8c35d105cf227a9a781ac4aac79dcd0c5024a6b.tar.xz maven-nar-plugin-e8c35d105cf227a9a781ac4aac79dcd0c5024a6b.zip |
Initial merge of local changes with master, main changes :
- New mojo for vcproj generation
- Fixed aol to be url-friendly for maven deployments (g++->gpp)
- Fail build early if specified include paths do not exist
- Only add "include" subdirs of sourcedirs if they exist, to the include path
- Removed duplication of source dirs in source path
Diffstat (limited to 'src/main/java/org/apache/maven/plugin/nar/Compiler.java')
-rw-r--r-- | src/main/java/org/apache/maven/plugin/nar/Compiler.java | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/src/main/java/org/apache/maven/plugin/nar/Compiler.java b/src/main/java/org/apache/maven/plugin/nar/Compiler.java index 33c0a8f..59cdee2 100644 --- a/src/main/java/org/apache/maven/plugin/nar/Compiler.java +++ b/src/main/java/org/apache/maven/plugin/nar/Compiler.java @@ -326,7 +326,11 @@ public abstract class Compiler includeList = new ArrayList(); for ( Iterator i = getSourceDirectories( type ).iterator(); i.hasNext(); ) { - includeList.add( new File( (File) i.next(), "include" ).getPath() ); + //VR 20100318 only add include directories that exist - we now fail the build fast if an include directory does not exist + File includePath = new File( (File) i.next(), "include" ); + if(includePath.isDirectory()) { + includeList.add( includePath.getPath() ); + } } } return includeList; @@ -555,6 +559,10 @@ public abstract class Compiler for ( Iterator i = getIncludePaths( type ).iterator(); i.hasNext(); ) { String path = (String) i.next(); + // Darren Sargent, 30Jan2008 - fail build if invalid include path(s) specified. + if ( ! new File(path).exists() ) { + throw new MojoFailureException("NAR: Include path not found: " + path); + } compiler.createIncludePath().setPath( path ); } @@ -603,24 +611,6 @@ public abstract class Compiler } } - // add other sources, FIXME seems - if ( !type.equals( TEST ) ) - { - for ( Iterator i = mojo.getMavenProject().getCompileSourceRoots().iterator(); i.hasNext(); ) - { - File dir = new File( (String) i.next() ); - mojo.getLog().debug( "Checking for existence of " + getLanguage() + " sourceCompileRoot: " + dir ); - if ( dir.exists() ) - { - ConditionalFileSet otherFileSet = new ConditionalFileSet(); - otherFileSet.setProject( mojo.getAntProject() ); - otherFileSet.setIncludes( StringUtils.join( includeSet.iterator(), "," ) ); - otherFileSet.setExcludes( StringUtils.join( excludeSet.iterator(), "," ) ); - otherFileSet.setDir( dir ); - compiler.addFileset( otherFileSet ); - } - } - } return compiler; } |