1
1
buildscript {
2
- // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
2
def kotlin_version = rootProject. ext. has(' kotlinVersion' )
4
3
? rootProject. ext. get(' kotlinVersion' )
5
4
: project. properties[' PdfExtractor_kotlinVersion' ]
6
5
7
6
repositories {
8
- google()
9
7
mavenCentral()
10
- jcenter()
8
+ google()
9
+ maven { url ' https://plugins.gradle.org/m2/' }
11
10
}
12
11
13
12
dependencies {
14
13
classpath(' com.android.tools.build:gradle:7.1.3' )
15
14
classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
15
+ classpath " org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.0"
16
+ classpath ' com.dicedmelon.gradle:jacoco-android:0.1.5'
17
+
16
18
}
17
19
}
18
20
19
21
apply plugin : ' com.android.library'
20
22
apply plugin : ' kotlin-android'
23
+ apply plugin : ' org.sonarqube'
24
+ apply plugin : ' com.dicedmelon.gradle.jacoco-android'
25
+
26
+ jacoco {
27
+ toolVersion = " 0.8.4"
28
+ }
29
+
30
+ tasks. withType(Test ) {
31
+ jacoco. includeNoLocationClasses = true
32
+ }
33
+
34
+ def kotlin_version = getExtOrDefault(" kotlinVersion" )
35
+
36
+ sonarqube {
37
+ properties {
38
+ property " sonar.projectKey" , " code-leak_react-native-pdf-extractor_android"
39
+ property " sonar.organization" , " code-leak"
40
+ property " sonar.host.url" , " https://sonarcloud.io"
41
+ property " sonar.sourceEncoding" , " UTF-8"
42
+ property " sonar.java.coveragePlugin" , " jacoco"
43
+ }
44
+ }
21
45
22
46
def getExtOrDefault (name ) {
23
47
return rootProject. ext. has(name) ? rootProject. ext. get(name) : project. properties[' PdfExtractor_' + name]
@@ -31,7 +55,7 @@ android {
31
55
compileSdkVersion getExtOrIntegerDefault(' compileSdkVersion' )
32
56
33
57
defaultConfig {
34
- minSdkVersion 21
58
+ minSdkVersion getExtOrIntegerDefault( ' minSdkVersion ' )
35
59
targetSdkVersion getExtOrIntegerDefault(' targetSdkVersion' )
36
60
versionCode 1
37
61
versionName " 0.1.1"
@@ -41,7 +65,13 @@ android {
41
65
release {
42
66
minifyEnabled true
43
67
}
68
+
69
+ debug {
70
+ minifyEnabled false
71
+ testCoverageEnabled true
72
+ }
44
73
}
74
+
45
75
lintOptions {
46
76
disable ' GradleCompatible'
47
77
}
@@ -50,7 +80,6 @@ android {
50
80
repositories {
51
81
mavenCentral()
52
82
google()
53
- jcenter()
54
83
55
84
def found = false
56
85
def defaultDir = null
@@ -102,23 +131,24 @@ repositories {
102
131
103
132
if (! found) {
104
133
throw new GradleException (
105
- " ${ project.name} : unable to locate React Native android sources. " +
106
- " Ensure you have you installed React Native as a dependency in your project and try again."
134
+ " ${ project.name} : unable to locate React Native android sources. " +
135
+ " Ensure you have you installed React Native as a dependency in your project and try again."
107
136
)
108
137
}
109
138
}
110
139
111
- def kotlin_version = getExtOrDefault(' kotlinVersion' )
112
-
113
140
dependencies {
114
141
// noinspection GradleDynamicVersion
115
142
api(" com.facebook.react:react-native:+" )
116
- implementation(" com.tom-roush:pdfbox-android:2.0.21.0" )
117
- implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.2" )
118
- implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.2" )
143
+
144
+ // Project dependencies
145
+ implementation(' com.tom-roush:pdfbox-android:2.0.23.0' )
146
+ implementation(' org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.3' )
147
+ implementation(' org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.3' )
119
148
implementation(" org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version " )
120
149
121
- // Tests dependencies
150
+
151
+ // Unit Tests dependencies
122
152
testImplementation(" junit:junit:4.13.2" )
123
153
testImplementation(" pl.pragmatists:JUnitParams:1.1.1" )
124
154
testImplementation(" io.mockk:mockk:1.12.4" )
0 commit comments