Class EclipseSourceDir
- All Implemented Interfaces:
Comparable
source directories should always have a null output value.
- Version:
- $Id$
- Author:
- Fabrizio Giustina
-
Constructor Summary
ConstructorsConstructorDescriptionEclipseSourceDir
(String path, String output, boolean isResource, boolean test, List include, List exclude, boolean filtering) -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
Getter forexclude
.Getter forinclude
.Getter foroutput
.getPath()
Getter forpath
.int
hashCode()
boolean
Wheter this resource should be copied with filtering.boolean
Getter forisResource
.boolean
isTest()
Getter fortest
.boolean
merge
(EclipseSourceDir mergeWith) Merge with the provided directory.void
setExclude
(List exclude) Setter forexclude
.void
setFiltering
(boolean filtering) Wheter this resource should be copied with filtering.void
setInclude
(List include) Setter forinclude
.void
Setter foroutput
.void
Setter forpath
.void
setTest
(boolean test) Setter fortest
.toString()
-
Constructor Details
-
EclipseSourceDir
public EclipseSourceDir(String path, String output, boolean isResource, boolean test, List include, List exclude, boolean filtering) - Parameters:
path
- the eclipse source directoryoutput
- path output directoryisResource
- true if the directory only contains resources, false if a compilation directorytest
- true if is a test directory, false otherwiseinclude
- a string in the eclipse pattern format for the include filterexclude
- a string in the eclipse pattern format for the exclude filterfiltering
- true if filtering should be applied, false otherwise. Note: Filtering will only be applied if this become a "special directory" by being nested within the default output directory.
-
-
Method Details
-
getExclude
Getter forexclude
.- Returns:
- Returns the exclude. Never null.
-
setExclude
Setter forexclude
.- Parameters:
exclude
- The exclude to set.
-
getInclude
Getter forinclude
.- Returns:
- Returns the include. Never null.
-
setInclude
Setter forinclude
.- Parameters:
include
- The include to set.
-
getExcludeAsString
- Returns:
- Returns the exclude as a string pattern suitable for eclipse
-
getIncludeAsString
- Returns:
- Returns the include as a string pattern suitable for eclipse
-
getOutput
Getter foroutput
.source directories should always have a null output value.
- Returns:
- Returns the output.
-
setOutput
Setter foroutput
.- Parameters:
output
- The output to set.
-
getPath
Getter forpath
.- Returns:
- Returns the path.
-
setPath
Setter forpath
. Converts \\ to / in path.- Parameters:
path
- The path to set.
-
isTest
public boolean isTest()Getter fortest
.- Returns:
- Returns the test.
-
setTest
public void setTest(boolean test) Setter fortest
.- Parameters:
test
- The test to set.
-
isResource
public boolean isResource()Getter forisResource
.- Returns:
- Returns the isResource.
-
isFiltering
public boolean isFiltering()Wheter this resource should be copied with filtering. -
setFiltering
public void setFiltering(boolean filtering) Wheter this resource should be copied with filtering.- Parameters:
filtering
- filter resources
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable
- See Also:
-
toString
-
merge
public boolean merge(EclipseSourceDir mergeWith) throws org.apache.maven.plugin.MojoExecutionException Merge with the provided directory.If one directory is a source and the other is a resource directory then the result will be a source directory and any includes or excludes will be removed since Eclipse has no "main", "test" or "resource" concepts. The output directory will be the source directories value.
If the two directories are the same resources type (i.e isResource is equal) then the result will be the same resource type with the includes from each merged together (duplicates will be removed), similarly for the excludes. No effort is made to ensure that the includes and excludes are disjointed sets. Please fix your pom instead.
No support for cases where the test, or filtering values are not identical.
- Parameters:
mergeWith
- the directory to merge with- Throws:
org.apache.maven.plugin.MojoExecutionException
- test or filtering values are not identical, or isResource true and output are not identical
-