Skip to content

Commit

Permalink
Hubdle refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierSegoviaCordoba committed Jul 18, 2022
1 parent 306c268 commit 5a8c259
Show file tree
Hide file tree
Showing 71 changed files with 1,559 additions and 1,720 deletions.
51 changes: 28 additions & 23 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
plugins {
`javiersc-versioning`
`javiersc-all-projects`
`javiersc-changelog`
`javiersc-code-analysis`
`javiersc-code-coverage`
`javiersc-code-formatter`
`javiersc-docs`
`kotlinx-binary-compatibility-validator`
`javiersc-nexus`
`javiersc-readme-badges-generator`
buildscript {
dependencies {
classpath(libs.android.toolsBuild.gradle)
classpath(libs.jetbrains.kotlin.kotlinGradlePlugin)
}
}

removeProjectFromDoc(
":samples:android:android-core",
":samples:jvm:jvm-core",
":samples:jvm:jvm-serialization",
)

fun removeProjectFromDoc(vararg paths: String) {
val projects = mutableListOf<Project>()
plugins {
alias(libs.plugins.javiersc.hubdle)
}

for (path in paths) {
if (findProject(path) != null) projects.add(project(path))
hubdle {
config {
analysis()
binaryCompatibilityValidator()
// coverage()
documentation {
changelog()
readme {
badges()
}
site {
excludes(
projects.mokokiTest,
projects.samples.android.androidCore,
projects.samples.jvm.jvmCore,
projects.samples.jvm.jvmSerialization,
)
}
}
nexus()
}

tasks { dokkaHtmlMultiModule { removeChildTasks(projects) } }
}
24 changes: 0 additions & 24 deletions buildSrc/build.gradle.kts

This file was deleted.

8 changes: 0 additions & 8 deletions buildSrc/settings.gradle.kts

This file was deleted.

20 changes: 11 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
####################################################################################################
### CONFIGURATION ###
### CONFIGURATION ###
####################################################################################################
project.name=mokoki
allProjects.group=com.javiersc
allProjects.name=mokoki
readmeBadges.mainProject=mokoki-core
root.project.name=mokoki
main.project.name=mokoki-core
project.group=com.javiersc.mokoki
####################################################################################################
### CODE ANALYSIS ###
####################################################################################################
codeAnalysis.sonar.organization=javiersc
analysis.sonar.organization=javiersc
analysis.sonar.projectKey=com.javiersc.mokoki:mokoki
analysis.sonar.projectName=mokoki
####################################################################################################
### POM ###
####################################################################################################
Expand All @@ -20,9 +21,9 @@ pom.license.url=https://www.apache.org/licenses/LICENSE-2.0.txt
pom.developer.id=JavierSegoviaCordoba
pom.developer.name=Javier Segovia Cordoba
pom.developer.email=[email protected]
pom.smc.url=https://github.com/JavierSegoviaCordoba/mokoki
pom.smc.connection=scm:git:[email protected]:JavierSegoviaCordoba/mokoki.git
pom.smc.developerConnection=scm:git:[email protected]:JavierSegoviaCordoba/mokoki.git
pom.scm.url=https://github.com/JavierSegoviaCordoba/mokoki
pom.scm.connection=scm:git:[email protected]:JavierSegoviaCordoba/mokoki.git
pom.scm.developerConnection=scm:git:[email protected]:JavierSegoviaCordoba/mokoki.git
####################################################################################################
### Gradle ###
####################################################################################################
Expand All @@ -40,3 +41,4 @@ org.gradle.vfs.watch=true
#org.gradle.unsafe.configuration-cache-problems=warn
#org.gradle.unsafe.configuration-cache.max-problems=100
signing.gnupg.executable=gpg
android.disableAutomaticComponentCreation=true
15 changes: 0 additions & 15 deletions gradle/libs.toml

This file was deleted.

11 changes: 11 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[versions]
android = "7.2.0"
hubdle = "0.2.0-alpha.21"
kotlin = "1.6.10"

[libraries]
android-toolsBuild-gradle = { module = "com.android.tools.build:gradle", version.ref = "android" }
jetbrains-kotlin-kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }

[plugins]
javiersc-hubdle = { id = "com.javiersc.hubdle", version.ref = "hubdle" }
12 changes: 0 additions & 12 deletions gradle/pluginLibs.toml

This file was deleted.

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-7.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.javiersc.mokoki

import android.util.Log
import com.javiersc.mokoki.internal.buildMokokiMessage
import kotlin.reflect.KClass
import kotlin.reflect.KType

public open class AndroidMokokiLogger(
private val minPriority: Priority = Priority.DEBUG,
) : MokokiLogger {

override var useCompatibleMode: Boolean = false

public var defaultTag: String = ""

override fun isLoggable(priority: Priority): Boolean = priority.isLoggable(minPriority)

override fun <T : Any> log(
priority: Priority,
tag: String?,
kClass: KClass<T>,
kType: KType,
message: T,
) {
val lines: List<String> = buildMokokiMessage(priority, tag, message)

val logTag = tag ?: defaultTag

for (line in lines) {
when (priority) {
Priority.VERBOSE -> Log.v(logTag, line)
Priority.DEBUG -> Log.d(logTag, line)
Priority.INFO -> Log.i(logTag, line)
Priority.WARN -> Log.w(logTag, line)
Priority.ERROR -> Log.e(logTag, line)
Priority.ASSERT -> Log.wtf(logTag, line)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.javiersc.mokoki

public actual typealias DefaultMokokiLogger = AndroidMokokiLogger
55 changes: 0 additions & 55 deletions mokoki-core/androidMain/kotlin/com/javiersc/mokoki/MokokiLogger.kt

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5a8c259

Please sign in to comment.