UNPKG

2.08 kBPlain TextView Raw
1apply plugin: 'com.android.library'
2apply plugin: 'kotlin-android'
3apply plugin: 'maven'
4
5group = 'host.exp.exponent'
6version = '10.0.0'
7
8buildscript {
9 // Simple helper that allows the root project to override versions declared by this library.
10 ext.safeExtGet = { prop, fallback ->
11 rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
12 }
13
14 repositories {
15 mavenCentral()
16 }
17
18 dependencies {
19 classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet("kotlinVersion", "1.3.50")}")
20 }
21}
22
23//Upload android library to maven with javadoc and android sources
24configurations {
25 deployerJars
26}
27
28//Creating sources with comments
29task androidSourcesJar(type: Jar) {
30 classifier = 'sources'
31 from android.sourceSets.main.java.srcDirs
32}
33
34//Put the androidSources and javadoc to the artifacts
35artifacts {
36 archives androidSourcesJar
37}
38
39uploadArchives {
40 repositories {
41 mavenDeployer {
42 configuration = configurations.deployerJars
43 repository(url: mavenLocal().url)
44 }
45 }
46}
47
48android {
49 compileSdkVersion safeExtGet("compileSdkVersion", 29)
50
51 defaultConfig {
52 minSdkVersion safeExtGet("minSdkVersion", 21)
53 targetSdkVersion safeExtGet("targetSdkVersion", 29)
54 versionCode 30
55 versionName "10.0.0"
56 }
57 lintOptions {
58 abortOnError false
59 }
60}
61
62repositories {
63 mavenCentral()
64}
65
66if (new File(rootProject.projectDir.parentFile, 'package.json').exists()) {
67 apply from: project(":unimodules-core").file("../unimodules-core.gradle")
68} else {
69 throw new GradleException(
70 "'unimodules-core.gradle' was not found in the usual React Native dependency location. " +
71 "This package can only be used in such projects. Are you sure you've installed the dependencies properly?")
72}
73
74dependencies {
75 unimodule 'unimodules-core'
76 unimodule 'unimodules-permissions-interface'
77
78 api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet("kotlinVersion", "1.3.50")}"
79 api "androidx.appcompat:appcompat:1.2.0"
80
81 compileOnly('com.facebook.react:react-native:+') {
82 exclude group: 'com.android.support'
83 }
84}