clean before build

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@162992 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2004-08-21 00:14:25 +00:00
parent 02cc1d93ee
commit 28c89971f2
2 changed files with 17 additions and 12 deletions

View File

@ -101,13 +101,13 @@ public class MBoot
private static final String TEST_RESOURCES = "src/test/resources";
private static final String CLASSES = "target/classes";
private static final String TEST_CLASSES = "target/test-classes";
private static final String BUILD_DIR = "target";
private static final String GENERATED_SOURCES = "target/generated-sources";
private static final String CLASSES = BUILD_DIR + "/classes";
private static final String TEST_CLASSES = BUILD_DIR + "/test-classes";
private static final String GENERATED_SOURCES = BUILD_DIR + "/generated-sources";
// ----------------------------------------------------------------------
// Per-session entities which we can reuse while building many projects.
@ -397,7 +397,12 @@ public class MBoot
String generatedSources = new File( basedir, GENERATED_SOURCES ).getAbsolutePath();
String buildDir = new File( basedir, BUILD_DIR ).getAbsolutePath();
File buildDirFile = new File( basedir, BUILD_DIR );
String buildDir = buildDirFile.getAbsolutePath();
// clean
System.out.println( "Cleaning " + buildDirFile + "..." );
FileUtils.forceDelete( buildDirFile );
// ----------------------------------------------------------------------
// Download deps
@ -420,20 +425,20 @@ public class MBoot
{
System.out.println( "Model exists!" );
File generatedSourcesDirectory = new File( basedir, "target/generated-sources" );
File generatedSourcesDirectory = new File( basedir, GENERATED_SOURCES );
if ( !generatedSourcesDirectory.exists() )
{
generatedSourcesDirectory.mkdirs();
}
generateSources( model.getAbsolutePath(), "java", generatedSourcesDirectory.getAbsolutePath(), "4.0.0", "false" );
generateSources( model.getAbsolutePath(), "java", generatedSources, "4.0.0", "false" );
generateSources( model.getAbsolutePath(), "java", generatedSourcesDirectory.getAbsolutePath(), "3.0.0", "true" );
generateSources( model.getAbsolutePath(), "java", generatedSources, "3.0.0", "true" );
generateSources( model.getAbsolutePath(), "xpp3", generatedSourcesDirectory.getAbsolutePath(), "4.0.0", "false" );
generateSources( model.getAbsolutePath(), "xpp3", generatedSources, "4.0.0", "false" );
generateSources( model.getAbsolutePath(), "xpp3", generatedSourcesDirectory.getAbsolutePath(), "3.0.0", "true" );
generateSources( model.getAbsolutePath(), "xpp3", generatedSources, "3.0.0", "true" );
}
// ----------------------------------------------------------------------
@ -490,7 +495,7 @@ public class MBoot
testDependencies.add( junitDep );
compile( testDependencies, testSources, testClasses, basedir + "/target/classes", null );
compile( testDependencies, testSources, testClasses, classes, null );
// ----------------------------------------------------------------------
// Test resources

BIN
mboot.jar

Binary file not shown.