Skip to content

Commit 6b38a20

Browse files
author
Victor Harlan D. Lacson
committed
updated folder structure
1 parent b0107c1 commit 6b38a20

File tree

54 files changed

+266
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+266
-149
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,6 @@ tasks.jacocoTestReport {
173173

174174
reports {
175175
xml.isEnabled = true
176-
html.isEnabled = false
176+
html.isEnabled = true
177177
}
178178
}

build.gradle.kts.back

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
plugins {
2+
kotlin("multiplatform") version "1.4.0"
3+
id("maven-publish")
4+
id("org.jetbrains.dokka").version("0.9.18")
5+
id("com.jfrog.bintray") version "1.8.5"
6+
id("java-library")
7+
jacoco
8+
}
9+
10+
val kotlinVersion = "1.4.0"
11+
val csvVersion = "0.11.0"
12+
13+
group = "com.vhl.blackmo"
14+
version = "0.4.1"
15+
16+
repositories {
17+
jcenter()
18+
}
19+
20+
val dokkaJar = task<Jar>("dokkaJar") {
21+
group = JavaBasePlugin.DOCUMENTATION_GROUP
22+
archiveClassifier.set("javadoc")
23+
}
24+
val sourceJar = task<Jar>("sourceJar") {
25+
archiveClassifier.set("sources")
26+
from(sourceSets.getByName("main").allSource)
27+
}
28+
val metadata = task<Jar>("metadata") {
29+
archiveClassifier.set("metadata")
30+
from(sourceSets.getByName("main").allSource)
31+
}
32+
33+
val jvm = task<Jar>("jvm") {
34+
archiveClassifier.set("jvm")
35+
from(sourceSets.getByName("main").allSource)
36+
}
37+
38+
kotlin {
39+
jvm {
40+
compilations.all {
41+
kotlinOptions {
42+
jvmTarget = "1.8"
43+
noReflect = false
44+
}
45+
}
46+
}
47+
48+
sourceSets {
49+
val commonMain by getting {
50+
dependencies {
51+
implementation(kotlin("stdlib-common"))
52+
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
53+
}
54+
}
55+
val commonTest by getting {
56+
dependencies {
57+
implementation(kotlin("test-annotations-common"))
58+
}
59+
}
60+
jvm().compilations["main"].defaultSourceSet {
61+
dependencies {
62+
implementation(kotlin("stdlib-common"))
63+
}
64+
}
65+
jvm().compilations["test"].defaultSourceSet {
66+
this.
67+
dependencies {
68+
implementation(kotlin("test"))
69+
implementation(kotlin("test-junit"))
70+
implementation("io.kotlintest:kotlintest-runner-junit5:3.3.2")
71+
implementation("com.github.doyaaaaaken:kotlin-csv-jvm:$csvVersion")
72+
}
73+
}
74+
}
75+
}
76+
77+
val bintrayUser = (project.findProperty("bintray.user") ?: "").toString()
78+
val bintrayKey = (project.findProperty("bintray.apikey")?: "").toString()
79+
80+
publishing {
81+
repositories {
82+
maven(url = "https://api.bintray.com/maven/blackmo18/kotlin-libraries/kotlin-grass/;publish=1") {
83+
name = "bintray"
84+
credentials {
85+
username = bintrayUser
86+
password = bintrayKey
87+
}
88+
}
89+
}
90+
}
91+
92+
val jvmTest by tasks.getting(Test::class) {
93+
useJUnitPlatform { }
94+
}
95+
96+
jacoco {
97+
toolVersion = "0.8.5"
98+
}
99+
100+
tasks.jacocoTestReport {
101+
val coverageSourceDirs = arrayOf(
102+
"src/commonMain",
103+
"src/jvmMain"
104+
)
105+
106+
val classFiles = File("${buildDir}/classes/kotlin/jvm/")
107+
.walkBottomUp()
108+
.toSet()
109+
.filter { it.isFile }
110+
.filterNot {
111+
val fileNamePath = it.absolutePath
112+
val dir = fileNamePath.substring(0, fileNamePath.lastIndexOf(File.separator))
113+
dir.contains("com/vhl/blackmo/grass/data")
114+
}
115+
116+
classDirectories.setFrom(classFiles)
117+
sourceDirectories.setFrom(files(coverageSourceDirs))
118+
additionalSourceDirs.setFrom(files(coverageSourceDirs))
119+
120+
121+
executionData
122+
.setFrom(files("${buildDir}/jacoco/jvmTest.exec"))
123+
124+
reports {
125+
xml.isEnabled = true
126+
html.isEnabled = false
127+
}
128+
}

core/src/commonTest/kotlin/com/vhl/blackmo/grass/core/CustomDataTypeTest.kt

Lines changed: 0 additions & 10 deletions
This file was deleted.

core/src/commonTest/kotlin/com/vhl/blackmo/grass/core/TestCustomDataTypes.kt

Lines changed: 0 additions & 36 deletions
This file was deleted.

docs/CustomDataType.MD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
c. Add the mapping into the `mapTypes` including the null value
1818

1919
```kotlin
20-
object Java8DateTime: DataTypes {
21-
20+
object Java8DateTime: DateTimeTypes() {
21+
// for this example DateTimeTypes extends DataTypes
2222
// transforms functions
2323
override val formatDate = fun (value: String): Any? {
2424
val dateFormatter = DateTimeFormatter.ofPattern(DateTimeFormats.dateFormat)

java8-datetime/src/jvmTest/kotlin/com/vhl/blackmo/grass/java8/datetime/data/DateAndTime.kt

Lines changed: 0 additions & 11 deletions
This file was deleted.

java8-datetime/src/jvmTest/kotlin/com/vhl/blackmo/grass/java8/datetime/data/DateTime.kt

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ tasks.jacocoTestReport {
161161
.filterNot {
162162
val fileNamePath = it.absolutePath
163163
val dir = fileNamePath.substring(0, fileNamePath.lastIndexOf(File.separator))
164-
dir.contains("io/github/blackmo18/grass/data")
164+
dir.contains("io/github/blackmo18/grass/core/PrimitiveType.kt")
165165
}
166166

167167
classDirectories.setFrom(classFiles)
@@ -173,6 +173,6 @@ tasks.jacocoTestReport {
173173

174174
reports {
175175
xml.isEnabled = true
176-
html.isEnabled = false
176+
html.isEnabled = true
177177
}
178178
}

core/src/commonMain/kotlin/com/vhl/blackmo/grass/core/CustomDataTypes.kt renamed to kotlin-grass-core/src/commonMain/kotlin/io/blackmo18/kotlin/grass/core/CustomDataTypes.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.vhl.blackmo.grass.core
1+
package io.blackmo18.kotlin.grass.core
22

33
import kotlin.reflect.KType
44

0 commit comments

Comments
 (0)