Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

build.gradle 2.1 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
  1. apply plugin: 'com.android.library'
  2. apply plugin: 'maven'
  3. repositories {
  4. mavenCentral()
  5. maven {
  6. url "https://oss.sonatype.org/content/repositories/snapshots"
  7. }
  8. flatDir {
  9. dirs 'aars'
  10. }
  11. }
  12. android {
  13. configurations {
  14. extractForNativeBuild
  15. }
  16. compileSdkVersion rootProject.compileSdkVersion
  17. buildToolsVersion rootProject.buildToolsVersion
  18. defaultConfig {
  19. minSdkVersion rootProject.minSdkVersion
  20. targetSdkVersion rootProject.targetSdkVersion
  21. versionCode 0
  22. versionName "0.1"
  23. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  24. ndk {
  25. abiFilters ABI_FILTERS.split(",")
  26. }
  27. }
  28. buildTypes {
  29. debug {
  30. minifyEnabled false
  31. debuggable true
  32. }
  33. release {
  34. minifyEnabled false
  35. }
  36. }
  37. externalNativeBuild {
  38. cmake {
  39. path "CMakeLists.txt"
  40. }
  41. }
  42. useLibrary 'android.test.runner'
  43. useLibrary 'android.test.base'
  44. useLibrary 'android.test.mock'
  45. }
  46. dependencies {
  47. implementation 'com.android.support:appcompat-v7:' + rootProject.androidSupportAppCompatV7Version
  48. extractForNativeBuild "org.pytorch:pytorch_android:$pytorchAndroidVersion"
  49. // For testing: deps on local aar files
  50. //implementation(name: 'pytorch_android-release', ext: 'aar')
  51. //extractForNativeBuild(name: 'pytorch_android-release', ext: 'aar')
  52. //implementation 'com.facebook.fbjni:fbjni-java-only:0.0.3'
  53. }
  54. task extractAARForNativeBuild {
  55. doLast {
  56. configurations.extractForNativeBuild.files.each {
  57. def file = it.absoluteFile
  58. copy {
  59. from zipTree(file)
  60. into "$buildDir/$file.name"
  61. include "headers/**"
  62. include "jni/**"
  63. }
  64. }
  65. }
  66. }
  67. tasks.whenTaskAdded { task ->
  68. if (task.name.contains('externalNativeBuild')) {
  69. task.dependsOn(extractAARForNativeBuild)
  70. }
  71. }
  72. apply from: rootProject.file('gradle_scripts/release.gradle')
  73. task sourcesJar(type: Jar) {
  74. from android.sourceSets.main.java.srcDirs
  75. classifier = 'sources'
  76. }
  77. artifacts.add('archives', sourcesJar)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...