Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
ssadaadadad committed Jan 24, 2020
1 parent 399eb43 commit cbea11b
Show file tree
Hide file tree
Showing 27 changed files with 1,220 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[*.{kt,kts}]

charset=utf-8

indent_size=unset
disabled_rules=no-wildcard-imports,import-ordering
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.gradle

build

out

.idea
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
init
# Simple Kotlin https://localise.biz/ API client
----
All Translations are in Properties format and **load once**

## What does it look like? (Code snippets)
#### Response from API
```json
{
"en": {
"hello-world": "Hello",
"world": "World",
"my": {
"another": "Another"
}
}
}
```
#### "en" in Map
```properties
hello-world = Hello
world = World
my.another = Another
```

## How to use? (Code snippets)
```kotlin
val client = LocoClient("<API_KEY>")
val i18n = client.translations("en")
println(i18n.t("my.another"))
```

106 changes: 106 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

group = "com.npwork"
version = "1.0.0-SNAPSHOT"

plugins {
id("org.jetbrains.kotlin.jvm") version "1.3.41"

id("org.jlleitschuh.gradle.ktlint") version "9.1.1"
id("io.gitlab.arturbosch.detekt") version "1.4.0"
id("info.solidsoft.pitest") version "1.4.6"
id("com.star-zero.gradle.githook") version "1.2.0"

jacoco
}

val mainClass: String by project

val tornadoFxVersion = "1.7.19"
val junitVersion = "5.5.2"

repositories {
jcenter()
mavenCentral()
maven(url = "https://jitpack.io")
maven(url = "https://plugins.gradle.org/m2")
}

dependencies {
// Kotlin
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")

implementation("com.github.wnameless:json-flattener:0.2.2")
implementation("khttp:khttp:1.0.0")
implementation("com.google.code.gson:gson:2.8.6")
implementation("com.github.mmazi:rescu:1.6.0")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.10.+")
implementation("com.google.guava:guava:20.0")
implementation("ch.qos.logback:logback-classic:1.2.3")

// Test dependencies
testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
testImplementation("org.assertj:assertj-core:3.14.0")
}

detekt {
failFast = true
buildUponDefaultConfig = true
config = files("gradle/detekt/detekt.yml")
reports {
html.enabled = true
xml.enabled = false
txt.enabled = false
}
}

tasks.test {
useJUnitPlatform()
failFast = true
testLogging {
events("passed", "skipped", "failed")
}

configure<JacocoTaskExtension> {
isEnabled = true
}
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.allWarningsAsErrors = true
}

tasks.wrapper {
gradleVersion = "6.1"
}

jacoco {
toolVersion = "0.8.5"
}

pitest {
targetClasses.add("com.cardiolyse.holter.*")
outputFormats.add("HTML")
}

githook {
createHooksDirIfNotExist = true
hooks {
create("pre-commit") {
task = "build -x test"
shell = "echo 'Build successful'"
}
}
}

tasks.jacocoTestReport {
executionData.setFrom(fileTree(buildDir).include("/jacoco/*.exec"))

reports {
xml.isEnabled = false
csv.isEnabled = false
html.isEnabled = true
}
}
Loading

0 comments on commit cbea11b

Please sign in to comment.