Skip to content

Commit 1f91630

Browse files
committed
o Changing <version> to match the branch name.
o Getting zip-3 IT to work.
1 parent 93f65c0 commit 1f91630

File tree

34 files changed

+122
-96
lines changed

34 files changed

+122
-96
lines changed

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
</parent>
3232
<groupId>no.arktekk.unix</groupId>
3333
<artifactId>unix</artifactId>
34-
<version>1.0-alpha-7-SNAPSHOT</version>
34+
<version>feature-no-commons-vfs-SNAPSHOT</version>
3535
<packaging>pom</packaging>
3636
<name>Maven Unix Support</name>
3737
<inceptionYear>2008</inceptionYear>
3838
<description>Supporting tools for writing software for the UNIX platform</description>
3939
<properties>
40-
<functionaljava.version>3.0</functionaljava.version>
40+
<version.functionaljava>3.0</version.functionaljava>
4141
<version.maven-apis>3.0</version.maven-apis>
4242
<version.maven-compiler-plugin>2.3.1</version.maven-compiler-plugin>
4343
<version.maven-dependency-plugin>2.5</version.maven-dependency-plugin>
@@ -103,7 +103,7 @@
103103
<dependency>
104104
<groupId>org.functionaljava</groupId>
105105
<artifactId>functionaljava</artifactId>
106-
<version>${functionaljava.version}</version>
106+
<version>${version.functionaljava}</version>
107107
</dependency>
108108
</dependencies>
109109
</dependencyManagement>
@@ -229,7 +229,7 @@
229229
<link>http://java.sun.com/j2ee/1.4/docs/api</link>
230230
<link>http://java.sun.com/j2se/1.5.0/docs/api</link>
231231
<link>http://junit.sourceforge.net/javadoc/</link>
232-
<link>http://functionaljava.googlecode.com/svn/artifacts/${functionaljava.version}/javadoc</link>
232+
<link>http://functionaljava.googlecode.com/svn/artifacts/${version.functionaljava}/javadoc</link>
233233
</links>
234234
<source>1.5</source>
235235
</configuration>

unix-ar/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<parent>
2828
<groupId>no.arktekk.unix</groupId>
2929
<artifactId>unix</artifactId>
30-
<version>1.0-alpha-7-SNAPSHOT</version>
30+
<version>feature-no-commons-vfs-SNAPSHOT</version>
3131
</parent>
3232
<artifactId>unix-ar</artifactId>
3333
<name>Maven Ar File Format Tools</name>

unix-common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<parent>
2828
<groupId>no.arktekk.unix</groupId>
2929
<artifactId>unix</artifactId>
30-
<version>1.0-alpha-7-SNAPSHOT</version>
30+
<version>feature-no-commons-vfs-SNAPSHOT</version>
3131
</parent>
3232
<artifactId>unix-common</artifactId>
3333
<name>Common Unix Code</name>

unix-common/src/main/java/org/codehaus/mojo/unix/UnixPackage.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public abstract class UnixPackage
4444

4545
private PackageVersion version;
4646

47+
protected LocalFs workingDirectory;
48+
4749
private File basedir;
4850

4951
public UnixPackage( String packageFileExtension )
@@ -57,6 +59,12 @@ public UnixPackage( String packageFileExtension )
5759
//
5860
// -----------------------------------------------------------------------
5961

62+
public final UnixPackage workingDirectory( LocalFs workingDirectory )
63+
{
64+
this.workingDirectory = workingDirectory;
65+
return this;
66+
}
67+
6068
public UnixPackage basedir( File basedir )
6169
{
6270
this.basedir = basedir;
Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,43 @@
1-
package org.codehaus.mojo.unix.io.fs;
2-
3-
import java.io.*;
4-
5-
public class FsUtil
6-
{
7-
/**
8-
* Remember to close() the Fs-es after use.
9-
*/
10-
public static Fs<?> resolve( File file )
11-
throws IOException
12-
{
13-
if ( file.isDirectory() )
14-
{
15-
return new LocalFs( file );
16-
}
17-
else if ( file.getName().endsWith( ".jar" ) || file.getName().endsWith( ".zip" ) )
18-
{
19-
return new ZipFsRoot( file );
20-
}
21-
else
22-
{
23-
throw new IOException( "Unable to resolve file type: " + file.getAbsolutePath() );
24-
}
25-
}
26-
}
1+
package org.codehaus.mojo.unix.io.fs;
2+
3+
import java.io.*;
4+
import java.util.*;
5+
6+
public class FsUtil
7+
{
8+
private final static String[] zipFileTypes = { "zip", "jar", "war", "ear", "sar", };
9+
10+
static {
11+
Arrays.sort( zipFileTypes );
12+
}
13+
14+
/**
15+
* Remember to close() the Fs-es after use.
16+
*/
17+
public static Fs<?> resolve( File file )
18+
throws IOException
19+
{
20+
if ( file.isDirectory() )
21+
{
22+
return new LocalFs( file );
23+
}
24+
25+
int i = file.getName().lastIndexOf( '.' );
26+
27+
if ( i < 1 )
28+
{
29+
throw new IOException( "Unable to resolve file type of file: " + file.getAbsolutePath() );
30+
}
31+
32+
String ending = file.getName().substring( i + 1 );
33+
34+
if ( Arrays.binarySearch( zipFileTypes, ending ) >= 0 )
35+
{
36+
return new ZipFsRoot( file );
37+
}
38+
else
39+
{
40+
throw new IOException( "Unable to resolve file type of file: " + file.getAbsolutePath() );
41+
}
42+
}
43+
}

unix-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<parent>
2828
<groupId>no.arktekk.unix</groupId>
2929
<artifactId>unix</artifactId>
30-
<version>1.0-alpha-7-SNAPSHOT</version>
30+
<version>feature-no-commons-vfs-SNAPSHOT</version>
3131
</parent>
3232
<artifactId>unix-core</artifactId>
3333
<name>Maven Unix Plugin Core</name>

unix-deb/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<parent>
2828
<groupId>no.arktekk.unix</groupId>
2929
<artifactId>unix</artifactId>
30-
<version>1.0-alpha-7-SNAPSHOT</version>
30+
<version>feature-no-commons-vfs-SNAPSHOT</version>
3131
</parent>
3232
<artifactId>unix-deb</artifactId>
3333
<name>Maven Deb Support</name>

unix-handbook/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<parent>
2828
<groupId>no.arktekk.unix</groupId>
2929
<artifactId>unix</artifactId>
30-
<version>1.0-alpha-7-SNAPSHOT</version>
30+
<version>feature-no-commons-vfs-SNAPSHOT</version>
3131
</parent>
3232
<artifactId>unix-handbook</artifactId>
3333
<name>Unix Maven Plugin Handbook</name>

unix-maven-plugin/pom.xml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<parent>
2828
<groupId>no.arktekk.unix</groupId>
2929
<artifactId>unix</artifactId>
30-
<version>1.0-alpha-7-SNAPSHOT</version>
30+
<version>feature-no-commons-vfs-SNAPSHOT</version>
3131
</parent>
3232
<artifactId>unix-maven-plugin</artifactId>
3333
<packaging>maven-plugin</packaging>
@@ -140,7 +140,7 @@
140140
<plugins>
141141
<plugin>
142142
<artifactId>maven-invoker-plugin</artifactId>
143-
<version>1.7</version>
143+
<version>1.8</version>
144144
<executions>
145145
<execution>
146146
<id>integration-test</id>
@@ -152,10 +152,17 @@
152152
</executions>
153153
<configuration>
154154
<addTestClassPath>true</addTestClassPath>
155-
<!-- Use -Dinvoker.test=test-zip-1/pom4test.xml -->
155+
<!--
156+
Use -Dinvoker.test=test-zip-1/pom4test.xml to run single tests.
157+
158+
The ones listed here are platform independent and should always pass.
159+
-->
160+
<!-- This doesn't seem to be useful.
161+
<parallelThreads>4</parallelThreads>
162+
-->
156163
<pomIncludes>
157-
<pomInclude>jetty/pom4test.xml</pomInclude>
158164
<!--
165+
<pomInclude>jetty/pom4test.xml</pomInclude>
159166
<pomInclude>test-deb-*/pom4test.xml</pomInclude>
160167
<pomInclude>test-rpm-*/pom4test.xml</pomInclude>
161168
<pomInclude>test-sysvpkg-*/pom4test.xml</pomInclude>

unix-maven-plugin/src/it/jetty/goals.txt

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
clean install
1+
-e clean install

0 commit comments

Comments
 (0)