Skip to content

Commit 3c5f6ef

Browse files
committed
Download Android libs during the build
1 parent 551069b commit 3c5f6ef

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

android/build.gradle

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
// The Android Gradle Plugin builds the native code with the Android NDK.
2-
31
group 'com.flet.serious_python'
4-
version '1.0'
2+
version '0.1.5'
53

64
buildscript {
75
repositories {
@@ -12,6 +10,7 @@ buildscript {
1210
dependencies {
1311
// The Android Gradle Plugin knows how to build native code with the NDK.
1412
classpath 'com.android.tools.build:gradle:7.3.0'
13+
classpath 'de.undercouch:gradle-download-task:4.1.2'
1514
}
1615
}
1716

@@ -23,6 +22,7 @@ rootProject.allprojects {
2322
}
2423

2524
apply plugin: 'com.android.library'
25+
apply plugin: 'de.undercouch.download'
2626

2727
android {
2828
// Bumping the plugin compileSdkVersion requires all clients of this plugin
@@ -57,3 +57,17 @@ android {
5757
minSdkVersion 16
5858
}
5959
}
60+
61+
import de.undercouch.gradle.tasks.download.Download
62+
63+
task downloadZipFile(type: Download) {
64+
src "https://github.com/flet-dev/serious-python/releases/download/v${version}/python-android-dist-v${version}.zip"
65+
dest new File(buildDir, "python-android-dist-v${version}.zip")
66+
}
67+
68+
task unzipFile(dependsOn: downloadZipFile, type: Copy) {
69+
from zipTree(downloadZipFile.dest)
70+
into 'src/main/jniLibs'
71+
}
72+
73+
preBuild.dependsOn unzipFile

0 commit comments

Comments
 (0)