Hey, all. Does anyone know how to set the framewor...
# ios
p
Hey, all. Does anyone know how to set the framework name for multiplatform projects which use the cocoapods plugin?
f
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
This doesn’t work with CocoaPods plugin which creates frameworks internally.
i
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