File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
src/macosMain/kotlin/co/touchlab/xcode/cli Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,17 @@ import co.touchlab.xcode.cli.util.Path
77object LangSpecManager {
88 private val specName = " Kotlin.xclangspec"
99 private val specSourceFile = File (Path .dataDir / specName)
10- private val specTargetFile = File (XcodeHelper .xcodeLibraryPath / " Specifications" / specName)
10+ private val specsDirectory = File (XcodeHelper .xcodeLibraryPath / " Specifications" )
11+ private val specTargetFile = File (specsDirectory.path / specName)
1112 private val logger = Logger .withTag(" LangSpecManager" )
1213
1314 val isInstalled: Boolean
1415 get() = specTargetFile.exists()
1516
1617 fun install () {
1718 check(! specTargetFile.exists()) { " Language spec file exists at path ${specTargetFile.path} ! Delete it first." }
19+ logger.v { " Ensuring language specification directory exists at ${specsDirectory.path} " }
20+ specsDirectory.mkdirs()
1821 logger.v { " Copying language specification to target path ${specTargetFile.path} " }
1922 specSourceFile.copy(specTargetFile.path)
2023 }
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ import co.touchlab.xcode.cli.util.fromString
1111object PluginManager {
1212 val pluginName = " Kotlin.ideplugin"
1313 val pluginSourceFile = File (Path .dataDir / pluginName)
14- val pluginTargetFile = File (XcodeHelper .xcodeLibraryPath / " Plug-ins" / pluginName)
14+ val pluginsDirectory = File (XcodeHelper .xcodeLibraryPath / " Plug-ins" )
15+ val pluginTargetFile = File (pluginsDirectory.path / pluginName)
1516
1617 private val pluginSourceInfoFile = File (pluginSourceFile.path / " Contents" / " Info.plist" )
1718 private val pluginTargetInfoFile = File (pluginTargetFile.path / " Contents" / " Info.plist" )
@@ -50,6 +51,8 @@ object PluginManager {
5051 }
5152
5253 fun install (xcodeInstallations : List <XcodeHelper .XcodeInstallation >) {
54+ logger.v { " Ensuring plugins directory exists at ${pluginsDirectory.path} " }
55+ pluginsDirectory.mkdirs()
5356 logger.v { " Copying Xcode plugin to target path ${pluginTargetFile.path} " }
5457 pluginSourceFile.copy(pluginTargetFile.path)
5558 sync(xcodeInstallations)
You can’t perform that action at this time.
0 commit comments