Skip to content

Commit 3af12ae

Browse files
Lukas Dylanlukasdylan
authored andcommitted
Fix deprecated function
1 parent 25c18e4 commit 3af12ae

File tree

3 files changed

+54
-59
lines changed

3 files changed

+54
-59
lines changed

build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ buildscript {
55
repositories {
66
google()
77
jcenter()
8-
mavenLocal()
8+
mavenCentral()
99
}
1010
dependencies {
1111
classpath 'com.android.tools.build:gradle:4.0.1'
1212
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13-
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
13+
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
1414
// NOTE: Do not place your application dependencies here; they belong
1515
// in the individual module build.gradle files
1616
}
@@ -20,7 +20,8 @@ allprojects {
2020
repositories {
2121
google()
2222
jcenter()
23-
mavenLocal()
23+
mavenCentral()
24+
maven { url "https://www.jitpack.io" }
2425
}
2526
}
2627

library/build.gradle

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ apply plugin: 'kotlin-kapt'
88

99
apply plugin: 'com.github.dcendents.android-maven'
1010

11+
repositories {
12+
mavenCentral()
13+
google()
14+
jcenter()
15+
maven { url "https://www.jitpack.io" }
16+
}
17+
1118
group = 'com.github.lukasdylan'
1219

1320
android {
@@ -58,13 +65,6 @@ android {
5865
resourcePrefix 'protodroid_'
5966
}
6067

61-
task sourcesJar(type: Jar) {
62-
archiveClassifier.set('sources')
63-
from android.sourceSets.main.java.srcDirs
64-
}
65-
66-
install.dependsOn(sourcesJar)
67-
6868
dependencies {
6969
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
7070
implementation 'androidx.appcompat:appcompat:1.2.0'
@@ -79,34 +79,28 @@ dependencies {
7979
kapt "androidx.room:room-compiler:2.2.5"
8080
testImplementation 'junit:junit:4.13'
8181
}
82-
//
83-
//publishing {
84-
// publications {
85-
// maven(MavenPublication) {
86-
// groupId 'id.lukasdylan.grpc'
87-
// artifactId 'protodroid'
88-
// version '1.0.0-SNAPSHOT'
89-
// artifact "$buildDir/outputs/aar/protodroid-debug.aar" //aar artifact you want to publish
90-
//
91-
// //generate pom nodes for dependencies
92-
// pom.withXml {
93-
// def dependenciesNode = asNode().appendNode('dependencies')
94-
// configurations.compile.allDependencies.each { dependency ->
95-
// def dependencyNode = dependenciesNode.appendNode('dependency')
96-
// dependencyNode.appendNode('groupId', dependency.group)
97-
// dependencyNode.appendNode('artifactId', dependency.name)
98-
// dependencyNode.appendNode('version', dependency.version)
99-
// }
100-
// }
101-
// }
102-
// }
103-
//
104-
// //publish to filesystem repo
105-
// repositories{
106-
// maven {
107-
// url "$buildDir/repo"
108-
// }
109-
// }
110-
//}
111-
//
112-
//repositories { mavenCentral() }
82+
83+
task sourcesJar(type: Jar) {
84+
classifier = 'sources'
85+
from android.sourceSets.main.java.sourceFiles
86+
}
87+
88+
task javadoc(type: Javadoc) {
89+
source = android.sourceSets.main.java.sourceFiles
90+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
91+
}
92+
93+
task javadocJar(type: Jar, dependsOn: javadoc) {
94+
classifier = 'javadoc'
95+
from javadoc.destinationDir
96+
}
97+
98+
task classesJar(type: Jar) {
99+
from "$buildDir/intermediates/classes/release"
100+
}
101+
102+
artifacts {
103+
archives classesJar
104+
archives javadocJar
105+
archives sourcesJar
106+
}

library/src/main/java/id/lukasdylan/grpc/protodroid/internal/Logger.kt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@ import timber.log.Timber
44

55
internal fun printLogRequest(lastState: DataState) {
66
val stringBuilder = StringBuilder(".")
7-
.appendln()
8-
.appendln("----- Service URL: -----")
9-
.appendln(lastState.serviceUrl)
10-
.appendln("----- Service Name: -----")
11-
.appendln(lastState.serviceName)
12-
.appendln("----- Request Header: -----")
13-
.appendln(lastState.requestHeader)
14-
.appendln("----- Request Body: -----")
15-
.appendln(lastState.requestBody)
7+
.appendLine()
8+
.appendLine("----- Service URL: -----")
9+
.appendLine(lastState.serviceUrl)
10+
.appendLine("----- Service Name: -----")
11+
.appendLine(lastState.serviceName)
12+
.appendLine("----- Request Header: -----")
13+
.appendLine(lastState.requestHeader)
14+
.appendLine("----- Request Body: -----")
15+
.appendLine(lastState.requestBody)
1616
Timber.tag("GRPC").d(stringBuilder.toString())
1717
}
1818

1919
internal fun printLogFullResponse(lastState: DataState) {
2020
val stringBuilder = StringBuilder(".")
21-
.appendln()
22-
.appendln("----- Service URL: -----")
23-
.appendln(lastState.serviceUrl)
24-
.appendln("----- Service Name: -----")
25-
.appendln(lastState.serviceName)
26-
.appendln("----- Response Header: -----")
27-
.appendln(lastState.responseHeader)
28-
.appendln("----- Response Body: -----")
29-
.appendln(lastState.responseBody)
21+
.appendLine()
22+
.appendLine("----- Service URL: -----")
23+
.appendLine(lastState.serviceUrl)
24+
.appendLine("----- Service Name: -----")
25+
.appendLine(lastState.serviceName)
26+
.appendLine("----- Response Header: -----")
27+
.appendLine(lastState.responseHeader)
28+
.appendLine("----- Response Body: -----")
29+
.appendLine(lastState.responseBody)
3030
Timber.tag("GRPC").d(stringBuilder.toString())
3131
}

0 commit comments

Comments
 (0)