-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
138 lines (113 loc) · 3.8 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
buildscript {
// http://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-gradle-plugin
// https://plugins.jetbrains.com/plugin/6954-kotlin
// The minimal Kotlin's "stdlib" version suitable for KotLog is 1.1.
// We use the very minimal version of "stdlib" not to upgrade the "stdlib" version of the end-user implicitly.
ext.kotlin_version_dep = "1.1.0"
// But we build using a recent version of compiler,
// so the generated code has all the newest optimizations and improvements.
ext.kotlin_version_build = "1.1.3-2"
repositories {
jcenter()
}
dependencies {
//noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version_build"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
}
}
subprojects {
ext.kotlin_version_dep = rootProject.ext.kotlin_version_dep
}
apply plugin: "kotlin"
repositories {
jcenter()
}
dependencies {
//noinspection DifferentStdlibGradleVersion
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version_dep"
// compile project(":kotlog")
// compile project(":kotlog-console")
// compile project(":kotlog-android")
// compile project(":kotlog-slf4j")
}
// PUBLISHING
// https://docs.gradle.org/current/userguide/publishing_maven.html
// https://github.com/bintray/gradle-bintray-plugin
configure(subprojects.findAll { !it.name.endsWith("_stub") }) { p ->
apply plugin: "maven-publish"
apply plugin: "com.jfrog.bintray"
publishing {
publications {
"$p.name"(MavenPublication) {
groupId p.group
artifactId p.name
version p.version
from p.components.java
artifact jar_source {
classifier "sources"
}
}
}
}
bintray {
user = bintray_user
key = bintray_api_key
publications = [p.name]
publish = true // [Default: false] Whether version should be auto published after an upload
//override = true // [Default: false] Whether to override version artifacts already published
pkg {
repo = "maven"
name = p.name
// Optional params used to create package if it doesn't exist
userOrg = "azadev"
licenses = ["MIT"]
vcsUrl = "https://github.com/Anizoptera/Kotlin-Logging-Facade.git"
issueTrackerUrl = "https://github.com/Anizoptera/Kotlin-Logging-Facade/issues"
websiteUrl = "https://github.com/Anizoptera/Kotlin-Logging-Facade"
publicDownloadNumbers = false
version {
// Dirty hack since we cannot obtain project version inside the "bintray" closure.
// TODO: Figure out the workaround.
def v = ""
switch(p.name) {
case "kotlog": v = "0.8.2"; break
case "kotlog-console": v = "0.8.2"; break
case "kotlog-android": v = "0.8.2"; break
case "kotlog-slf4j": v = "0.8.2"; break
default: throw new IllegalArgumentException("Unknown project: $p.name")
}
name = v
// println("$p.name $v")
// throw new RuntimeException("")
}
}
}
}
// Publishing tasks (to publish modules separately).
// To publish all together just use the 'publishToMavenLocal'
// and 'bintrayUpload' tasks of the root project.
task _publishToMavenLocal_kotlog {
dependsOn project(":kotlog").publishToMavenLocal as Task
}
task _publishToMavenLocal_kotlog_console {
dependsOn project(":kotlog-console").publishToMavenLocal as Task
}
task _publishToMavenLocal_kotlog_slf4j {
dependsOn project(":kotlog-slf4j").publishToMavenLocal as Task
}
task _publishToMavenLocal_kotlog_android {
dependsOn project(":kotlog-android").publishToMavenLocal as Task
}
task _publishToBintray_kotlog {
dependsOn project(":kotlog").bintrayUpload as Task
}
task _publishToBintray_kotlog_console {
dependsOn project(":kotlog-console").bintrayUpload as Task
}
task _publishToBintray_kotlog_slf4j {
dependsOn project(":kotlog-slf4j").bintrayUpload as Task
}
task _publishToBintray_kotlog_android {
dependsOn project(":kotlog-android").bintrayUpload as Task
}