forked from OutSystems/OSInAppBrowserLib-Android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
162 lines (135 loc) · 4.34 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
155
156
157
158
159
160
161
162
buildscript {
ext.kotlin_version = "1.9.24"
ext.jacocoVersion = '0.8.7'
repositories {
google()
mavenCentral()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
}
dependencies {
if (System.getenv("SHOULD_PUBLISH") == "true") {
classpath("io.github.gradle-nexus:publish-plugin:1.1.0")
}
classpath 'com.android.tools.build:gradle:8.7.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jacoco:org.jacoco.core:$jacocoVersion"
}
}
plugins {
id "org.sonarqube" version "3.5.0.2730"
}
sonarqube {
properties {
property "sonar.projectKey", "OutSystems_OSInAppBrowserLib-Android"
property "sonar.organization", "outsystemsrd"
property "sonar.host.url", "https://sonarcloud.io"
}
}
if (System.getenv("SHOULD_PUBLISH") == "true") {
apply plugin: "io.github.gradle-nexus.publish-plugin"
apply from: file("./scripts/publish-root.gradle")
}
apply plugin: "com.android.library"
apply plugin: "kotlin-android"
apply plugin: "jacoco"
apply plugin: "maven-publish"
group = 'com.github.tradingpoint'
android {
namespace "com.tradingpoint.plugins.inappbrowser.osinappbrowserlib"
compileSdk 35
defaultConfig {
minSdk 26
targetSdk 35
versionCode 2
versionName "2.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
sourceSets {
getByName("main").java.srcDirs("src/main/java")
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
reports {
xml.getRequired().set(true)
html.getRequired().set(true)
}
def fileFilter = ['**/BuildConfig.*', '**/Manifest*.*']
def debugTree = fileTree(dir: "${buildDir}/tmp/kotlin-classes/debug", excludes: fileFilter)
def mainSrc = "${project.projectDir}/src/main/java"
sourceDirectories.setFrom(files([mainSrc]))
classDirectories.setFrom(files([debugTree]))
executionData.setFrom(fileTree(dir: "$buildDir", includes: [
"jacoco/testDebugUnitTest.exec",
"outputs/code-coverage/connected/*coverage.ec"
]))
}
packaging {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
testOptions {
unitTests.returnDefaultValues = true
}
lintOptions {
abortOnError false
}
publishing {
singleVariant("release")
}
}
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'androidx.core:core-ktx:1.15.0'
implementation 'androidx.browser:browser:1.8.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.7'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.webkit:webkit:1.12.1'
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
implementation 'androidx.activity:activity-ktx:1.9.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
//gson
implementation 'com.google.code.gson:gson:2.10.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.12.2'
testImplementation 'org.mockito:mockito-core:5.12.0'
testImplementation 'androidx.test:core:1.6.1'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3'
}
if (System.getenv("SHOULD_PUBLISH") == "true") {
apply from: file("./scripts/publish-module.gradle")
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId = 'com.github.tradingpoint'
artifactId = 'osinappbrowserlib'
version = '2.0.0'
}
}
}
}