Skip to content

Commit

Permalink
Hack in a compat shim for building on jdk6, but deploying on jdk7+
Browse files Browse the repository at this point in the history
  • Loading branch information
vp-of-awesome committed Dec 4, 2011
1 parent c65df7d commit 751a5bb
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
47 changes: 47 additions & 0 deletions pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<url>git@github.com:jnr/jnr-enxio.git</url> <url>git@github.com:jnr/jnr-enxio.git</url>
</scm> </scm>



<developers> <developers>
<developer> <developer>
<id>wmeissner</id> <id>wmeissner</id>
Expand Down Expand Up @@ -63,4 +64,50 @@
<version>0.6.0</version> <version>0.6.0</version>
</dependency> </dependency>
</dependencies> </dependencies>

<profiles>
<profile>
<id>jdk7</id>
<activation>
<jdk>[1.7,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
<excludes>
<exclude>**/ProtocolFamily.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>**/java/net</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project> </project>
3 changes: 3 additions & 0 deletions src/main/java/java/net/ProtocolFamily.java
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,3 @@
package java.net;

public final class ProtocolFamily {}
4 changes: 4 additions & 0 deletions src/main/java/jnr/enxio/channels/NativeSelectorProvider.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public DatagramChannel openDatagramChannel() throws IOException {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }


public DatagramChannel openDatagramChannel(java.net.ProtocolFamily family) throws IOException {
throw new UnsupportedOperationException("Not supported yet.");
}

@Override @Override
public Pipe openPipe() throws IOException { public Pipe openPipe() throws IOException {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
Expand Down

0 comments on commit 751a5bb

Please sign in to comment.