-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
73 lines (60 loc) · 1.58 KB
/
build.gradle.kts
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
plugins {
id("com.android.library")
kotlin("android")
kotlin("android.extensions")
id("maven-publish")
}
android {
compileSdkVersion(Constants.SDK_VERSION)
defaultConfig {
minSdkVersion(Constants.MIN_SDK)
targetSdkVersion(Constants.TARGET_SDK)
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
buildTypes {
getByName("release") {
isMinifyEnabled = false // IMPORTANT BIT else you release aar will have no classes
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
}
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(android.sourceSets.getByName("main").java.srcDirs)
}
afterEvaluate {
publishing {
publications {
val release by publications.registering(MavenPublication::class) {
from(components["release"])
artifact(sourcesJar.get())
artifactId = "lib2"
groupId = "com.github.danbrough.jitpackdemo"
version = "1.0.2"
}
}
}
}
tasks.withType<Test> {
useJUnit()
testLogging {
events("standardOut", "started", "passed", "skipped", "failed")
showStandardStreams = true
/* outputs.upToDateWhen {
false
}*/
}
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Constants.kotlin_version}")
}