Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename KMM to KMP #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
[![Homebrew](https://badgen.net/homebrew/v/kdoctor)](https://formulae.brew.sh/formula/kdoctor)

KDoctor is a command-line tool that helps to set up the environment for [Kotlin Multiplatform Mobile](https://kotlinlang.org/lp/mobile/) app development.
KDoctor is a command-line tool that helps to set up the environment for [Kotlin Multiplatform](https://kotlinlang.org/lp/mobile/) app development.

![](https://github.com/Kotlin/kdoctor/raw/master/img/screen_1.jpg)

Expand All @@ -14,7 +14,7 @@ If something is missed or not configured, KDoctor highlights the problem and sug
KDoctor runs the following diagnostics:
* System - checks an operating system version
* JDK - checks that JDK installation and JAVA_HOME setting
* Android Studio - checks Android Studio installation, Kotlin and Kotlin Multiplatform Mobile plugins
* Android Studio - checks Android Studio installation, Kotlin and Kotlin Multiplatform plugins
* Xcode - checks Xcode installation and setup
* CocoaPods - checks ruby environment and cocoapods gem installation

Expand Down Expand Up @@ -57,13 +57,13 @@ Call KDoctor in the console and wait till it completes the diagnostics

```
kdoctor
Diagnosing Kotlin Multiplatform Mobile environment...
Diagnosing Kotlin Multiplatform environment...
```

Once KDoctor finishes the diagnostics, it yields a report. If no problems are found your system is ready for Kotlin Multiplatform Mobile development:
Once KDoctor finishes the diagnostics, it yields a report. If no problems are found your system is ready for Kotlin Multiplatform development:

```
Your system is ready for Kotlin Multiplatform Mobile Development!
Your system is ready for Kotlin Multiplatform Development!
```

If KDoctor notifies that there are problems, please review the report:
Expand Down Expand Up @@ -116,12 +116,12 @@ Environment diagnose:
Location: /Users/me/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.9445173/Android Studio Preview.app
Bundled Java: openjdk 17.0.4.1 2022-08-12
Kotlin Plugin: 222-1.8.0-release-AS3739.54
Kotlin Multiplatform Mobile Plugin: 1.0.0-SNAPSHOT
Kotlin Multiplatform Plugin: 1.0.0-SNAPSHOT
➤ Android Studio (AI-221.6008.13.2211.9477386)
Location: /Users/me/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-2/221.6008.13.2211.9477386/Android Studio.app
Bundled Java: openjdk 11.0.15 2022-04-19
Kotlin Plugin: 221-1.7.21-release-for-android-studio-AS5591.52
Kotlin Multiplatform Mobile Plugin: 0.5.2(221)-3
Kotlin Multiplatform Plugin: 0.5.2(221)-3
i Note that, by default, Android Studio uses bundled JDK for Gradle tasks execution.
Gradle JDK can be configured in Android Studio Preferences under Build, Execution, Deployment -> Build Tools -> Gradle section

Expand All @@ -140,7 +140,7 @@ Recommendations:
➤ IDE doesn't suggest running all tests in file if it contains more than one class
More details: https://youtrack.jetbrains.com/issue/KTIJ-22078
Conclusion:
✓ Your system is ready for Kotlin Multiplatform Mobile Development!
✓ Your system is ready for Kotlin Multiplatform Development!
```

## Issue Tracker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Doctor(private val system: System) {
send(" Please check the output for problem description and possible solutions.\n")
} else {
val prefix = " ${DiagnosisResult.Success.color}${DiagnosisResult.Success.symbol}${TextPainter.RESET} "
send("${prefix}Your operation system is ready for Kotlin Multiplatform Mobile Development!\n")
send("${prefix}Your operation system is ready for Kotlin Multiplatform Development!\n")
}
}.buffer(0).flowOn(Dispatchers.Default)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.jetbrains.kotlin.doctor.diagnostics

import co.touchlab.kermit.Logger
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import org.jetbrains.kotlin.doctor.entity.*

Expand Down Expand Up @@ -64,15 +63,16 @@ class AndroidStudioDiagnostic(private val system: System) : Diagnostic() {
studioInstallations.forEach { app ->
val androidStudio = AppManager(system, app)
val kotlinPlugin = androidStudio.getPlugin(AppManager.KOTLIN_PLUGIN)
val kmmPlugin = androidStudio.getPlugin(AppManager.KMM_PLUGIN)
// TODO: This is why we should not rename "kmm" to "kmp"
val kmmPlugin = androidStudio.getPlugin(AppManager.KMP_PLUGIN)
val embeddedJavaVersion = androidStudio.getEmbeddedJavaVersion()

val message = """
Android Studio (${app.version})
Location: ${app.location}
Bundled Java: ${embeddedJavaVersion ?: "not found"}
Kotlin Plugin: ${kotlinPlugin?.version ?: "not installed"}
Kotlin Multiplatform Mobile Plugin: ${kmmPlugin?.version ?: "not installed"}
Kotlin Multiplatform Plugin: ${kmmPlugin?.version ?: "not installed"}
""".trimIndent()
result.addEnvironment(*buildSet {
add(EnvironmentPiece.AndroidStudio(app.version))
Expand All @@ -97,14 +97,14 @@ class AndroidStudioDiagnostic(private val system: System) : Diagnostic() {
if (kmmPlugin == null) {
result.addWarning(
message,
"Install Kotlin Multiplatform Mobile plugin - https://plugins.jetbrains.com/plugin/14936-kotlin-multiplatform-mobile"
"Install Kotlin Multiplatform plugin - https://plugins.jetbrains.com/plugin/14936-kotlin-multiplatform-mobile"
)
return@forEach
}
if (!kmmPlugin.isEnabled) {
result.addWarning(
message,
"Kotlin Multiplatform Mobile plugin is disabled. Enable Kotlin Multiplatform Mobile in Android Studio settings."
"Kotlin Multiplatform plugin is disabled. Enable Kotlin Multiplatform in Android Studio settings."
)
return@forEach
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class AppManager(

companion object {
const val KOTLIN_PLUGIN = "Kotlin"
const val KMM_PLUGIN = "kmm"
// TODO: Should not be renamed yet
const val KMP_PLUGIN = "kmm"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AndroidStudioDiagnosticTest {
"Location: /Users/my/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4345.14.2221.9252092/Android Studio Preview.app",
"Bundled Java: openjdk version \"11.0.16\" 2022-07-19 LTS",
"Kotlin Plugin: 1.7.20",
"Kotlin Multiplatform Mobile Plugin: 0.5.0"
"Kotlin Multiplatform Plugin: 0.5.0"
)
addInfo(
"Note that, by default, Android Studio uses bundled JDK for Gradle tasks execution.",
Expand Down Expand Up @@ -72,7 +72,7 @@ class AndroidStudioDiagnosticTest {
"Location: /Users/my/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4345.14.2221.9252092/Android Studio Preview.app",
"Bundled Java: openjdk version \"11.0.16\" 2022-07-19 LTS",
"Kotlin Plugin: 1.7.20",
"Kotlin Multiplatform Mobile Plugin: 0.5.0",
"Kotlin Multiplatform Plugin: 0.5.0",
"Kotlin plugin is disabled. Enable Kotlin in Android Studio settings."
)
addInfo(
Expand All @@ -90,7 +90,7 @@ class AndroidStudioDiagnosticTest {
}

@Test
fun `check no KMM plugin`() {
fun `check no KMP plugin`() {
val system = object : BaseTestSystem() {
override fun executeCmd(cmd: String): ProcessResult = when (cmd) {
"find $homeDir/Library/Application Support/Google/data/Directory/Name/plugins/kmm/lib -name \"*.jar\"" -> {
Expand All @@ -108,8 +108,8 @@ class AndroidStudioDiagnosticTest {
"Location: /Users/my/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4345.14.2221.9252092/Android Studio Preview.app",
"Bundled Java: openjdk version \"11.0.16\" 2022-07-19 LTS",
"Kotlin Plugin: 1.7.20",
"Kotlin Multiplatform Mobile Plugin: not installed",
"Install Kotlin Multiplatform Mobile plugin - https://plugins.jetbrains.com/plugin/14936-kotlin-multiplatform-mobile"
"Kotlin Multiplatform Plugin: not installed",
"Install Kotlin Multiplatform plugin - https://plugins.jetbrains.com/plugin/14936-kotlin-multiplatform-mobile"
)
addInfo(
"Note that, by default, Android Studio uses bundled JDK for Gradle tasks execution.",
Expand Down Expand Up @@ -176,7 +176,7 @@ class AndroidStudioDiagnosticTest {
"Location: /Users/my/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4345.14.2221.9252092/Android Studio Preview.app",
"Bundled Java: openjdk version \"11.0.16\" 2022-07-19 LTS",
"Kotlin Plugin: not installed",
"Kotlin Multiplatform Mobile Plugin: 0.5.0",
"Kotlin Multiplatform Plugin: 0.5.0",
"Install Kotlin plugin - https://plugins.jetbrains.com/plugin/6954-kotlin"
)
addEnvironment(
Expand All @@ -188,7 +188,7 @@ class AndroidStudioDiagnosticTest {
"Location: /Users/my/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-1/213.7172.25.2113.9123335/Android Studio.app",
"Bundled Java: not found",
"Kotlin Plugin: 1.7.20",
"Kotlin Multiplatform Mobile Plugin: 0.5.0"
"Kotlin Multiplatform Plugin: 0.5.0"
)
addEnvironment(
EnvironmentPiece.AndroidStudio(Version("AI-213.7172.25.2113.9123335")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MacosSystem : System {
}
override val shell: Shell? by lazy {
getEnvVar("SHELL")?.let { shellPath ->
Shell.values().firstOrNull { it.path == shellPath }
Shell.entries.firstOrNull { it.path == shellPath }
}
}

Expand Down