-
-
Notifications
You must be signed in to change notification settings - Fork 97
/
Copy pathbuild.gradle
84 lines (72 loc) · 2.7 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
apply from: 'versions.gradle'
addRepos(repositories)
ext.kotlin_version = '2.0.0'
dependencies {
classpath 'com.android.tools.build:gradle:8.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.22.0'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.7.20'
}
}
allprojects {
addRepos(repositories)
//Support @JvmDefault
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs = ['-Xjvm-default=all', '-opt-in=kotlin.RequiresOptIn']
jvmTarget = '1.8'
}
}
}
subprojects {
if (name != 'sample') {
apply plugin: "com.vanniktech.maven.publish"
repositories {
maven {
url = version.toString().endsWith("SNAPSHOT")
? 'https://oss.sonatype.org/content/repositories/snapshots/'
: 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
}
}
}
afterEvaluate {
android {
compileSdkVersion 34
defaultConfig {
minSdkVersion 21
targetSdkVersion 34
versionCode 1
versionName "$VERSION_NAME"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
buildConfig true
}
}
configurations.configureEach {
resolutionStrategy {
// Force Kotlin to use current version
force "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
force "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
force "org.jetbrains.kotlin:kotlin-android-extensions-runtime:$kotlin_version"
}
}
// global dependencies for all modules
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}
}
}
tasks.register('clean', Delete) {
delete rootProject.buildDir
}