UNPKG

1.99 kBPlain TextView Raw
1apply plugin: 'com.android.library'
2apply plugin: 'kotlin-android'
3apply plugin: 'maven'
4
5group = 'host.exp.exponent'
6version = '10.2.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.4.21')}")
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", 30)
50
51 compileOptions {
52 sourceCompatibility JavaVersion.VERSION_1_8
53 targetCompatibility JavaVersion.VERSION_1_8
54 }
55
56 defaultConfig {
57 minSdkVersion safeExtGet("minSdkVersion", 21)
58 targetSdkVersion safeExtGet("targetSdkVersion", 30)
59 versionCode 22
60 versionName "10.2.0"
61 }
62 lintOptions {
63 abortOnError false
64 }
65}
66
67if (new File(rootProject.projectDir.parentFile, 'package.json').exists()) {
68 apply from: project(":unimodules-core").file("../unimodules-core.gradle")
69} else {
70 throw new GradleException(
71 "'unimodules-core.gradle' was not found in the usual React Native dependency location. " +
72 "This package can only be used in such projects. Are you sure you've installed the dependencies properly?")
73}
74
75dependencies {
76 unimodule "unimodules-core"
77
78 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.4.21')}"
79}