-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
154 lines (133 loc) · 4.62 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Properties properties = new Properties()
if (project.rootProject.file("local.properties").exists()) {
properties.load(project.rootProject.file('local.properties').newDataInputStream())
} else {
properties.setProperty("bintray.user", System.getenv('BINTRAY_USER'))
properties.setProperty("bintray.apikey", System.getenv('BINTRAY_APIKEY'))
}
buildscript {
apply from: 'config.gradle'
// The Android Gradle plugin is only required when opening the android folder stand-alone.
// This avoids unnecessary downloads and potential conflicts when the library is included as a
// module dependency in an application project.
if (project == rootProject) {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:$gradle_version"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_plugin_version"
classpath "com.github.ben-manes:gradle-versions-plugin:$gradle_version_plugin_version"
}
}
}
if (project == rootProject) {
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'maven-publish'
}
apply plugin: 'com.android.library'
// start - module specific overrides of default values written in manifest.gradle
def bintray_project_name = bintray_project_name
def library_description = library_description
def library_keywords = library_keywords
// end - module specific overrides
// start - do not modify this if your project is on github
project.ext {
mavDevelopers = [(properties.getProperty("bintray.user")): (maintainer)]
mavSiteUrl = "https://github.com/${github_username}/${github_repository_name}"
mavGitUrl = mavSiteUrl + '.git'
bugTrackerUrl = mavSiteUrl + '/issues/'
mavProjectName = bintray_project_name
mavLibraryLicenses = library_licenses
mavLibraryDescription = library_description
mavVersion = library_version
}
// end - do not modify this if your project is on github
group = library_project_group
version = library_version
def getExtOrDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['RNSecureElement_' + name]
}
def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['RNSecureElement_' + name]).toInteger()
}
android {
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
buildToolsVersion getExtOrDefault('buildToolsVersion')
defaultConfig {
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
}
flavorDimensions "secure-element"
productFlavors {
rn {
dimension "secure-element"
}
general {
dimension "secure-element"
}
}
sourceSets {
main {
java.srcDirs = ['src/main/java']
}
general {
java.srcDirs = ['src/main/java']
}
rn {
java.srcDirs = ['src/main/java', 'src/rn/java']
}
}
lintOptions {
abortOnError false
warning 'InvalidPackage'
}
}
repositories {
google()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
jcenter()
}
dependencies {
rnImplementation "com.facebook.react:react-native:${getExtOrDefault('reactNativeVersion')}"
implementation "androidx.annotation:annotation:1.1.0"
}
tasks.whenTaskAdded { task ->
if (task.name == 'androidJavadocs') {
task.configure {
failOnError true
source = android.sourceSets.main.java.srcDirs
// this is new
android.libraryVariants.all { variant ->
owner.classpath += variant.javaCompiler.classpath
}
// end of new
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
}
}
if (project == rootProject) {
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
publications = ['mavenPublish']
pkg {
repo = bintray_repo_name
name = mavProjectName
desc = library_description
websiteUrl = mavSiteUrl
vcsUrl = mavGitUrl
issueTrackerUrl = bugTrackerUrl
licenses = library_licenses
labels = library_keywords
publicDownloadNumbers = true
publish = true
}
}
apply from: 'publish.gradle'
}