brett 2004/03/10 03:06:50
Modified: src/bootstrap/org/apache/maven Tag: MAVEN-1_0-BRANCH
BootstrapTask.java
Log:
move install_repo generation from the bootstrap to the installer generation
Revision Changes Path
No revision
No revision
1.20.2.4 +0 -73 maven/src/bootstrap/org/apache/maven/BootstrapTask.java
Index: BootstrapTask.java
===================================================================
RCS file: /home/cvs/maven/src/bootstrap/org/apache/maven/BootstrapTask.java,v
retrieving revision 1.20.2.3
retrieving revision 1.20.2.4
diff -u -r1.20.2.3 -r1.20.2.4
--- BootstrapTask.java 2 Mar 2004 05:38:18 -0000 1.20.2.3
+++ BootstrapTask.java 10 Mar 2004 11:06:50 -0000 1.20.2.4
@@ -288,79 +288,6 @@
createClasspathReference( getProject(), "bootstrap-classpath", list,
mavenRepoLocal );
createPatternSetReference( getProject(), "bootstrap-patternset", list );
-
- try
- {
- createDependencyCopyScript();
- }
- catch ( IOException e )
- {
- // ignore this - if the script is missing the maven script will work as
before
- log( "Problem writing copy script: " + e, Project.MSG_WARN );
- }
- }
-
- /**
- * Create the dependency copying script to avoid downloading them
- * when running maven.
- * @todo this should be generated through some sort of template.
- * @throws IOException if there is a problem writing the script file
- */
- private void createDependencyCopyScript() throws IOException
- {
- if ( copyScriptDir == null )
- {
- log( "Not making the copy script - no directory given to bootstrap
task", Project.MSG_DEBUG );
- return;
- }
- PrintWriter shell = new PrintWriter( new FileWriter( new File(
copyScriptDir, "install_repo.sh" ) ) );
- shell.print( "#!/bin/sh\n" );
- shell.print( "REPO_DIR=$1\n" );
- shell.print( "if [ -z \"$REPO_DIR\" ]; then echo \"usage: $0 [repository
directory]\"; exit; fi\n" );
- shell.print( "if [ -z \"$MAVEN_HOME\" ]; then echo \"MAVEN_HOME must be
set\"; exit; fi\n" );
- PrintWriter batch = new PrintWriter( new FileWriter( new File(
copyScriptDir, "install_repo.bat" ) ) );
- batch.print( "@ECHO OFF\r\n" );
- batch.print( "if \"%1\"==\"\" goto usage\r\n" );
- batch.print( "set REPO_DIR=%1\r\n" );
- batch.print( "if \"%MAVEN_HOME%\"==\"\" goto MHusage\r\n" );
- for ( Iterator i = dependencies.iterator(); i.hasNext();)
- {
- Dependency d = (Dependency) i.next();
- String path = getArtifactPath( d, "/" );
- shell.print(
- "if [ ! -f $REPO_DIR/"
- + path
- + " ]; then mkdir -p $REPO_DIR/"
- + d.getArtifactDirectory()
- + "/jars; cp $MAVEN_HOME/lib/" );
- if ( d.getArtifactDirectory().equals( "xml-apis" )
- || d.getArtifactDirectory().equals( "xerces" ) )
- {
- shell.print( "endorsed/" );
- }
- shell.print( d.getArtifact() + " $REPO_DIR/" + path + "; fi\n" );
- path = "%REPO_DIR%\\" + d.getArtifactDirectory() + "\\jars";
- batch.print( "if not exist " + path + " mkdir " + path + "\r\n" );
- path = getArtifactPath( d, "\\" );
- batch.print(
- "if not exist \"%REPO_DIR%\\"
- + path
- + "\" copy \"%MAVEN_HOME%\\lib\\" );
- if ( d.getArtifactDirectory().equals( "xml-apis" )
- || d.getArtifactDirectory().equals( "xerces" ) )
- {
- batch.print( "endorsed\\" );
- }
- batch.print( d.getArtifact() + "\" \"%REPO_DIR%\\" + path + "\"\r\n" );
- }
- batch.print( "goto end\r\n" );
- batch.print( ":MHusage\r\n" );
- batch.print( "echo MAVEN_HOME must be set\r\n" );
- batch.print( ":usage\r\n" );
- batch.print( "echo usage: %0 [repository directory]\r\n" );
- batch.print( ":end\r\n" );
- shell.close();
- batch.close();
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]