-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
83 lines (73 loc) · 2.6 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
72
73
74
75
76
77
78
79
80
81
82
83
import com.android.build.gradle.LibraryPlugin
import com.jfrog.bintray.gradle.BintrayExtension
import com.jfrog.bintray.gradle.BintrayPlugin
import org.gradle.api.internal.plugins.DslObject
buildscript {
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.0-alpha03")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.20")
classpath("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4")
classpath("com.github.dcendents:android-maven-gradle-plugin:2.1")
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}
subprojects {
group = properties["GROUP"].toString()
version = properties["VERSION_NAME"].toString()
plugins.withType<LibraryPlugin> {
apply(plugin = "com.github.dcendents.android-maven")
apply<BintrayPlugin>()
val sourcesJarTask = tasks.create<Jar>("sourcesJar") {
classifier = "sources"
from(this@withType.extension.sourceSets["main"].java.srcDirs)
}
(tasks["install"] as Upload).run {
DslObject(repositories).convention
.getPlugin<MavenRepositoryHandlerConvention>()
.mavenInstaller {
pom {
project {
packaging = "aar"
groupId = properties["GROUP"].toString()
artifactId = this@subprojects.name
version = properties["VERSION_NAME"].toString()
}
}
}
tasks["bintrayUpload"].dependsOn(this)
}
artifacts {
add("archives", sourcesJarTask)
}
configure<BintrayExtension> {
user = System.getenv("BINTRAY_USER")
key = System.getenv("BINTRAY_KEY")
setConfigurations("archives")
pkg = PackageConfig().apply {
repo = "android"
name = "dagger-extensions-scoping"
userOrg = user
setLicenses("Apache-2.0")
vcsUrl = "https://github.com/bgogetap/dagger-extensions"
version = VersionConfig().apply {
name = properties["VERSION_NAME"].toString()
desc = properties["${this@subprojects.name.toUpperCase()}_POM_DESCRIPTION"].toString()
}
}
}
}
}
task("clean", Delete::class) {
delete = setOf(rootProject.buildDir)
}