-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
143 lines (119 loc) · 3.67 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
139
140
141
142
143
buildscript {
ext.kotlin_version = '1.4.30'
ext.versions = [
'kotlin' : '1.4.30',
'retrofit' : '2.6.4',
'okhttp' : '3.14.7',
'junit' : '4.13',
'coroutine': '1.4.2'
]
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
}
}
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'maven'
apply plugin: 'maven-publish'
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
archivesBaseName = 'flowconverter'
group = 'com.waqasakram.retrofit2'
version = '0.1.6'
description = 'Flow Converter is adapter to use Kotlin Flow in Retrofit calls'
def libName = "flowconverter"
def libUrl = "https://github.com/waqasakram117/flowconverter.git"
//define apikey.properties in project root
def apikeyPropertiesFile = rootProject.file("apikey.properties")
def apikeyProperties = new Properties()
apikeyProperties.load(new FileInputStream(apikeyPropertiesFile))
repositories {
mavenCentral()
}
// Create the pom configuration:
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "waqasakram117"
name "waqas akram"
email "waqasakram117@gmail.com"
}
}
scm {
url libUrl
}
}
// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set("sources")
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set("javadoc")
from javadoc.destinationDir
}
// add javadoc/source jar tasks as artifacts
artifacts {
archives sourcesJar, javadocJar
}
publishing {
publications {
MyPublication(MavenPublication) {
from components.java
groupId = project.group
artifactId = project.archivesBaseName
version = project.version
pom.withXml {
def root = asNode()
root.appendNode('description', description)
root.appendNode('name', libName)
root.appendNode('url', libUrl)
root.children().last() + pomConfig
}
artifact sourcesJar
artifact javadocJar
}
}
}
bintray {
user = apikeyProperties.getProperty('BINTRAY_USER')
key = apikeyProperties.getProperty('BINTRAY_KEY')
publications = ['MyPublication']
publish = true
pkg {
repo = 'retrofit2'
name = libName
licenses = ['Apache-2.0']
vcsUrl = libUrl
version {
name = project.version
desc = project.description
released = new Date()
}
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
api "com.squareup.retrofit2:retrofit:${versions.retrofit}"
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.coroutine}"
testImplementation 'com.google.code.gson:gson:2.8.6'
testImplementation 'com.squareup.retrofit2:converter-gson:2.9.0'
testImplementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
testImplementation "junit:junit:${versions.junit}"
testImplementation "com.squareup.okhttp3:mockwebserver:${versions.okhttp}"
}