www-repository mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "nicolas de loof" <nico...@apache.org>
Subject Re: apache commons-* -sources.jar
Date Sun, 03 Feb 2008 08:00:30 GMT
 That's right, but both ant and maven require the project to
script/configure that -source.jar creation. As only recent versions (based
on maven2) does, all archived releases require some changes to get
the existing build produce this bundle.

Based on existing -srz.zip dist bundles, the -source.jar creation is only an
"unzip" + "jar" operation.


Can I point out that Apache provide two complete build tools to avoid
> you doing this kind of housekeeping in Java.
>
> >
> > I'm OK to publish it under Apache license ;-)
> >
> >
> >
> >
> > import java.io.File;
> > import java.io.FilenameFilter;
> >
> > public class Sources
> > {
> >
> >     /**
> >      * @param args
> >      */
> >     public static void main( String[] args )
> >     {
> >         getMissingSourceDist();
> >         extractSrcDist();
> >         createSrcBundle();
> >     }
> >
> >     private static void createSrcBundle()
> >     {
> >         File repo = new File( "H:/java/repo1.maven.org/maven2" );
> >         File[] groups = repo.listFiles();
> >         for ( File group : groups )
> >          {
> >             if ( !group.getName().endsWith( "-src.zip" ) )
> >             {
> >                 continue;
> >             }
> >             String dist = group.getName().substring( 0,
> > group.getName().length() - "-src.zip".length() );
> >              File dir = new File( repo, dist );
> >             if ( !dir.exists() )
> >             {
> >                 dir = new File( repo, dist + "-src" );
> >                 if ( !dir.exists() )
> >                 {
> >                      dir = new File( repo, dist );
> >                     if ( !dir.exists() )
> >                     {
> >                         System.err.println( "no dir for " + dist );
> >                         continue;
> >                      }
> >                 }
> >             }
> >
> >             String f = group.getName().substring( 0,
> > group.getName().length() - "-src.zip".length() );
> >             if ( new File( dir, "src/java" ).exists() )
> >             {
> >                 System.out.println( "jar cf " + f + "-sources.jar -C " +
> dir
> > + "\\src\\java ." );
> >              }
> >             else if ( new File( dir, "src/main/java" ).exists() )
> >             {
> >                 System.out.println( "jar cf " + f + "-sources.jar -C " +
> dir
> > + "\\src\\main\\java ." );
> >              }
> >             else if ( new File( dir, "src/share" ).exists() )
> >             {
> >                 System.out.println( "jar cf " + f + "-sources.jar -C " +
> dir
> > + "\\src\\share ." );
> >              }
> >             else
> >             {
> >                 System.err.println( "no src/java for " + dist );
> >             }
> >             if ( new File( dir, "src/resources" ).exists() )
> >              {
> >                 System.out.println( "jar uf " + f + "-sources.jar -C " +
> dir
> > + "\\src\\resources ." );
> >             }
> >             if ( new File( dir, "src/javascript" ).exists() )
> >              {
> >                 System.out.println( "jar uf " + f + "-sources.jar -C " +
> dir
> > + "\\src\\javascript ." );
> >             }
> >             File[] txt = dir.listFiles( new FilenameFilter()
> >              {
> >                 @Override
> >                 public boolean accept( File dir, String name )
> >                 {
> >                     return name.endsWith( ".txt" );
> >                 }
> >             } );
> >              for ( File file : txt )
> >             {
> >                 System.out.println( "jar uf " + f + "-sources.jar -C " +
> dir
> > + " " + file.getName() );
> >             }
> >         }
> >      }
> >
> >     private static void extractSrcDist()
> >     {
> >         File repo = new File( "H:/java/repo1.maven.org/maven2" );
> >         File[] groups = repo.listFiles();
> >         for ( File group : groups )
> >         {
> >              if ( !group.getName().endsWith( "-src.zip" ) )
> >             {
> >                 continue;
> >             }
> >             System.out.println( "\"c:\\Program Files\\7-Zip\\7z.exe\" x
> " +
> > group.getName() );
> >          }
> >     }
> >
> >     private static void getMissingSourceDist()
> >     {
> >         File repo = new File( "H:/java/repo1.maven.org/maven2" );
> >         File[] groups = repo.listFiles();
> >         for ( File group : groups )
> >          {
> >             if ( !group.isDirectory() || !group.getName().startsWith(
> > "commons" ) )
> >             {
> >                 continue;
> >             }
> >             File pr = new File( group, group.getName() );
> >              File[] versions = pr.listFiles();
> >             for ( File version : versions )
> >             {
> >                 if ( !version.isDirectory() )
> >                 {
> >                     continue;
> >                 }
> >                  if ( new File( version, group.getName() + "-" +
> > version.getName() + "-sources.jar" ).exists() )
> >                 {
> >                     System.out.println( "rem " + group.getName() + ":" +
> > version.getName() + " has sources" );
> >                      continue;
> >                 }
> >
> >                 String g = group.getName().substring(
> "commons-".length() );
> >                 System.out.println( "wget -nd
> > http://archive.apache.org/dist/commons/" + g + "/source/" +
> group.getName()
> > +
> >                      "-" + version.getName() + "-src.zip" );
> >             }
> >         }
> >     }
> >
> > }
> >
> >
> >
> > 2008/2/2, Curt Arnold <carnold@apache.org>:
> > >
> > > On Feb 2, 2008, at 3:56 AM, nicolas de loof wrote:
> > >
> > > > I've put some -sources.jars in :
> > > >
> > > > http://people.apache.org/~nicolas/missing-commons-sources.jar/
> > > >
> > > > Those one have been created by a script :
> > > >
> > > > - create list of commons-* without -sources.jar in repo
> > > > - search for a src-zip distribution in www.apache.org/dist
> > > > - wget available ones
> > > > - unzip, jar a src/java + src/resources + *.txt
> > > >
> > > > Nico.
> > > >
> > >
> > >
> > > I looked at commons-beanutils-1.6-sources.jar and it did not contain a
> > > LICENSE and NOTICE file in the META-INF directory as required by
> > http://www.apache.org/dev/release.html#distribute-raw-artifact
> > > .  I assume that is likely the case for the other source jar files.
> > > That is a mandatory -1 on these as releases for me.
> > >
> > > The script used to prepare the source jars should be made available so
> > > that others can confirm that the build process is repeatable.  If I
> > > can look at the script, run it myself and compare my results with your
> > > results, I have more confidence that the process is repeatable and
> > > honest.  Obviously, the script should be ASL v2 licensed.
> > >
> > >
> >
> >
>

Mime
View raw message