Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build both debug and release versions of the library? #8

Open
chokokatana opened this issue Sep 22, 2023 · 1 comment
Open

Comments

@chokokatana
Copy link

I'm trying to create two binary version of the library, one with debug info, and the other without. I've tried to use twice the multiplatformSwiftPackage gradle option like this:

multiplatformSwiftPackage {
    packageName("$customIosName-release")
    outputDirectory(File(projectDir, "../dist-ios"))
    swiftToolsVersion("5.5")
    distributionMode { local() }
    targetPlatforms {
        iOS { v("15") }
    }
    buildConfiguration {
        release()
    }
}

multiplatformSwiftPackage {
    packageName("$customIosName-debug")
    outputDirectory(File(projectDir, "../dist-ios"))
    swiftToolsVersion("5.5")
    distributionMode { local() }
    targetPlatforms {
        iOS { v("15") }
    }
    buildConfiguration {
        debug()
    }
}

It seems the second block overrides the first. So right now I need to build one configuration, then change gradle, build the other one, and restore the original one for git to not complain.

Is there a better way to do this?

@luca992
Copy link
Owner

luca992 commented Sep 22, 2023

hmm... A hacky way you could probably do something like that. is surround them with an if or case statement activated by a boolean... where the boolean is updated in a gradle task according to the build type release or debug. If you want to write a pr to add support for that be my guest 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants