Sync Kotlin files with an Xcode project

Overview

Kotlin Xcode Sync

Note Soon to be deprecated. You can add folder references instead. See here.

Import kotlin files into an Xcode project. This is used in conjunction with the Xcode Kotlin plugin to allow for Kotlin/Native debugging in an iOS application.

Importing Kotlin files into Xcode is somewhat tricky to do manually. This plugin will facilitate that.

It is called "Sync", but currently it will only add new files. Renamed or removed files will need to be handled manually in Xcode.

We're Hiring!

Touchlab is looking for Android-focused mobile engineers, experienced with Kotlin and looking to get involved with Kotlin Multiplatorm in the near future. More info here.

Usage

Add the following to the buildscript section:

buildscript {
    dependencies {
        classpath 'co.touchlab:kotlinxcodesync:0.2'
    }
}

Apply the plugin in the shared code project, and configure the plugin

apply plugin: 'co.touchlab.kotlinxcodesync'


xcodeSync {
  projectPath = "../../iosApp/iosApp.xcodeproj"
  target = "iosApp"
}

The 'projectPath' points at the Xcode project folder. 'target' is the target inside the Xcode project. There's also the optional parameter 'group', which by default is set to 'Kotlin'. That is the group folder that files are copied into.

Comments
  • Incompatibility with Jetbrains xcode-compat plugin

    Incompatibility with Jetbrains xcode-compat plugin

    Jetbrains publishes the xcode-compat plugin to ease some setup, including generating an Xcode project and auto-generating a buildForXcode gradle task. You can see it in-use in the AppCode new project templates.

    This plugin conflicts with it because they both define an extension named "xcode". As far as I know this means it's impossible to use both on the same project.

    opened by russhwolf 2
  • MacOS Catalina does weird things with paths

    MacOS Catalina does weird things with paths

    Adding files to Xcode produces some huge and apparently incorrect relative paths. See tail end of this: https://kotlinlang.slack.com/archives/C3SGXARS6/p1561103800227400

    opened by kpgalligan 1
  • Not able to run plugin without sudo (or rather install dependencies)

    Not able to run plugin without sudo (or rather install dependencies)

    My work laptop is partially locked and I can't use sudo to install xcodeproj globally. I can however use bundler to install it locally into vendor/bundle. So a workaround for me is to include a Gemfile in my project:

    gem 'xcodeproj', '1.7.0'
    

    Install it with bundle install --path vendor/bundle. And then modify plugin to change ruby build/projimport.rb for bundle exec ruby build/projimport.rb:

    ...
    val scriptArgs = mutableListOf(
            "exec",
            "ruby",
            "build/projimport.rb",
            config.projectPath!!,
            config.target!!,
            config.group,
            File(project.projectDir, "src").path)
    
        val std = ByteArrayOutputStream()
        val err = ByteArrayOutputStream()
        val result = projectExec(project,
            "bundle",
            null,
            scriptArgs,
            std,
            err
        )
    ...
    

    Would be good if the plugin could support this, either via a flag in plugin config or by scanning project files to check if a bundler is used. I could raise a PR if you could advice a preferred way to implement this.

    opened by aleksey-chugaev 0
  • Debug dependency sources

    Debug dependency sources

    After much research, importing dep sources is not that simple. The binaries are built with references to absolute source paths.

    For example, I built sqliter on this machine, so adding those exact source files allows the debugger to work, but adding the same files in a different folder does not. The absolute paths must be in the IR output, and would need a way to be changed.

    Possibly change KN compilation and include sources in the klib file.

    It's a lot of work and not just in this plugin (unless there's a way to alter the binary and change paths).

    opened by kpgalligan 0
  • Kotlin files are added to compile phase

    Kotlin files are added to compile phase

    Kotlin files are added as compile targets. We can turn that off and only the file to the group, but breakpoints don't work.

    Xcode doesn't attempt to compile Kotlin, so it doesn't impact functionality. However, there's a warning.

    warning: no rule to process file 'xxx' of type 'text' for architecture 'x86_64' (in target 'yyy')
    

    We should either figure out how to avoid adding files to compile, or a way to disable the error.

    opened by kpgalligan 0
AppCode helper for Kotlin/Native and Xcode

Kotlin Xcode compatibility Gradle plugin The plugin is used by AppCode to set up Kotlin/Native project along with Xcode Sources A multi-build sample w

Kotlin 21 Oct 23, 2022
Sync chat messages and various information on Telegram and Minecraft

Sync chat messages and various information on Telegram and Minecraft

雪沢 坊洛 6 Dec 1, 2022
Android project setup files when developing apps from scratch. The codebase uses lates jetpack libraries and MVVM repository architecture for setting up high performance apps

Android architecture app Includes the following Android Respository architecture MVVM Jepack libraries Carousel view Kotlin Kotlin Flow and Livedata P

null 2 Mar 31, 2022
Astha Nayak 4 Oct 10, 2022
Uproot-JS - Extract JavaScript files from burp suite project with ease

Extract JavaScript files from burp suite project with ease. Disclaimer I am not

Dexter0us 50 Aug 8, 2022
Kotlin and Java API for generating .swift source files.

SwiftPoet SwiftPoet is a Kotlin and Java API for generating .swift source files. Source file generation can be useful when doing things such as annota

Outfox 232 Jan 2, 2023
🛠️ The missing drawable toolbox for Android. Create drawables programmatically and get rid of the boring and always repeated drawable.xml files.

DrawableToolbox English | 中文 The missing DrawableToolbox for Android. Create drawables programmatically and get rid of the boring and always repeated

Hong Duan 1.1k Jan 4, 2023
This server uses json files to model items, entities and more.

Design Server | Simple server to design items, entities or more About this project/server: This server uses json files to model items, entities and mo

Phillipp Glanz 5 Jan 7, 2022
This program will read from your android application string.xml file and generate translated strings.xml files in your preferred languages using google sheet.

Localize your application content This program will read from your application string.xml file and generate translated strings.xml files in your prefe

DhiWise 4 Jul 29, 2022
Curations and configuration files for the OSS Review Toolkit.

ORT Config This repository contains configuration files for the OSS Review Toolkit. Content Curations The curations directory contains package curatio

OSS Review Toolkit 9 Dec 8, 2022
Open as default - A flutter plugin that allows setting up your flutter app to open files as default

open_as_default A flutter plugin that allows setting up your flutter app to open

LuisDeLaValier 3 Nov 15, 2022
SpyApp - The application launches dex files downloaded from the server

SpyApp The application downloads a dex file, which is then dynamically launched,

Vagiz Nasibullin 5 May 3, 2022
Flutter plugin that leverages Storage Access Framework (SAF) API to get access and perform the operations on files and folders

Flutter plugin that leverages Storage Access Framework (SAF) API to get access and perform the operations on files and folders.

Vehement 8 Nov 26, 2022
An experimental UI toolkit for generating PowerPoint presentation files using Compose

ComposePPT An experimental UI toolkit for generating PowerPoint presentation files(.pptx) using Compose. Inspired by Glance and Mosaic. Why? This proj

Fatih Giriş 252 Dec 28, 2022
Skeleton project for show the architecture of Android project using MVVM, Clean Architecture and Kotlin coroutine Flow

ClearScoreDemo Skeleton project for showing the architecture of Android project using MVVM, Clean architecture and Kotlin coroutine Flow App Architect

Plabon Modak 1 Mar 6, 2022
Real life Kotlin Multiplatform project with an iOS application developed in Swift with SwiftUI, an Android application developed in Kotlin with Jetpack Compose and a backed in Kotlin hosted on AppEngine.

Conferences4Hall Real life Kotlin Multiplatform project with an iOS application developed in Swift with SwiftUI, an Android application developed in K

Gérard Paligot 98 Dec 15, 2022
Kotlin-client-dsl - A kotlin-based dsl project for a (Client) -> (Plugin) styled program

kotlin-client-dsl a kotlin-based dsl project for a (Client) -> (Plugin) styled p

jackson 3 Dec 10, 2022
This is a first kotlin project

SmallPocket This is a first kotlin app, help user to save links easily, and can export to Evernote as weekly. Steps: copy link anywhere open SmallPock

KotlinChina 31 Dec 17, 2022
Create kotlin android project with one line of command.

README This is an android application template project built with kotlin language and some useful libraries. It provides a creator script to quickly c

nekocode 1.6k Dec 20, 2022