UNPKG

1.95 kBPlain TextView Raw
1apply plugin: 'com.android.library'
2apply plugin: 'maven'
3apply plugin: 'kotlin-android'
4
5group = 'host.exp.exponent'
6version = '8.6.0'
7
8
9buildscript {
10 // Simple helper that allows the root project to override versions declared by this library.
11 ext.safeExtGet = { prop, fallback ->
12 rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
13 }
14
15 repositories {
16 mavenCentral()
17 }
18
19 dependencies {
20 classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet("kotlinVersion", "1.3.50")}")
21 }
22}
23
24// Upload android library to maven with javadoc and android sources
25configurations {
26 deployerJars
27}
28
29// Creating sources with comments
30task androidSourcesJar(type: Jar) {
31 classifier = 'sources'
32 from android.sourceSets.main.java.srcDirs
33}
34
35// Put the androidSources and javadoc to the artifacts
36artifacts {
37 archives androidSourcesJar
38}
39
40uploadArchives {
41 repositories {
42 mavenDeployer {
43 configuration = configurations.deployerJars
44 repository(url: mavenLocal().url)
45 }
46 }
47}
48
49android {
50 compileSdkVersion safeExtGet("compileSdkVersion", 29)
51
52 defaultConfig {
53 minSdkVersion safeExtGet("minSdkVersion", 21)
54 targetSdkVersion safeExtGet("targetSdkVersion", 29)
55 versionCode 17
56 versionName '8.6.0'
57 }
58 lintOptions {
59 abortOnError false
60 }
61 compileOptions {
62 sourceCompatibility = '1.8'
63 targetCompatibility = '1.8'
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 testImplementation "org.robolectric:robolectric:4.3.1"
79
80 api "androidx.browser:browser:1.2.0"
81}