# Shipping

> Package and run on each platform from the Gradle modules — the end of the cycle.

Source: https://crossfly.dev/docs/learn/shipping — CrossFly documentation. Full docs as one file: https://crossfly.dev/llms-full.txt

# 12. Shipping

> **What you will learn:** close the cycle — package the app for each platform.
> **Prerequisites:** [Testing your app](/docs/learn/testing-your-app).

## Complete example (copy, paste and run)
The entry point that `Main` instantiates **by classname** (reflection, no-args constructor) — the same
`core` runs on the four launchers. This minimal, self-contained `MainWindow` is what each target packages.
Compiles as is.
```java
package com.exemplo;

import dev.crossfly.ui.*;
import dev.crossfly.ui.layout.*;

public class MainWindow extends Window
{
   @Override
   public void onShow() throws Exception
   {
      super.onShow();
      setLayout(new VerticalLayout());

      add(LAY_AUTO, new Label("Meu app CrossFly"));

      Button ola = new Button("Olá, mundo!");
      ola.onAction(c -> Hint.show("Rodando em todas as plataformas", 2000));
      add(LAY_AUTO, ola);
   }
}
```
> The snippets below show **only the core** (what goes inside `onShow()`). To run them, place them in the `MainWindow` skeleton above.

## One codebase, four targets
The same `core` runs on every launcher:
| Target | Build |
|---|---|
| 🖥️ Desktop | `gradlew :lwjgl3:run` (dev) / jar / installer |
| 🤖 Android | `gradlew :android:installDebug` / `assembleRelease` (AAB) |
| 🍎 iOS | `gradlew :ios:launchIPhoneSimulator` / `.ipa` (macOS+Xcode) |
| 🌐 Web | `gradlew :web:webBundle` → static content |

## What the bootstrap guarantees
`Main` instantiates your **`MainWindow` by *classname*** (reflection, no-args constructor) — the same on
every target. Icons and assets (Roboto/Material fonts are loaded at bootstrap) ship with the
package.

## "Ready to ship" checklist
- [ ] Tested (ch. 11) and responsive (ch. 10).
- [ ] Features unavailable per platform handled (see [matrix](/docs/platforms/overview)).
- [ ] Permissions: `AndroidManifest.xml` / `Info.plist`.
- [ ] Signing (Android keystore / iOS provisioning).
- [ ] Icons, *launch screen*, version.

## End of the course — what now?
You built an app that **opens, adds, navigates, persists, adapts and is tested** — and you
packaged it. From here:
- **Dig into the "why":** [`concepts/`](/docs/concepts).
- **Quality at scale:** [`best-practices/`](/docs/best-practices).
- **Detailed publishing:** [`platforms/`](/docs/platforms).
- **One-off tasks:** [`cookbook/`](/docs/cookbook) · [`ui/`](/docs/ui) · [`data-and-services/`](/docs/data-and-services).

## Recap
One `core`, four Gradle launchers; `MainWindow` by *classname*; a per-platform release checklist.

## See also
- [Build and distribution](/docs/platforms/building-and-releasing) · Canonical source: Chapter 4 §4.2
