Permalink
Browse files

Migrated from Ant to Maven

Removed lib folder, with maven it is unnecessary. Replaced the Ant
script with a pom.xml file for Maven with similar targets.

Eclipse integration and proper changes to the .project and .classpath
remain to be done.

Signed-off-by: Maxime Petazzoni <mpetazzoni@turn.com>
  • Loading branch information...
1 parent f15a540 commit 6b5c5acaf5273360758cc2c7f328a6f53d2db6e8 Dmitriy Dumanskiy committed with Maxime Petazzoni Mar 14, 2012
Showing with 96 additions and 98 deletions.
  1. +1 −1 .gitignore
  2. +2 −13 INSTALL
  3. +0 −84 build.xml
  4. BIN lib/commons-io-2.0.1.jar
  5. BIN lib/log4j-1.2.16.jar
  6. BIN lib/simple-4.1.21.jar
  7. BIN lib/slf4j-api-1.6.4.jar
  8. BIN lib/slf4j-log4j12-1.6.4.jar
  9. +93 −0 pom.xml
  10. 0 src/{ → main/java}/com/turn/ttorrent/bcodec/BDecoder.java
  11. 0 src/{ → main/java}/com/turn/ttorrent/bcodec/BEValue.java
  12. 0 src/{ → main/java}/com/turn/ttorrent/bcodec/BEncoder.java
  13. 0 src/{ → main/java}/com/turn/ttorrent/bcodec/InvalidBEncodingException.java
  14. 0 src/{ → main/java}/com/turn/ttorrent/client/Announce.java
  15. 0 src/{ → main/java}/com/turn/ttorrent/client/AnnounceResponseListener.java
  16. 0 src/{ → main/java}/com/turn/ttorrent/client/Client.java
  17. 0 src/{ → main/java}/com/turn/ttorrent/client/ConnectionHandler.java
  18. 0 src/{ → main/java}/com/turn/ttorrent/client/Handshake.java
  19. 0 src/{ → main/java}/com/turn/ttorrent/client/IncomingConnectionListener.java
  20. 0 src/{ → main/java}/com/turn/ttorrent/client/Message.java
  21. 0 src/{ → main/java}/com/turn/ttorrent/client/Piece.java
  22. 0 src/{ → main/java}/com/turn/ttorrent/client/SharedTorrent.java
  23. 0 src/{ → main/java}/com/turn/ttorrent/client/peer/MessageListener.java
  24. 0 src/{ → main/java}/com/turn/ttorrent/client/peer/PeerActivityListener.java
  25. 0 src/{ → main/java}/com/turn/ttorrent/client/peer/PeerExchange.java
  26. 0 src/{ → main/java}/com/turn/ttorrent/client/peer/Rate.java
  27. 0 src/{ → main/java}/com/turn/ttorrent/client/peer/SharingPeer.java
  28. 0 src/{ → main/java}/com/turn/ttorrent/client/storage/FileCollectionStorage.java
  29. 0 src/{ → main/java}/com/turn/ttorrent/client/storage/FileStorage.java
  30. 0 src/{ → main/java}/com/turn/ttorrent/client/storage/TorrentByteStorage.java
  31. 0 src/{ → main/java}/com/turn/ttorrent/common/Peer.java
  32. 0 src/{ → main/java}/com/turn/ttorrent/common/Torrent.java
  33. 0 src/{ → main/java}/com/turn/ttorrent/tracker/TrackedPeer.java
  34. 0 src/{ → main/java}/com/turn/ttorrent/tracker/TrackedTorrent.java
  35. 0 src/{ → main/java}/com/turn/ttorrent/tracker/Tracker.java
  36. 0 src/{ → main/java}/com/turn/ttorrent/tracker/TrackerService.java
View
@@ -3,7 +3,7 @@
# Ignore build output
/build/*
-/*.jar
+/target/*
# Ignore Javadoc output
/doc/*
View
15 INSTALL
@@ -21,19 +21,8 @@ Building the distribution JAR
Simply execute the following command:
- $ ant dist
+ $ mvn package
-To build the library's JAR file (in the dist/ directory). You can then import
+To build the library's JAR file (in the target/ directory). You can then import
this JAR file into your Java project and start using the Java BitTorrent
library.
-
-
-Building the documentation
---------------------------
-
-You can build the library's Javadoc with the following command:
-
- $ ant doc
-
-This will build the Javadoc in the doc/ directory. Make sure Javadoc is
-installed on your system first.
View
@@ -1,84 +0,0 @@
-<!-- Copyright (C) 2011 Turn, Inc. All Rights Reserved.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!-- Ant buildfile for the BitTorrent Java library -->
-<project basedir="." default="jar" name="ttorrent">
- <property name="build.dir" location="build" />
- <property name="doc.dir" location="doc" />
- <property name="lib.dir" location="lib" />
- <property name="src.dir" location="src" />
-
- <!-- Release version. -->
- <property name="project.version" value="1.1.2" />
-
- <property name="jar.location"
- value="${ant.project.name}-${project.version}.jar" />
-
- <path id="project.classpath">
- <pathelement location="${build.dir}" />
- <fileset dir="${lib.dir}">
- <include name="**/*.jar" />
- </fileset>
- </path>
-
- <target name="init">
- <mkdir dir="${build.dir}" />
- </target>
-
- <target name="clean">
- <delete dir="${build.dir}" />
- </target>
-
- <target name="distclean" depends="clean">
- <delete dir="${doc.dir}" />
- <delete file="${jar.location}" />
- </target>
-
- <target name="build" depends="init">
- <javac destdir="${build.dir}" includeantruntime="false"
- debug="on" sourcepath="" srcdir="${src.dir}">
- <include name="com/turn/ttorrent/**/*.java" />
- <compilerarg value="-Xlint" />
- <classpath refid="project.classpath" />
- </javac>
- </target>
-
- <target name="jar" depends="build">
- <jar destfile="${jar.location}" basedir="${build.dir}">
- <zipgroupfileset dir="${lib.dir}" includes="*.jar" />
- <manifest>
- <attribute name="Built-By" value="${user.name}" />
- <attribute name="Implementation-Vendor" value="Turn, Inc." />
- <attribute name="Implementation-Title" value="Java BitTorrent library" />
- <attribute name="Implementation-Version" value="${project.version}" />
- <attribute name="Main-Class"
- value="com.turn.ttorrent.client.Client" />
- </manifest>
- </jar>
- </target>
-
- <target name="doc">
- <mkdir dir="${doc.dir}" />
- <javadoc destdir="${doc.dir}"
- access="private"
- header="Turn's pure-Java BitTorrent library"
- windowtitle="Turn's BitTorrent library"
- doctitle="Turn's BitTorrent library"
- noqualifier="java.*:com.turn.*">
- <fileset dir="${src.dir}" includes="com/turn/ttorrent/**/*.java" />
- <classpath refid="project.classpath" />
- </javadoc>
- </target>
-</project>
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
View
93 pom.xml
@@ -0,0 +1,93 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.turn.ttorrent</groupId>
+ <artifactId>ttorrent</artifactId>
+ <packaging>jar</packaging>
+ <version>1.1.2</version>
+ <name>Java BitTorrent library</name>
+ <url>http://turn.github.com/ttorrent/</url>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.simpleframework</groupId>
+ <artifactId>simple</artifactId>
+ <version>4.1.21</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.6.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>6.1.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <includes>
+ <include>**</include>
+ </includes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ <appendAssemblyId>false</appendAssemblyId>
+ <archive>
+ <manifest>
+ <addClasspath>false</addClasspath>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ <mainClass>com.turn.ttorrent.client.Client</mainClass>
+ </manifest>
+ </archive>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-my-jar-with-dependencies</id>
+ <phase>package</phase>
+ <goals>
+ <!--change assembly to single if you don't want include dependencies in jar-->
+ <goal>assembly</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>

0 comments on commit 6b5c5ac

Please sign in to comment.