apply plugin: 'com.android.library' apply plugin: 'com.nishtahir.rust-android' apply plugin: 'kotlin-android' apply plugin: 'com.jfrog.bintray' // Simply applying this plugin gets bintray to publish a pom file. apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.build['compileSdkVersion'] defaultConfig { minSdkVersion rootProject.ext.build['minSdkVersion'] targetSdkVersion rootProject.ext.build['targetSdkVersion'] testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" versionCode 0 versionName "0.7" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } sourceSets { androidTest.assets.srcDirs += '../../../../fixtures' } // TODO silences: // [InvalidPackage]: not included in Android: java.awt. Referenced from com.sun.jna.Native.AWT. lintOptions { abortOnError false } } cargo { module = '../../../../ffi' targetDirectory = '../../../../target' targetInclude = 'libmentat_ffi.so' targets = ['x86'] } dependencies { 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' testImplementation 'junit:junit:4.12' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'net.java.dev.jna:jna:4.5.1' } repositories { mavenCentral() } 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"]) } } archivesBaseName = 'mentat' apply from: '../publish.gradle' ext.configurePublish( 'org.mozilla', 'mentat', 'A persistent, embedded knowledge base.')