Skip to content

Commit a877b6d

Browse files
committed
Add mention of customizing the package name for an app
1 parent 2d374a3 commit a877b6d

2 files changed

Lines changed: 36 additions & 34 deletions

File tree

src/content/docs/docs/development-topics.md renamed to src/content/docs/docs/development-topics.mdx

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ permalink: /docs/development-topics/
44

55
---
66

7+
import { Tabs, TabItem } from '@astrojs/starlight/components';
8+
79
This chapter covers how to perform a variety of common development tasks across platforms with Skip.
810

911
## Configuration with `Skip.env`
@@ -12,6 +14,37 @@ Skip app customization should be primarily done by directly editing the included
1214

1315
---
1416

17+
## Customizing Module Package Name {#package-name}
18+
19+
20+
By default, Skip generates a Java/Kotlin package name for your module based on its Swift name, by simply de-camel-casing and dot-separating the module name (e.g. `MyAppModule` becomes `my.app.module`). You may want to customize this package name if you need to match a specific naming convention or when integrating with third-party Android libraries that expect a particular package structure.
21+
22+
You can customize this package name by editing the module's `Skip/skip.yml` file and adding a `package` property under the `skip` group. You must also update your project's `Skip.env` file to specify the new package name in the `ANDROID_PACKAGE_NAME` variable. This ensures that the generated `AndroidManifest.xml` and other project metadata correctly reference your new package.
23+
24+
<Tabs>
25+
<TabItem label="Sources/MyAppModule/Skip/skip.yml">
26+
```yaml
27+
# The Skip configuration for MyAppModule
28+
skip:
29+
package: 'my.custom.package.name'
30+
```
31+
</TabItem>
32+
<TabItem label="Skip.env">
33+
```text
34+
// The package name for the Android entry point, referenced by the AndroidManifest.xml
35+
ANDROID_PACKAGE_NAME = my.custom.package.name
36+
```
37+
</TabItem>
38+
<TabItem label="Android/app/src/main/kotlin/Main.kt">
39+
```kotlin
40+
// the Kotlin Main.kt entry point to the Android app
41+
package my.custom.package.name
42+
```
43+
</TabItem>
44+
</Tabs>
45+
46+
---
47+
1548
## Localization
1649

1750
Localizing your app into multiple languages gives it the maximum possible reach. Localization is a critical part of making your app accessible to users all around the world. Skip helps unlock the promise of true universality for your app by bringing SwiftUI to Android, but the other half of the equation is ensuring that your users can understand the content of your app.
@@ -63,40 +96,6 @@ The result is that by updating this single file, you can localize your app into
6396
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/zh/android/welcome_dark_framed.png" />
6497
</div>
6598

66-
<!--
67-
<div class="localization-screenshot-container">
68-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/en/ios/home_light_framed.png" />
69-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/fr/ios/home_dark_framed.png" />
70-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/es/ios/home_light_framed.png" />
71-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/ja/ios/home_dark_framed.png" />
72-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/zh/ios/home_light_framed.png" />
73-
</div>
74-
<div class="localization-screenshot-container">
75-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/en/android/home_dark_framed.png" />
76-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/fr/android/home_light_framed.png" />
77-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/es/android/home_dark_framed.png" />
78-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/ja/android/home_light_framed.png" />
79-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/zh/android/home_dark_framed.png" />
80-
</div>
81-
-->
82-
83-
<!--
84-
<div class="localization-screenshot-container">
85-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/en/ios/settings_light_framed.png" />
86-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/fr/ios/settings_dark_framed.png" />
87-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/es/ios/settings_light_framed.png" />
88-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/ja/ios/settings_dark_framed.png" />
89-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/zh/ios/settings_light_framed.png" />
90-
</div>
91-
<div class="localization-screenshot-container">
92-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/en/android/settings_dark_framed.png" />
93-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/fr/android/settings_light_framed.png" />
94-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/es/android/settings_dark_framed.png" />
95-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/ja/android/settings_light_framed.png" />
96-
<img alt="Localization screenshot" src="https://assets.skip.dev/hello/zh/android/settings_dark_framed.png" />
97-
</div>
98-
-->
99-
10099
### The `xcstrings` Format {#xcstrings}
101100

102101
The Skip plugin handles the `.xcstrings` localization format, which is used by Xcode 15 as a single source of truth for the app's localization. The default project created by `skip init --appid=… hello-skip HelloSkip` will create a `Sources/HelloSkip/Resources/Localizable.xcstrings` file which can be used as a starting point for adding new languages and string translations to your project.

src/content/docs/docs/faq.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ Swift dependencies are added by editing the `Package.swift` to add dependent pac
166166
The Xcode "Add Package Dependencies…" menu should *not* be used to add Swift dependencies, as it will not update the `Package.swift` file that Skip needs to build the dependencies for Android. Dependencies must be added directly to the `Package.swift` file.
167167
:::
168168

169+
### How do I change the Java/Kotlin package name for my app or module? {#package-name}
170+
171+
The Java/Kotlin package name can be customized by adding a `package: 'my.module.name'` property to the `skip` group in your module's `Skip/skip.yml` file. See the [Customizing Module Package Name](/docs/development-topics/#package-name) documentation for more details and important instructions for top-level application modules.
169172

170173
### How does logging work in Skip? {#logging}
171174

0 commit comments

Comments
 (0)