Skip to content

Commit

Permalink
Merge pull request #107 from touchlab/paraselene-main
Browse files Browse the repository at this point in the history
Paraselene main
  • Loading branch information
kpgalligan authored Mar 14, 2024
2 parents 8720965 + cc20f9e commit 595d5b0
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
16 changes: 16 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ The xcode-kotlin plugin is written in **Kotlin**. It uses

Building environment: **IntelliJ IDEA**

## Build Local Development Version

As this is a tool for Xcode, you'll need to run the build on a mac machine. We'll assume your machine is an ARM, Mx
chip and not Intel. Replace the calls with X64 versions if needed.

To build, open a terminal in the root project folder and run:

```shell
./gradlew preparePlugin linkDebugExecutableMacosArm64
```

To test the local build, run the following:

```shell
./build/bin/macosArm64/debugExecutable/xcode-kotlin.kexe [command]
```

## Libraries

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = "co.touchlab"
version = "1.3.0"
version = "1.3.1"

kotlin {
listOf(macosX64(), macosArm64()).forEach {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kotlinx-coroutines = "1.7.3"
kotlinx-cli = "0.3.6"
kotlinx-serialization = "1.6.0"
kermit = "1.2.2"
gradle-doctor = "0.8.1"
gradle-doctor = "0.9.2"

[libraries]
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ object PluginManager {

Console.echo("Synchronizing plugin compatibility list.")
val additionalPluginCompatibilityIds =
xcodeInstallations.map { PropertyList.Object.String(it.pluginCompatabilityId) }
xcodeInstallations.mapNotNull { it.pluginCompatabilityId?.let { PropertyList.Object.String(it) } }
logger.v { "Xcode installation IDs to include: ${additionalPluginCompatibilityIds.joinToString { it.value }}" }
val infoPlist = PropertyList.create(pluginTargetInfoFile)
val rootDictionary = infoPlist.root.dictionary
Expand Down
12 changes: 11 additions & 1 deletion src/macosMain/kotlin/co/touchlab/xcode/cli/XcodeHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import co.touchlab.xcode.cli.XcodeHelper.Defaults.nonApplePlugins
import co.touchlab.xcode.cli.util.BackupHelper
import co.touchlab.xcode.cli.util.Console
import co.touchlab.xcode.cli.util.File
import co.touchlab.xcode.cli.util.fromString
import co.touchlab.xcode.cli.util.Path
import co.touchlab.xcode.cli.util.PropertyList
import co.touchlab.xcode.cli.util.Shell
import co.touchlab.xcode.cli.util.Version
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.Json
Expand Down Expand Up @@ -83,6 +85,14 @@ object XcodeHelper {
checkNotNull(versionPlist.build?.trim()) { "Couldn't get build number of Xcode at $path." }
}

if (Version.fromString(version) >= Version.fromString("15.3")) {
return XcodeInstallation(
version = version,
build = build,
path = path
)
}

val xcodeInfoPath = path / "Contents" / "Info"
val pluginCompatabilityIdResult = Shell.exec("/usr/bin/defaults", "read", xcodeInfoPath.value, "DVTPlugInCompatibilityUUID")
.checkSuccessful {
Expand Down Expand Up @@ -154,7 +164,7 @@ object XcodeHelper {
val version: String,
val build: String,
val path: Path,
val pluginCompatabilityId: String,
val pluginCompatabilityId: String? = null,
) {
val name: String = "Xcode $version ($build)"
}
Expand Down

0 comments on commit 595d5b0

Please sign in to comment.