Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
Update jlibtorrent to 1.2.5.0 (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
whackawaldo authored Apr 19, 2020
1 parent 476e935 commit 565b57d
Show file tree
Hide file tree
Showing 9 changed files with 206 additions and 168 deletions.
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.72'
repositories {
mavenCentral()
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'de.undercouch:gradle-download-task:4.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
6 changes: 5 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true

# Enable AndroidX in this project
android.enableJetifier=true
android.useAndroidX=true
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Dec 23 18:23:30 CET 2018
#Sat Apr 18 14:47:51 EDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
36 changes: 27 additions & 9 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'de.undercouch.download'

group='com.github.TorrentStream'

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
compileSdkVersion 29

defaultConfig {
minSdkVersion 15
targetSdkVersion 28
targetSdkVersion 29
}

buildTypes {
Expand All @@ -41,14 +41,32 @@ android {
}

ext {
libtorrentVersion = '1.2.1.0'
libtorrentVersion = '1.2.5.0'
}

// Custom task which downloads the appropriate version of JAR files for jlibtorrent
task downloadDependencies(type: Download) {
def baseUrl = "https://github.com/frostwire/frostwire-jlibtorrent" +
"/releases/download/release%2F$libtorrentVersion"

def platforms = ['arm', 'arm64', 'x86', 'x86_64']
def urls = platforms.collect { "$baseUrl/jlibtorrent-android-$it-${libtorrentVersion}.jar" }
urls.add("$baseUrl/jlibtorrent-${libtorrentVersion}.jar")

src urls
dest 'libs'
overwrite false
}

// Add our custom task as a dependency to the build
// You may need to run gradle sync for IDE warnings to disappear
preBuild.dependsOn(downloadDependencies)

// Add deletion of libs folder to clean task
clean {
delete 'libs'
}

dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
api "com.frostwire:jlibtorrent:$libtorrentVersion"
api "com.frostwire:jlibtorrent-android-arm:$libtorrentVersion"
api "com.frostwire:jlibtorrent-android-arm64:$libtorrentVersion"
api "com.frostwire:jlibtorrent-android-x86:$libtorrentVersion"
api "com.frostwire:jlibtorrent-android-x86_64:$libtorrentVersion"
}
15 changes: 10 additions & 5 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@
*/

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
compileSdkVersion 29

defaultConfig {
applicationId "com.github.se_bastiaan.torrentstreamer.sample"
minSdkVersion 15
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
Expand All @@ -42,7 +43,11 @@ android {
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation project(':library')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
mavenCentral()
}
14 changes: 13 additions & 1 deletion sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
android:allowBackup="true"
Expand Down Expand Up @@ -120,6 +119,19 @@
<data android:scheme="magnet" />
</intent-filter>
</activity>


<!-- FileProvider used to share media with other apps -->
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"/>
</provider>

</application>

</manifest>

This file was deleted.

Loading

0 comments on commit 565b57d

Please sign in to comment.