11buildscript {
2- ext. kotlin_version = " 1.5.21 "
2+ ext. kotlin_version = " 1.9.24 "
33 ext. jacocoVersion = ' 0.8.7'
44 repositories {
55 google()
66 mavenCentral()
7+ maven {
8+ url = uri(" https://plugins.gradle.org/m2/" )
9+ }
710 }
811 dependencies {
9- classpath ' com.android.tools.build:gradle:7.1.2'
12+ if (System . getenv(" SHOULD_PUBLISH" ) == " true" ) {
13+ classpath(" io.github.gradle-nexus:publish-plugin:1.1.0" )
14+ }
15+ classpath ' com.android.tools.build:gradle:8.2.2'
1016 classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
1117 classpath " org.jacoco:org.jacoco.core:$jacocoVersion "
1218 }
1319}
1420
21+ plugins {
22+ id " org.sonarqube" version " 3.5.0.2730"
23+ }
24+
25+ sonarqube {
26+ properties {
27+ property " sonar.projectKey" , " OutSystems_OSGeolocationLib-Android"
28+ property " sonar.organization" , " outsystemsrd"
29+ property " sonar.host.url" , " https://sonarcloud.io"
30+ }
31+ }
32+
33+ if (System . getenv(" SHOULD_PUBLISH" ) == " true" ) {
34+ apply plugin : " io.github.gradle-nexus.publish-plugin"
35+ apply from : file(" ./scripts/publish-root.gradle" )
36+ }
37+
1538apply plugin : " com.android.library"
1639apply plugin : " kotlin-android"
1740apply plugin : " jacoco"
1841
1942android {
20- compileSdk 32
43+ namespace " com.outsystems.plugins.osgeolocation"
44+ compileSdk 35
2145
2246 defaultConfig {
2347 minSdk 26
24- targetSdk 32
48+ targetSdk 35
2549 versionCode 1
2650 versionName " 1.0"
2751
2852 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
53+ vectorDrawables {
54+ useSupportLibrary true
55+ }
2956 }
3057
3158 buildTypes {
@@ -35,23 +62,23 @@ android {
3562 }
3663 }
3764 compileOptions {
38- sourceCompatibility JavaVersion . VERSION_1_8
39- targetCompatibility JavaVersion . VERSION_1_8
65+ sourceCompatibility JavaVersion . VERSION_17
66+ targetCompatibility JavaVersion . VERSION_17
4067 }
4168 kotlinOptions {
42- jvmTarget = ' 1.8 '
69+ jvmTarget = ' 17 '
4370 }
4471
4572 task jacocoTestReport(type : JacocoReport , dependsOn : [' testDebugUnitTest' ]) {
4673
4774 reports {
48- xml. enabled = true
49- html. enabled = true
75+ xml. getRequired() . set( true )
76+ html. getRequired() . set( true )
5077 }
5178
5279 def fileFilter = [' **/BuildConfig.*' , ' **/Manifest*.*' ]
53- def debugTree = fileTree(dir : " ${ buildDir} /tmp/kotlin-classes/debugUnitTest " , excludes : fileFilter)
54- def mainSrc = " ${ project.projectDir} /src/main/java "
80+ def debugTree = fileTree(dir : " ${ buildDir} /tmp/kotlin-classes/debug " , excludes : fileFilter)
81+ def mainSrc = " ${ project.projectDir} /src/main/kotlin "
5582
5683 sourceDirectories. setFrom(files([mainSrc]))
5784 classDirectories. setFrom(files([debugTree]))
@@ -60,6 +87,24 @@ android {
6087 " outputs/code-coverage/connected/*coverage.ec"
6188 ]))
6289 }
90+
91+ packaging {
92+ resources {
93+ excludes + = ' /META-INF/{AL2.0,LGPL2.1}'
94+ }
95+ }
96+
97+ testOptions {
98+ unitTests. returnDefaultValues = true
99+ }
100+
101+ lintOptions {
102+ abortOnError false
103+ }
104+
105+ publishing {
106+ singleVariant(" release" )
107+ }
63108}
64109
65110repositories {
@@ -68,12 +113,22 @@ repositories {
68113}
69114
70115dependencies {
116+ implementation ' androidx.core:core-ktx:1.13.1'
117+
118+ implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
119+ implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
120+ implementation ' org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4'
121+ implementation ' com.google.android.gms:play-services-location:21.3.0'
122+ implementation ' com.google.android.gms:play-services-base:18.5.0'
123+ implementation ' androidx.activity:activity:1.6.0'
124+ implementation ' androidx.activity:activity-ktx:1.9.3'
71125
72- implementation ' androidx.core:core-ktx:1.7.0'
73- implementation ' androidx.appcompat:appcompat:1.4.1'
74- implementation ' com.google.android.material:material:1.5.0'
75- implementation ' androidx.constraintlayout:constraintlayout:2.1.3'
76126 testImplementation ' junit:junit:4.13.2'
77- androidTestImplementation ' androidx.test.ext:junit:1.1.3'
78- androidTestImplementation ' androidx.test.espresso:espresso-core:3.4.0'
127+ testImplementation ' io.mockk:mockk:1.13.4'
128+ testImplementation ' app.cash.turbine:turbine:1.2.0'
129+ testImplementation ' org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3'
79130}
131+
132+ if (System . getenv(" SHOULD_PUBLISH" ) == " true" ) {
133+ apply from : file(" ./scripts/publish-module.gradle" )
134+ }
0 commit comments