frostwire-jlibtorrent

A swig Java interface for libtorrent by the makers of FrostWire.

License

License

Categories

Categories

Wire Data Data Structures
GroupId

GroupId

com.frostwire
ArtifactId

ArtifactId

jlibtorrent-macosx
Last Version

Last Version

1.2.0.18
Release Date

Release Date

Type

Type

jar
Description

Description

frostwire-jlibtorrent
A swig Java interface for libtorrent by the makers of FrostWire.
Project URL

Project URL

https://github.com/frostwire/frostwire-jlibtorrent
Source Code Management

Source Code Management

https://github.com/frostwire/frostwire-jlibtorrent

Download jlibtorrent-macosx

How to add to project

<!-- https://jarcasting.com/artifacts/com.frostwire/jlibtorrent-macosx/ -->
<dependency>
    <groupId>com.frostwire</groupId>
    <artifactId>jlibtorrent-macosx</artifactId>
    <version>1.2.0.18</version>
</dependency>
// https://jarcasting.com/artifacts/com.frostwire/jlibtorrent-macosx/
implementation 'com.frostwire:jlibtorrent-macosx:1.2.0.18'
// https://jarcasting.com/artifacts/com.frostwire/jlibtorrent-macosx/
implementation ("com.frostwire:jlibtorrent-macosx:1.2.0.18")
'com.frostwire:jlibtorrent-macosx:jar:1.2.0.18'
<dependency org="com.frostwire" name="jlibtorrent-macosx" rev="1.2.0.18">
  <artifact name="jlibtorrent-macosx" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.frostwire', module='jlibtorrent-macosx', version='1.2.0.18')
)
libraryDependencies += "com.frostwire" % "jlibtorrent-macosx" % "1.2.0.18"
[com.frostwire/jlibtorrent-macosx "1.2.0.18"]

Dependencies

compile (1)

Group / Artifact Type Version
com.frostwire : jlibtorrent jar 1.2.0.18

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

frostwire-jlibtorrent

JLibtorrent Logo

A swig Java interface for libtorrent by the makers of FrostWire.

Develop libtorrent based apps with the joy of coding in Java.

Discord Developer Chatroom

Using

Download the latest release .jars

All platforms will need you to use at least 2 .jar files.

The .jar with the java classes -> jlibtorrent-w.x.y.z.jar and a secondary .jars containing the JNI binary library for the particular OS and CPU architecture.

In the case of desktop operating systems, you might want to extract the shared library inside the jar (.dll, .so, .dylib) and place it in a folder specified by the java.library.path

The secondary jars are:

  • Windows: jlibtorrent-windows-w.x.y.z.jar (x86 and x86_64 .dlls)
  • Mac: jlibtorrent-macosx-w.x.y.z.jar (x86_64 .dylib)
  • Linux: jlibtorrent-linux-w.x.y.z.jar (x86 and x86_64 .so)

In the case of Android, make sure to put the following 3 jars in your project's libs folder (see FrostWire for Android's as an example):

  • jlibtorrent-w.x.y.z.jar
  • jlibtorrent-android-arm-w.x.y.z.jar
  • jlibtorrent-android-x86-w.x.y.z.jar

If you use ProGuard to obfuscate/minify make sure to add the following statement

-keep class com.frostwire.jlibtorrent.swig.libtorrent_jni {*;}

Note that there are multiple version of jlibtorrent for different platforms: jlibtorrent, jlibtorrent-windows, jlibtorrent-linux, jlibtorrent-macosx and jlibtorrent-android-<arch>. These are all different artifacts.

For examples look at https://github.com/frostwire/frostwire-jlibtorrent/tree/master/src/test/java/com/frostwire/jlibtorrent/demo

Architectures supported:

  • Android (armeabi-v7a, arm64-v8a, x86, x86_64)
  • Linux (x86, x86_64)
  • Windows (x86, x86_64)
  • Mac OS X (x86_64)

Building with Travis

You need:

  • Setup a travis account at http://travis-ci.org and get familiar with the service if necessary.
  • Open an account with Amazon Web Services (AWS) and get familiar with S3 (for storage) and IAM (for users).
  • Some familiarity with git commands.

The process is:

  • Create a user in amazon IAM, let's suppose it is user1. Download credentials for the keys.
  • Create a bucket in amazon S3, let's suppose it is jlibtorrent1.
  • Set the permission of the bucket according to your workflow, but at least the user1 should have permission to put/upload to the bucket. See for example this bucket policy:
{
	"Statement": [
		{
			"Effect": "Allow",
			"Principal": {"AWS":"arn:aws:iam::<user1's ARN here>:user/user1"},
			"Action": "s3:PutObject",
			"Resource": "arn:aws:s3:::jlibtorrent1/*"
		},
		{
			"Effect": "Allow",
			"Principal": "*",
			"Action": "s3:GetObject",
			"Resource": "arn:aws:s3:::jlibtorrent1/*"
		}
	]
}
  • Fork the project in github.
  • Go to travis and enable the repository.
  • Go to 'More options' > 'Settings' > 'Environment Variables' and set the S3_ACCESS_KEY, S3_SECRET_KEY, S3_BUCKET variables using the values in the credentials file for the user you created and the bucket name you created.
  • Clone locally your repo, let's assume to the jlibtorrent folder and checkout the stable branch:
$ git clone <your fork repo url> jlibtorrent
$ cd jlibtorrent
$ git checkout master
  • Verify in your travis online if the build already started. The build could take about 40 minutes, be patient.
  • When finished, check your s3 bucket for the binaries.
  • To trigger a new build, just make a change or merge new changes from the stable branch, commit and push.

Building Locally (Mac and Linux)

Building on Travis is something recommended only once you know you're done with your work as builds can take above 30 minutes to finish for all platforms and architectures.

When you're developing and debugging you need faster builds, and these can be performed locally with the help of build scripts in the swig/ folder.

Thre's a build script for each operating system, for example if you're on macos you can use the build-macos.sh, running it without setting things up should tell you about certain environment variables you'll need to set up. To understand the build process we recommend you read your corresponding build script and build-utils.shinc

The hacking and building process might require you to run the run-swig.sh script, we usually need to run this script if there are C++ api changes in libtorrent that require adjustments in libtorrent.i or libtorrent.h, this script will create automatic JNI wrappers in the outer source java folders. You should not run this script unless you know what you're doing.

Then you run the build script for your OS, get to the parent folder and invoke gradle build

The gradle build will look in the swig folder for the JNI shared libraries and it will automatically package the native holding .jar files, the final jars will be in the build/libs folder.

The windows build script is not finished, for now the windows build is done with travis builds.

Projects using jLibtorrent

License

This software is offered under the MIT License, available here.

Versions

Version
1.2.0.18
1.2.0.18-RC12
1.2.0.18-RC11
1.2.0.18-RC10
1.2.0.18-RC9
1.2.0.18-RC8
1.2.0.18-RC7
1.2.0.18-RC6
1.2.0.18-RC5
1.2.0.18-RC4
1.2.0.18-RC3
1.2.0.18-RC2
1.2.0.18-RC1
1.2.0.17
1.2.0.17-RC2
1.2.0.17-RC1
1.2.0.16
1.2.0.16-RC3
1.2.0.16-RC2
1.2.0.16-RC1
1.2.0.15
1.2.0.15-RC3
1.2.0.15-RC2
1.2.0.15-RC1
1.2.0.14
1.2.0.13
1.2.0.13-RC14
1.2.0.13-RC13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