Controlling uploaded files
When you run the command shipthis game ship your game files are selected, compressed into a zip, and uploaded to the backend.
ShipThis gives you full control over which files get uploaded by using globs in your project config file shipthis.json.
A glob is a way of pattern matching on file names. It is a string which includes special wildcard characters which match on multiple files.
Some examples:
**/*matches all filesandroid/**matches everything inandroid*.ipamatches IPA files.gradle/**matches everything in.gradle
Read more about globs on Wikipedia https://en.wikipedia.org/wiki/Glob_(programming)
How the globs are used
The shipthis.json file will contains a "globs" value which should look something like:
{
"globs": {
"base": {
"include": ["**/*"],
"exclude": ["...common ignores..."]
},
"android": {
"exclude": ["ios/**", "*.ipa", "*.xcarchive"]
},
"ios": {
"exclude": ["android/**", "*.apk", "*.aab", ".gradle/**"]
}
}
}
This "globs" value has base values which are always used and then platform-specific values which are used when the tool is only building for those platforms.
Each has an "include" and an "exclude" - these are arrays of globs. When they are used, the "include" values are used first, and then "exclude" values are used to remove items.
When you run shipthis game ship the tool does the following:
- Determines which platform(s) are selected
- If you specify a platform with the
--platformoption or if you have only configured a single platform then this is the selected platform. - If you have configured both platforms, and are not specifying a platform then both are selected.
- Collects the base glob rules and the rules for the selected platform(s)
- Uses the globs to find all of the matching files
- Zips, uploads, runs the build.
Examples
shipthis game ship --platform ios- This will use "base" and then "ios"
shipthis game ship --platform android- This will use "base" and then "android"
shipthis game shipwith no--platform- Checks which platforms you have configured
Upgrading from legacy globs
Previous versions of shipthis used a different format for these rules. Without the platform specific features.
Legacy projects may still use:
shippedFilesGlobs(include rules - equivalent ofglobs.base.include)ignoredFilesGlobs(exclude rules - equivalent ofglobs.base.exclude)
Good news! If you have not edited these values in your shipthis.json file then shipthis will use the new default values for globs which include platform specific excludes to reduce the size of uploaded files and speed up builds.
If your shipthis.json file contains the old-format (legacy) globs then shipthis will display one of the following messages:
Warning "Using legacy default globs"
This is displayed if you have NOT changed shippedFilesGlobs or ignoredFilesGlobs. To make the message go away, you can run:
This will overwrite your shipthis.json file with an updated version of the file which includes the new glob format.
Warning "Using legacy custom file selection globs - you should upgrade to the new globs"
This warning is displayed if shipthis detects that you HAVE edited the shippedFilesGlobs or ignoredFilesGlobs values. In this scenario, shipthis will use your shippedFilesGlobs and ignoredFilesGlobs. You should manually apply your custom globs to the new format shipthis.json file by referring to the example above.