Skip to content

Commit

Permalink
o Fixing available(), it always return false. This prevented many tes…
Browse files Browse the repository at this point in the history
…ts from running and has probably been a problem for a while.

o Implementing filtering for deb packaging.
o Setting file mode on all files in git to 644.
o Setting version back to the proper snapshot after merging.
  • Loading branch information
trygvis committed Feb 14, 2013
1 parent 6cf8df6 commit f96f0cc
Show file tree
Hide file tree
Showing 126 changed files with 1,199 additions and 1,102 deletions.
Empty file modified .travis-addServer.py
100755 → 100644
Empty file.
Empty file modified .travis.yml
100755 → 100644
Empty file.
2 changes: 2 additions & 0 deletions TODO.txt
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ o Explain possible workflow and where the different Mojos fit in

o Need *lots* of includes/excludes examples, with regexp rewriting

o Document how to create both Solaris and rpm packages with profiles.

== Integration Test ==

o Make sure that all the validate scripts are using the latest Deb/Pkg/Rpm tools to verify all the contents of the
Expand Down
32 changes: 9 additions & 23 deletions pom.xml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</parent>
<groupId>no.arktekk.unix</groupId>
<artifactId>unix</artifactId>
<version>feature-no-commons-vfs-SNAPSHOT</version>
<version>1.0-alpha-7-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Maven Unix Support</name>
<inceptionYear>2008</inceptionYear>
Expand All @@ -42,9 +42,10 @@
<version.maven-compiler-plugin>2.3.1</version.maven-compiler-plugin>
<version.maven-dependency-plugin>2.5</version.maven-dependency-plugin>
<version.maven-deploy-plugin>2.5</version.maven-deploy-plugin>
<version.maven-javadoc-plugin>2.8</version.maven-javadoc-plugin>
<version.maven-javadoc-plugin>2.9</version.maven-javadoc-plugin>
<version.maven-jxr-plugin>2.3</version.maven-jxr-plugin>
<version.maven-pmd-plugin>2.5</version.maven-pmd-plugin>
<version.maven-project-info-reports-plugin>2.6</version.maven-project-info-reports-plugin>
<version.maven-resources-plugin>2.5</version.maven-resources-plugin>
</properties>
<dependencyManagement>
Expand All @@ -59,32 +60,11 @@
<artifactId>maven-core</artifactId>
<version>${version.maven-apis}</version>
</dependency>
<!--
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${version.maven-apis}</version>
</dependency>
-->
<!--
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>${version.maven-apis}</version>
</dependency>
-->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${version.maven-apis}</version>
</dependency>
<!--
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${version.maven-apis}</version>
</dependency>
-->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
Expand Down Expand Up @@ -128,6 +108,7 @@
<issueManagement>
<url>https://github.com/trygvis/unix-maven-plugin/issues</url>
</issueManagement>
<url>http://mojo.codehaus.org/unix</url>
<licenses>
<license>
<name>Apache License 2</name>
Expand Down Expand Up @@ -234,6 +215,11 @@
<source>1.5</source>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>${version.maven-project-info-reports-plugin}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion unix-ar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<parent>
<groupId>no.arktekk.unix</groupId>
<artifactId>unix</artifactId>
<version>feature-no-commons-vfs-SNAPSHOT</version>
<version>1.0-alpha-7-SNAPSHOT</version>
</parent>
<artifactId>unix-ar</artifactId>
<name>Maven Ar File Format Tools</name>
Expand Down
2 changes: 1 addition & 1 deletion unix-common/pom.xml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<parent>
<groupId>no.arktekk.unix</groupId>
<artifactId>unix</artifactId>
<version>feature-no-commons-vfs-SNAPSHOT</version>
<version>1.0-alpha-7-SNAPSHOT</version>
</parent>
<artifactId>unix-common</artifactId>
<name>Common Unix Code</name>
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,6 @@ private TreeZipper<PackageFileSystemObject<A>> createParentsFor( P2<TreeZipper<P
*/
public TreeZipper<PackageFileSystemObject<A>> addChild( TreeZipper<PackageFileSystemObject<A>> parent, Tree<PackageFileSystemObject<A>> node )
{
// System.out.println( "Adding to " + parent.getLabel().object.path + ": " + node.root().object.path + " which is a " + node.root().object.getClass() );

if ( parent.getLabel().getUnixFsObject() instanceof Directory )
{
return parent.insertDownFirst( node );
Expand Down
Empty file.
31 changes: 17 additions & 14 deletions unix-common/src/main/java/org/codehaus/mojo/unix/UnixPackage.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*
* @author <a href="mailto:[email protected]">Trygve Laugst&oslash;l</a>
*/
public abstract class UnixPackage
public abstract class UnixPackage<UP extends UnixPackage<UP>>
implements FileCollector
{
private final String packageFileExtension;
Expand All @@ -53,32 +53,41 @@ public UnixPackage( String packageFileExtension )
this.packageFileExtension = packageFileExtension;
}

public abstract UnixPackage parameters( PackageParameters parameters );
public abstract UP parameters( PackageParameters parameters );

// -----------------------------------------------------------------------
//
// -----------------------------------------------------------------------

public final UnixPackage workingDirectory( LocalFs workingDirectory )
@SuppressWarnings( "unchecked" )
public UP workingDirectory( LocalFs workingDirectory )
{
this.workingDirectory = workingDirectory;
return this;
return (UP)this;
}

public UnixPackage basedir( File basedir )
@SuppressWarnings( "unchecked" )
public UP basedir( File basedir )
{
this.basedir = basedir;
return this;
return (UP)this;
}

public File getScripts()
{
return new File( basedir, "src/main/unix/scripts" );
}

public UnixPackage debug( boolean debug )
@SuppressWarnings( "unchecked" )
public UP debug( boolean debug )
{
return this;
return (UP)this;
}
@SuppressWarnings( "unchecked" )
public UP setVersion( PackageVersion version )
{
this.version = version;
return (UP)this;
}

public abstract void beforeAssembly( FileAttributes defaultDirectoryAttributes, LocalDateTime timestamp )
Expand All @@ -87,12 +96,6 @@ public abstract void beforeAssembly( FileAttributes defaultDirectoryAttributes,
public abstract void packageToFile( File packageFile, ScriptUtil.Strategy strategy )
throws Exception;

public UnixPackage setVersion( PackageVersion version )
{
this.version = version;
return this;
}

public final PackageVersion getVersion()
{
return version;
Expand Down
5 changes: 0 additions & 5 deletions unix-common/src/main/java/org/codehaus/mojo/unix/io/FileScanner.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,13 @@ public Option<P2<File, State>> f( State state )

if ( next.isDirectory() )
{
// long start = System.currentTimeMillis();
File[] files = next.listFiles();
// long duration = System.currentTimeMillis() - start;
// System.out.println( "duration = " + duration );
for ( File file : files )
{
state.stack = state.stack.cons( file );
}
}

// s = next.getAbsolutePath().substring( absolutePath.length() );

if ( selector.matches( relativePathFromFiles( file, next ) ) )
{
return some( p( next, state ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,6 @@ public boolean matches( RelativePath path )
include = matchesAny( include, false, s, excludes );
}

// if ( !include )
// {
// System.out.println( "No match: " + relativePath );
// }

return include;
}

Expand Down Expand Up @@ -198,18 +193,6 @@ public IncludeExcludeFilter create()
excludes.addAll( Arrays.asList( DEFAULT_EXCLUDES ) );
}

// System.out.println( "Includes:" );
// for (PathExpression pathExpression : includes)
// {
// System.out.println(pathExpression.getExpression() + "=" + pathExpression.getPattern().pattern());
// }
//
// System.out.println( "Excludes:" );
// for ( PathExpression pathExpression : excludes )
// {
// System.out.println(pathExpression.getExpression() + "=" + pathExpression.getPattern().pattern());
// }

return new IncludeExcludeFilter( includes, excludes );
}
}
Expand Down
Empty file.
25 changes: 6 additions & 19 deletions unix-common/src/main/java/org/codehaus/mojo/unix/io/LineEnding.java
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package org.codehaus.mojo.unix.io;

import fj.*;

import java.io.*;
import java.util.*;

import static fj.P.p;

/**
* TODO: This should support "keep" too.
Expand Down Expand Up @@ -36,7 +39,7 @@ public boolean isKeep()
return this == keep;
}

public static Map.Entry<InputStream, LineEnding> detect( InputStream is )
public static P2<InputStream, LineEnding> detect( InputStream is )
throws IOException
{
byte[] buffer = new byte[1000];
Expand Down Expand Up @@ -88,22 +91,6 @@ else if ( prev == '\n' )
inputStream.unread( buffer, 0, i );

final LineEnding finalLineEnding = lineEnding;
return new Map.Entry<InputStream, LineEnding>()
{
public InputStream getKey()
{
return inputStream;
}

public LineEnding getValue()
{
return finalLineEnding;
}

public LineEnding setValue( LineEnding value )
{
return null;
}
};
return p( (InputStream) inputStream, finalLineEnding );
}
}
108 changes: 57 additions & 51 deletions unix-common/src/main/java/org/codehaus/mojo/unix/io/fs/Fs.java
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,51 +1,57 @@
package org.codehaus.mojo.unix.io.fs;

import org.codehaus.mojo.unix.io.*;
import org.codehaus.mojo.unix.util.*;
import org.joda.time.*;

import java.io.*;

public interface Fs<F extends Fs>
extends Closeable
{
boolean exists();

boolean isFile();

boolean isDirectory();

LocalDateTime lastModified();

long size();

F resolve( RelativePath relativePath );

/**
* The logical root of this file system. For local file system, it is the File it was created from, for archive
* file system types it's the archive's File path.
*/
File basedir();

/**
* The path inside the file system.
*/
RelativePath relativePath();

/**
* For local files, File.getAbsolutePath. For archive files it's the archives path + "!" + relativePath
*/
String absolutePath();

InputStream inputStream()
throws IOException;

Iterable<F> find( IncludeExcludeFilter filter )
throws IOException;

void mkdir()
throws IOException;

void copyFrom( Fs<?> from )
throws IOException;
}
package org.codehaus.mojo.unix.io.fs;

import org.codehaus.mojo.unix.io.*;
import org.codehaus.mojo.unix.util.*;
import org.joda.time.*;

import java.io.*;

/**
* Move the write methods into WrFs&lt;F extends Fs> extends Fs&lt;F>
*/
public interface Fs<F extends Fs>
extends Closeable
{
boolean exists();

boolean isFile();

boolean isDirectory();

LocalDateTime lastModified();

long size();

F resolve( RelativePath relativePath );

/**
* The logical root of this file system. For local file system, it is the File it was created from, for archive
* file system types it's the archive's File path.
*/
File basedir();

/**
* The path inside the file system.
*/
RelativePath relativePath();

/**
* For local files, File.getAbsolutePath. For archive files it's the archives path + "!" + relativePath
*/
String absolutePath();

InputStream inputStream()
throws IOException;

Iterable<F> find( IncludeExcludeFilter filter )
throws IOException;

void mkdir()
throws IOException;

void copyFrom( Fs<?> from )
throws IOException;

void copyFrom( Fs from, InputStream is )
throws IOException;
}
Empty file.
Loading

0 comments on commit f96f0cc

Please sign in to comment.