UNPKG

1.85 kBPlain TextView Raw
1buildscript {
2 repositories {
3 google()
4 jcenter()
5 }
6
7 dependencies {
8 classpath 'com.android.tools.build:gradle:3.2.1'
9 }
10}
11
12apply plugin: 'com.android.library'
13apply plugin: 'maven'
14
15group = 'host.exp.exponent'
16version = '5.0.1'
17
18def safeExtGet(prop, fallback) {
19 rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
20}
21
22//Upload android library to maven with javadoc and android sources
23configurations {
24 deployerJars
25}
26
27//Creating sources with comments
28task androidSourcesJar(type: Jar) {
29 classifier = 'sources'
30 from android.sourceSets.main.java.srcDirs
31}
32
33//Put the androidSources and javadoc to the artifacts
34artifacts {
35 archives androidSourcesJar
36}
37
38uploadArchives {
39 repositories {
40 mavenDeployer {
41 configuration = configurations.deployerJars
42 repository(url: mavenLocal().url)
43 }
44 }
45}
46
47android {
48 compileSdkVersion safeExtGet("compileSdkVersion", 28)
49
50 defaultConfig {
51 minSdkVersion safeExtGet("minSdkVersion", 21)
52 targetSdkVersion safeExtGet("targetSdkVersion", 28)
53 versionCode 17
54 versionName "5.0.1"
55 }
56 lintOptions {
57 abortOnError false
58 }
59}
60
61repositories {
62 mavenCentral()
63}
64
65if (new File(rootProject.projectDir.parentFile, 'package.json').exists()) {
66 apply from: project(":unimodules-core").file("../unimodules-core.gradle")
67} else {
68 throw new GradleException(
69 "'unimodules-core.gradle' was not found in the usual Flutter or React Native dependency locations. " +
70 "This package can only be used in such projects. Are you sure you've installed the dependencies properly?")
71}
72
73dependencies {
74 unimodule 'unimodules-core'
75 unimodule 'unimodules-constants-interface'
76
77 implementation 'com.facebook.device.yearclass:yearclass:2.1.0'
78 implementation "com.android.support:support-annotations:${safeExtGet("supportLibVersion", "28.0.0")}"
79}