|
| 1 | +apply plugin: 'com.android.library' |
| 2 | +apply plugin: 'kotlin-android' |
| 3 | +apply plugin: 'maven-publish' |
| 4 | + |
| 5 | +group = 'expo.modules.speechrecognition' |
| 6 | +version = '0.1.0' |
| 7 | + |
| 8 | +buildscript { |
| 9 | + def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle") |
| 10 | + if (expoModulesCorePlugin.exists()) { |
| 11 | + apply from: expoModulesCorePlugin |
| 12 | + applyKotlinExpoModulesCorePlugin() |
| 13 | + } |
| 14 | + |
| 15 | + // Simple helper that allows the root project to override versions declared by this library. |
| 16 | + ext.safeExtGet = { prop, fallback -> |
| 17 | + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback |
| 18 | + } |
| 19 | + |
| 20 | + // Ensures backward compatibility |
| 21 | + ext.getKotlinVersion = { |
| 22 | + if (ext.has("kotlinVersion")) { |
| 23 | + ext.kotlinVersion() |
| 24 | + } else { |
| 25 | + ext.safeExtGet("kotlinVersion", "1.8.10") |
| 26 | + } |
| 27 | + } |
| 28 | + |
| 29 | + repositories { |
| 30 | + mavenCentral() |
| 31 | + } |
| 32 | + |
| 33 | + dependencies { |
| 34 | + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}") |
| 35 | + } |
| 36 | +} |
| 37 | + |
| 38 | +afterEvaluate { |
| 39 | + publishing { |
| 40 | + publications { |
| 41 | + release(MavenPublication) { |
| 42 | + from components.release |
| 43 | + } |
| 44 | + } |
| 45 | + repositories { |
| 46 | + maven { |
| 47 | + url = mavenLocal().url |
| 48 | + } |
| 49 | + } |
| 50 | + } |
| 51 | +} |
| 52 | + |
| 53 | +android { |
| 54 | + compileSdkVersion safeExtGet("compileSdkVersion", 33) |
| 55 | + |
| 56 | + compileOptions { |
| 57 | + sourceCompatibility JavaVersion.VERSION_11 |
| 58 | + targetCompatibility JavaVersion.VERSION_11 |
| 59 | + } |
| 60 | + |
| 61 | + kotlinOptions { |
| 62 | + jvmTarget = JavaVersion.VERSION_11.majorVersion |
| 63 | + } |
| 64 | + |
| 65 | + namespace "expo.modules.speechrecognition" |
| 66 | + defaultConfig { |
| 67 | + minSdkVersion safeExtGet("minSdkVersion", 21) |
| 68 | + targetSdkVersion safeExtGet("targetSdkVersion", 33) |
| 69 | + versionCode 1 |
| 70 | + versionName "0.1.0" |
| 71 | + } |
| 72 | + lintOptions { |
| 73 | + abortOnError false |
| 74 | + } |
| 75 | + publishing { |
| 76 | + singleVariant("release") { |
| 77 | + withSourcesJar() |
| 78 | + } |
| 79 | + } |
| 80 | +} |
| 81 | + |
| 82 | +repositories { |
| 83 | + mavenCentral() |
| 84 | +} |
| 85 | + |
| 86 | +dependencies { |
| 87 | + implementation project(':expo-modules-core') |
| 88 | + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}" |
| 89 | +} |
0 commit comments