2018-05-14 15:20:36 +00:00
|
|
|
apply plugin: 'com.android.library'
|
2018-07-18 22:05:44 +00:00
|
|
|
apply plugin: 'org.mozilla.rust-android-gradle.rust-android'
|
|
|
|
|
2018-05-14 15:20:36 +00:00
|
|
|
apply plugin: 'kotlin-android'
|
2018-05-30 20:38:45 +00:00
|
|
|
apply plugin: 'com.jfrog.bintray'
|
|
|
|
// Simply applying this plugin gets bintray to publish a pom file.
|
|
|
|
apply plugin: 'com.github.dcendents.android-maven'
|
2018-05-14 15:20:36 +00:00
|
|
|
|
|
|
|
android {
|
2018-06-01 19:44:31 +00:00
|
|
|
compileSdkVersion rootProject.ext.build['compileSdkVersion']
|
2018-05-14 15:20:36 +00:00
|
|
|
defaultConfig {
|
2018-06-01 19:44:31 +00:00
|
|
|
minSdkVersion rootProject.ext.build['minSdkVersion']
|
|
|
|
targetSdkVersion rootProject.ext.build['targetSdkVersion']
|
|
|
|
|
2018-05-14 15:20:36 +00:00
|
|
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
2018-06-25 10:20:36 +00:00
|
|
|
|
|
|
|
versionCode 0
|
2018-06-29 17:28:44 +00:00
|
|
|
versionName "0.7"
|
2018-05-14 15:20:36 +00:00
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled false
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
androidTest.assets.srcDirs += '../../../../fixtures'
|
|
|
|
}
|
2018-05-29 17:16:32 +00:00
|
|
|
|
|
|
|
// TODO silences:
|
|
|
|
// [InvalidPackage]: not included in Android: java.awt. Referenced from com.sun.jna.Native.AWT.
|
|
|
|
lintOptions {
|
|
|
|
abortOnError false
|
|
|
|
}
|
2018-07-26 20:06:03 +00:00
|
|
|
|
|
|
|
// Help folks debugging by including symbols in our native libraries. Yes, this makes the
|
|
|
|
// resulting AAR very large. The Android ecosystem seems to be in flux around who is in charge
|
|
|
|
// of stripping native binaries, but for now let's provide symbols and see how consumers react.
|
|
|
|
packagingOptions {
|
|
|
|
doNotStrip "**/*.so"
|
|
|
|
}
|
2018-05-14 15:20:36 +00:00
|
|
|
}
|
|
|
|
|
2018-07-18 22:05:44 +00:00
|
|
|
cargo {
|
|
|
|
module = '../../../../ffi'
|
|
|
|
targetDirectory = '../../../../target'
|
|
|
|
targetInclude = 'libmentat_ffi.so'
|
|
|
|
|
|
|
|
targets = [
|
|
|
|
'x86',
|
|
|
|
'arm',
|
|
|
|
'arm64',
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2018-05-14 15:20:36 +00:00
|
|
|
dependencies {
|
2018-05-29 17:16:32 +00:00
|
|
|
androidTestImplementation 'com.android.support:support-annotations:27.1.1'
|
|
|
|
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
|
|
|
androidTestImplementation 'com.android.support.test:rules:1.0.2'
|
2018-05-14 15:20:36 +00:00
|
|
|
testImplementation 'junit:junit:4.12'
|
2018-05-29 17:16:32 +00:00
|
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
2018-07-26 20:05:31 +00:00
|
|
|
implementation 'net.java.dev.jna:jna:4.5.2@aar'
|
2018-05-14 15:20:36 +00:00
|
|
|
}
|
2018-07-18 22:05:44 +00:00
|
|
|
|
2018-05-14 15:20:36 +00:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
2018-05-30 20:38:45 +00:00
|
|
|
|
2018-07-18 22:05:44 +00:00
|
|
|
afterEvaluate {
|
|
|
|
// The `cargoBuild` tasks isn't available until after evaluation.
|
|
|
|
android.libraryVariants.all { variant ->
|
|
|
|
def productFlavor = ""
|
|
|
|
variant.productFlavors.each {
|
|
|
|
productFlavor += "${it.name.capitalize()}"
|
|
|
|
}
|
|
|
|
def buildType = "${variant.buildType.name.capitalize()}"
|
|
|
|
tasks["generate${productFlavor}${buildType}Assets"].dependsOn(tasks["cargoBuild"])
|
|
|
|
}
|
2018-05-30 20:38:45 +00:00
|
|
|
}
|
|
|
|
|
2018-07-18 22:05:44 +00:00
|
|
|
archivesBaseName = 'mentat'
|
2018-05-30 20:38:45 +00:00
|
|
|
|
2018-07-18 22:05:44 +00:00
|
|
|
apply from: '../publish.gradle'
|
|
|
|
ext.configurePublish(
|
|
|
|
'org.mozilla.mentat',
|
|
|
|
'mentat',
|
|
|
|
'A persistent, embedded knowledge base.')
|