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

Build all possible targets #2

Merged
merged 1 commit into from
Jan 19, 2023
Merged

Build all possible targets #2

merged 1 commit into from
Jan 19, 2023

Conversation

JakeWharton
Copy link
Contributor

Previously only a single native target was built and it depended on the user's host machine OS (0.1 in Maven Central only supprots linux64). This enables all targets supported per https://kotlinlang.org/docs/multiplatform-dsl-reference.html#targets.

Unfortunately this requires deploying from two OSes: Mac OS and Linux.

  • If you deploy from Mac OS every target is built except for linuxMips32 and linuxMipsel32. These can be published to Sonatype as part of a separate call to

    ./gradlew \
        publishLinuxMips32PublicationToSonatypeRepository \
        publishLinuxMipsel32PublicationToSonatypeRepository`
    

    and then both repositories closed & released at once.

  • If you deploy from Linux none of the Mac OS targets are built. They can be published to Sonatype as part of a separate call to

    ./gradlew \
        publishIosArm32PublicationToSonatypeRepository \
        publishIosArm64PublicationToSonatypeRepository \
        publishIosSimulatorArm64PublicationToSonatypeRepository \
        publishIosX64PublicationToSonatypeRepository \
        publishMacosArm64PublicationToSonatypeRepository \
        publishMacosX64PublicationToSonatypeRepository \
        publishTvosArm64PublicationToSonatypeRepository \
        publishTvosSimulatorArm64PublicationToSonatypeRepository \
        publishTvosX64PublicationToSonatypeRepository \
        publishWatchosArm32PublicationToSonatypeRepository \
        publishWatchosArm64PublicationToSonatypeRepository \
        publishWatchosDeviceArm64PublicationToSonatypeRepository \
        publishWatchosSimulatorArm64PublicationToSonatypeRepository \
        publishWatchosX64PublicationToSonatypeRepository \
        publishWatchosX86PublicationToSonatypeRepository
    

    and then both repositories closed & released at once.

Previously only a single native target was built and it depended on the user's host machine OS
(0.1 in Maven Central only supprots `linux64`).
This enables all targets supported per https://kotlinlang.org/docs/multiplatform-dsl-reference.html#targets.

Unfortunately this requires deploying from two OSes: Mac OS and Linux.

 -  If you deploy from Mac OS every target is built except for `linuxMips32` and `linuxMipsel32`.
    These can be published to Sonatype as part of a separate call to

        ./gradlew \
            publishLinuxMips32PublicationToSonatypeRepository \
            publishLinuxMipsel32PublicationToSonatypeRepository`

    and then both repositories closed & released at once.

 -  If you deploy from Linux none of the Mac OS targets are built.
    They can be published to Sonatype as part of a separate call to

        ./gradlew \
            publishIosArm32PublicationToSonatypeRepository \
            publishIosArm64PublicationToSonatypeRepository \
            publishIosSimulatorArm64PublicationToSonatypeRepository \
            publishIosX64PublicationToSonatypeRepository \
            publishMacosArm64PublicationToSonatypeRepository \
            publishMacosX64PublicationToSonatypeRepository \
            publishTvosArm64PublicationToSonatypeRepository \
            publishTvosSimulatorArm64PublicationToSonatypeRepository \
            publishTvosX64PublicationToSonatypeRepository \
            publishWatchosArm32PublicationToSonatypeRepository \
            publishWatchosArm64PublicationToSonatypeRepository \
            publishWatchosDeviceArm64PublicationToSonatypeRepository \
            publishWatchosSimulatorArm64PublicationToSonatypeRepository \
            publishWatchosX64PublicationToSonatypeRepository \
            publishWatchosX86PublicationToSonatypeRepository

    and then both repositories closed & released at once.
@JakeWharton
Copy link
Contributor Author

Alternatively, we could drop Linux MIPS support (I've never seen them used) and that would allow all targets to be deployed from Mac / Mac CI worker.

I can't use the library without at least some of these targets added. A safe subset is to match kotlinx.coroutines's list. These can all be built from a Mac worker.

@cketti cketti merged commit 748ad6c into cketti:main Jan 19, 2023
@cketti
Copy link
Owner

cketti commented Jan 19, 2023

Thanks!

I guess a GitHub workflow to build the artifacts for all platforms is the easiest way to go. Any suggestion on where I can find a working config to copy?

@JakeWharton
Copy link
Contributor Author

The ones in Turbine are pretty simple: https://github.com/cashapp/turbine/tree/trunk/.github/workflows

If you're going to include the Linux MIPS targets you'll need two jobs, one on Mac and one on Linux. We do this on a few projects, too. I'll have to find one when I get to a computer.

@JakeWharton JakeWharton deleted the jw.all-targets.2023-01-18 branch January 19, 2023 14:55
@JakeWharton
Copy link
Contributor Author

I didn't even commit the MIPS targets 🤦 . I would say let's go without them for now unless someone comes complaining for them.

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

Successfully merging this pull request may close these issues.

None yet

2 participants