METAGEN-104 Improving the way the test source directory is discovered
This commit is contained in:
parent
052012776e
commit
b98c45f904
|
@ -36,10 +36,13 @@ public class CompilationStatement extends Statement {
|
||||||
private static final String SOURCE_BASE_DIR;
|
private static final String SOURCE_BASE_DIR;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// first we try to guess the target directory. This will work, if the build is triggered from the
|
// first we try to guess the target directory.
|
||||||
// command line or the output directory used by the id is within the project directory (eg 'out' in Intellij).
|
File potentialSourceDirectory = new File(System.getProperty( "user.dir" ), "tooling/metamodel-generator/src/test/java");
|
||||||
File targetDir = TestUtil.getTargetDir();
|
|
||||||
File potentialSourceDirectory = new File( targetDir.getParent(), "src/test/java" );
|
// the command line build sets the user.dir to sub project directory
|
||||||
|
if ( !potentialSourceDirectory.exists() ) {
|
||||||
|
potentialSourceDirectory = new File(System.getProperty( "user.dir" ), "src/test/java");
|
||||||
|
}
|
||||||
|
|
||||||
if ( potentialSourceDirectory.exists() ) {
|
if ( potentialSourceDirectory.exists() ) {
|
||||||
SOURCE_BASE_DIR = potentialSourceDirectory.getAbsolutePath();
|
SOURCE_BASE_DIR = potentialSourceDirectory.getAbsolutePath();
|
||||||
|
|
Loading…
Reference in New Issue