forked from invertase/notifee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
152 lines (128 loc) · 5.27 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
import org.gradle.internal.jvm.Jvm
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.1'
}
}
apply plugin: 'com.android.library'
ext {
jvmVersion = Jvm.current().javaVersion.majorVersion
if (jvmVersion != "8" && jvmVersion != "11" && jvmVersion != "14") {
println "\n\n\n"
println "**************************************************************************************************************"
println "\n\n\n"
println "ERROR: Notifee builds with JVM LTS and current releases (currently major version 8, 11, or 14)."
println " Incompatible major version detected: '" + jvmVersion + "'"
println "\n\n\n"
println "**************************************************************************************************************"
println "\n\n\n"
System.exit(1)
}
ciBuild = System.getenv("CI") == "true" // works for Travis CI or Github Actions
// Virtualized Environment like CI may report host CPU counts vs guest, but runs 2 cores
// everyone else gets 50% of cores to account for SMT which doesn't help this workload
gradleTestMaxParallelForks = 1
if (!ciBuild) {
gradleTestMaxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
}
}
android {
compileSdkVersion 30
testOptions {
unitTests.returnDefaultValues = true
}
defaultConfig {
minSdkVersion 20
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation":
"$projectDir/schemas".toString(),
eventBusIndex: 'app.notifee.core.EventBusIndex']
}
}
}
sourceSets {
// Adds exported schema location as test app assets.
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
}
buildTypes {
release {
minifyEnabled true
debuggable false
jniDebuggable false
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
testOptions.unitTests.all {
testLogging {
events "failed", "skipped"
showStackTraces = true
exceptionFormat = "full"
}
maxParallelForks = gradleTestMaxParallelForks
forkEvery = 40
maxHeapSize = "2048m"
minHeapSize = "1024m"
systemProperties['junit.jupiter.execution.parallel.enabled'] = true
systemProperties['junit.jupiter.execution.parallel.mode.default'] = "concurrent"
}
}
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
api 'androidx.annotation:annotation:1.2.0' // https://developer.android.com/jetpack/androidx/releases/annotation
api "com.squareup.okhttp3:okhttp:3.12.12" // okhttp must stay on 3.12.x to support minSdkVersion < 21
api 'androidx.concurrent:concurrent-futures:1.1.0' // https://developer.android.com/jetpack/androidx/releases/concurrent
api 'com.google.android.gms:play-services-tasks:17.2.1' // https://developers.google.com/android/guides/releases
api 'androidx.work:work-runtime:2.5.0' // https://developer.android.com/jetpack/androidx/releases/work
// Fresco 2.3.0+ may not be react-native compatible until 0.65.x with this: https://github.com/facebook/react-native/pull/30061
// But! Fresco 2.2.0 is on JCenter and 2.3.0 is on mavenCentral - use 2.3.0 if you have to? https://github.com/facebook/fresco/issues/2585#issuecomment-822785614
api 'com.facebook.fresco:fresco:2.2.0' // https://github.com/facebook/fresco/releases
api 'io.jsonwebtoken:jjwt-api:0.11.2' // https://github.com/jwtk/jjwt/releases
def room_version = '2.3.0' // https://developer.android.com/jetpack/androidx/releases/room
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
def eventbus_version = '3.2.0' // https://github.com/greenrobot/EventBus/releases
api "org.greenrobot:eventbus:$eventbus_version"
annotationProcessor "org.greenrobot:eventbus-annotation-processor:$eventbus_version"
testImplementation 'junit:junit:4.13.2' // https://github.com/junit-team/junit4/releases
androidTestImplementation 'androidx.test.ext:junit:1.1.3' // https://developer.android.com/jetpack/androidx/releases/test
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' // see above
androidTestImplementation "androidx.room:room-testing:$room_version"
androidTestImplementation "androidx.test:monitor:1.4.0"
}
apply plugin: 'maven-publish'
publishing {
publications {
aar(MavenPublication) {
project.tasks.publishAarPublicationToMavenLocal.dependsOn("assembleRelease")
groupId 'app.notifee'
artifactId 'core'
version '202108261754'
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
}
}
repositories {
maven {
url = "$rootDir/../packages/react-native/android/libs/"
}
project.tasks.publishAarPublicationToMavenRepository.dependsOn("assembleRelease")
}
}