Skip to content

Commit

Permalink
Merge pull request #6 from icerockdev/#5-remove-bintray-and-jcenter
Browse files Browse the repository at this point in the history
Removed jcenter and bintray, updated dependencies
  • Loading branch information
oyakovlev authored May 6, 2022
2 parents 1a5fe56 + 8398345 commit 584a840
Show file tree
Hide file tree
Showing 12 changed files with 261 additions and 168 deletions.
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Do’s and Don’ts

* **Search tickets before you file a new one.** Add to tickets if you have new information about the issue.
* **Keep tickets short but sweet.** Make sure you include all the context needed to solve the issue. Don't overdo it. Great tickets allow us to focus on solving problems instead of discussing them.
* **Take care of your ticket.** When you spend time to report a ticket with care we'll enjoy fixing it for you.
* **Use [GitHub-flavored Markdown](https://help.github.com/articles/markdown-basics/).** Especially put code blocks and console outputs in backticks (```` ``` ````). That increases the readability. Bonus points for applying the appropriate syntax highlighting.

## Bug Reports

In short, since you are most likely a developer, provide a ticket that you _yourself_ would _like_ to receive.

First check if you are using the latest library version and Kotlin version before filing a ticket.

Please include steps to reproduce and _all_ other relevant information, including any other relevant dependency and version information.

## Feature Requests

Please try to be precise about the proposed outcome of the feature and how it
would related to existing features.


## Pull Requests

We **love** pull requests!

All contributions _will_ be licensed under the Apache 2 license.

Code/comments should adhere to the following rules:

* Names should be descriptive and concise.
* Use four spaces and no tabs.
* Remember that source code usually gets written once and read often: ensure
the reader doesn't have to make guesses. Make sure that the purpose and inner
logic are either obvious to a reasonably skilled professional, or add a
comment that explains it.
* Please add a detailed description.

If you consistently contribute improvements and/or bug fixes, we're happy to make you a maintainer.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {
}

// Append dependency
implementation("com.icerockdev.service:fcm-push-service:0.1.1")
implementation("com.icerockdev.service:fcm-push-service:0.2.0")
````

## Koin configure
Expand Down
31 changes: 0 additions & 31 deletions build.gradle

This file was deleted.

32 changes: 32 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

allprojects {
repositories {
mavenLocal()
mavenCentral()
}

configurations {
maybeCreate("runtimeClasspath")
maybeCreate("provided")
}

val copyLibsCompileTask = tasks.create("copyLibsCompile", Copy::class.java) {
from(configurations["runtimeClasspath"])
into(File(project.rootDir, "build/libs"))
}

plugins.withId("org.jetbrains.kotlin.jvm") {
tasks.withType(JavaCompile::class.java).all {
dependsOn(copyLibsCompileTask)
sourceCompatibility = JavaVersion.VERSION_11.toString()
targetCompatibility = JavaVersion.VERSION_11.toString()
}
}
}

tasks.create("clean", Delete::class.java) {
delete(rootProject.buildDir)
}
7 changes: 2 additions & 5 deletions fcm-push-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import kotlin.text.String
*/

group = "com.icerockdev.service"
version = "0.1.1"
version = "0.2.0"

plugins {
id("org.jetbrains.kotlin.jvm")
Expand All @@ -23,20 +23,17 @@ val sourcesJar by tasks.registering(Jar::class) {
}

dependencies {
// kotlin
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${properties["kotlin_version"]}")
// logging
implementation("ch.qos.logback:logback-classic:${properties["logback_version"]}")
implementation("io.ktor:ktor-client-apache:${properties["ktor_version"]}")
api("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:${properties["coroutines_version"]}")
api("io.ktor:ktor-client-logging-jvm:${properties["ktor_version"]}")

implementation("io.ktor:ktor-client-jackson:${properties["ktor_version"]}")

// tests
testImplementation("io.ktor:ktor-server-tests:${properties["ktor_version"]}")

testImplementation("io.ktor:ktor-client-mock:${properties["ktor_version"]}")
testImplementation(kotlin("test"))
}

java {
Expand Down
27 changes: 20 additions & 7 deletions fcm-push-service/src/test/kotlin/PushTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,32 @@ import com.fasterxml.jackson.databind.SerializationFeature
import com.fasterxml.jackson.databind.util.StdDateFormat
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.fasterxml.jackson.module.kotlin.registerKotlinModule
import com.icerockdev.service.fcmpush.*
import com.icerockdev.service.fcmpush.FCMConfig
import com.icerockdev.service.fcmpush.FCMMessage
import com.icerockdev.service.fcmpush.FCMPayLoad
import com.icerockdev.service.fcmpush.FCMResponse
import com.icerockdev.service.fcmpush.IPushRepository
import com.icerockdev.service.fcmpush.NotificationData
import com.icerockdev.service.fcmpush.PushService
import com.icerockdev.service.fcmpush.RequestData
import io.ktor.client.HttpClient
import io.ktor.client.engine.mock.MockEngine
import io.ktor.client.engine.mock.respond
import io.ktor.http.*
import io.ktor.http.ContentType
import io.ktor.http.HttpHeaders
import io.ktor.http.HttpStatusCode
import io.ktor.http.Url
import io.ktor.http.content.TextContent
import io.ktor.http.fullPath
import io.ktor.http.headersOf
import io.ktor.http.hostWithPort
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.runBlocking
import org.junit.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull

class PushTest {
private val validServerKey = "VALID_SERVER_KEY"
Expand Down Expand Up @@ -77,8 +90,8 @@ class PushTest {
)
}

var success = 0;
var failure = 0;
var success = 0
var failure = 0
val messageList = ArrayList<FCMMessage>()
for (token in data.registrationTokenList) {
if (token == validClientToken) {
Expand Down Expand Up @@ -169,4 +182,4 @@ class PushTest {
assertEquals(0, result.success)
assertEquals(1, result.failure)
}
}
}
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ org.gradle.parallel=true

logback_version=1.2.3
kotlin.code.style=official
kotlin_version=1.4.31
coroutines_version=1.4.2
ktor_version=1.5.2
kotlin_version=1.6.10
coroutines_version=1.6.0
ktor_version=1.6.7
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 584a840

Please sign in to comment.