-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
132 lines (114 loc) · 4.27 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
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
}
}
plugins {
id "org.jetbrains.kotlin.multiplatform" version "1.3.40"
id "org.jetbrains.kotlin.plugin.serialization" version "1.3.70"
id "base"
id "maven-publish"
}
apply plugin: 'com.jfrog.bintray'
repositories {
mavenCentral()
jcenter()
maven { url = uri("https://dl.bintray.com/badoo/maven") }
maven { url = uri("https://kotlin.bintray.com/kotlin") }
maven { url = uri("https://kotlin.bintray.com/kotlinx") }
maven { url = uri("https://jitpack.io") }
}
def GROUP_ID = "com.doublesymmetry"
def ARTIFACT_ID = "reaktive-pager"
def BINTRAY_REPOSITORY = "maven"
def BINTRAY_ORGINIZATION = "doublesymmetry"
def ISSUE_URL = "https://github.com/DoubleSymmetry/ReaktivePager/issues"
def SITE_URL = "https://github.com/DoubleSymmetry/ReaktivePager"
def VCS_URL = "https://github.com/DoubleSymmetry/ReaktivePager.git"
def LIBRARY_VERSION = "1.1.1"
group GROUP_ID
version LIBRARY_VERSION
kotlin {
def reaktive = "1.1.10"
def coroutines = "1.3.5"
sourceSets {
commonMain {
dependencies {
implementation kotlin("stdlib-common")
implementation "com.badoo.reaktive:reaktive:$reaktive"
implementation "com.badoo.reaktive:utils:$reaktive"
implementation "com.badoo.reaktive:coroutines-interop:$reaktive"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutines"
}
}
commonTest {
dependencies {
implementation kotlin("test-common")
implementation kotlin("test-annotations-common")
}
}
}
}
afterEvaluate {
project.publishing.publications.all {
groupId = GROUP_ID
if (it.name.contains('metadata')) {
artifactId = "$ARTIFACT_ID"
} else {
artifactId = "$ARTIFACT_ID-$name"
}
}
}
def getBintrayUserProperty() {
return hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
}
def getBintrayApiKeyProperty() {
return hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
}
bintray {
//A user name of bintray to A, and API key of Bintray to B.I do not want to include API Key in git,
// so I am gradle.properties writing locally.
// Gradle's property file is read in the order of gradle in the home directory> gradle in the project directory,
// so if it is written in property in the home directory, it will be useful for other projects as well.
user = getBintrayUserProperty()
key = getBintrayApiKeyProperty()
//If you set publish to true, the new version will be published the moment you upload to bintray. If false, it will not be published unless you press the publish button on the bintray web.
// It is recommended that you make it false because it can prevent an accident that you accidentally release the latest version.
publish = false
pkg {
repo = BINTRAY_REPOSITORY
name = ARTIFACT_ID
userOrg = BINTRAY_ORGINIZATION
licenses = ['Apache-2.0']
vcsUrl = VCS_URL
websiteUrl = SITE_URL
issueTrackerUrl = ISSUE_URL
version {
name = LIBRARY_VERSION
vcsTag = LIBRARY_VERSION
released = new Date()
}
}
}
// This specifies the publications to upload to bintray before doing the bintrayUpload gradle task.
//In the mpp configuration of one module after 1.3,
// it is not uploaded unless you explicitly specify artifacts in publications like this.
// It is not necessary to have the findAll part,
// [project name]-kotlinMultiplatformbut a directory containing only pom files will be uploaded, so it is better to exclude it.
bintrayUpload.doFirst {
publications = publishing.publications.collect {
it.name
}.findAll {
it != "kotlinMultiplatform"
}
}
//The task of bintrayUpload depends on publishToMavenLocal set in the previous section.
// This will create maven artifacts when running bintrayUplaod's task.
bintrayUpload.dependsOn publishToMavenLocal
configurations {
compileClasspath
}