https://kotlinlang.org logo
#ios
Title
# ios
p

pardom

06/20/2019, 9:00 PM
Hey, all. Does anyone know how to set the framework name for multiplatform projects which use the cocoapods plugin?
f

fcosta

06/20/2019, 11:01 PM
I have this configuration in my project:
Copy code
targets {
        final def iOSTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") ? presets.iosArm64 : presets.iosX64

        fromPreset(iOSTarget, 'ios') {
            binaries {
                framework('client')
            }
        }
    }
👀 1
And this is the ouput
s

svyatoslav.scherbina

06/21/2019, 7:44 AM
This doesn’t work with CocoaPods plugin which creates frameworks internally.
i

ilya.matveev

06/21/2019, 8:17 AM
The framework name is based on a name of the Gradle project, so you can rename your Gradle project. Usually the project name equals to a name of a directory containing this project but you can change it without renaming the directory. If your project is a root one, just write the following line in your settings.gradle (see: https://mrhaki.blogspot.com/2009/11/gradle-goodness-changing-project-name.html):
Copy code
rootProject.name = "NewProjectName"
If your project is not a root one, it still can have a name other than a name of its directory. Just rename the project in settings.gradle and specify the old directory as its
projectDir
Copy code
include("NewProjectName")
project("NewProjectName").projectDir = "old/project/dir"
👍 1