-
Notifications
You must be signed in to change notification settings - Fork 10
Build
To build Holtzman for native devices, we use the launch tool. It is documented in depth here, but we will just go over the information pertinent to Holtzman in this wiki.
Whether you are building for alpha, beta, or production, all of the following steps will be the same, even though the variables may change.
To ensure a clean build containing the code that you want, clean up your environment prior to doing a build.
rm -rf .meteor/local
rm -rf .build
rm -rf node_modules && npm installMake sure you have the proper Meteor settings located at .meteor/settings.json. These settings are available in our private settings repo.
Some things to look out for, though not the exhaustive list of settings, are:
- Correct Google Analytics code
- Correct Heighliner url
- Private and public Rock tokens
- Environment specific settings (Hockey, Lookback, etc.)
Version and build numbers are tracked in mobile-config.js. There are 3 things you need to be aware of during building:
- App.info id
- App.info version
- App.info buildNumber
Unfortunately, our iOS and Android builds have different unique ids. This is because we created the Google Play application ourselves, but we transferred our iOS application from a third-party and inherited their unique id. For alpha and beta environments, you won't need to worry about this. But for production, you will need to do a separate builds for Android and iOS. It may be possible to change the IDs after build, but I normally just do two separate builds to be sure.
Google Play ID: cc.newspring.newspringapp Apple App Store Beta: cc.newspring.newspringapp Apple App Store Production: com.subsplashstudio31.NewSpring-Church
npm install -g meteor-launchLaunch takes it's own set of variables for building and deploying the project. It is also available in the private settings repo, and should be copied locally to launch.json in the project root.
After copying, you should change the APPLE_ID attribute to be the email address associated with your Apple developer account. You should also add an attribute named FASTLANE_PASSWORD with your Apple ID password, or you will be asked to enter it every time you try to upload to TestFlight/App Store.
In order to sign the Xcode project, and generate an IPA file for upload, you should install the distribution.p12 certificate on your Mac. You can do this grabbing it from the private settings repo and double-clicking it, which should open the "Keychain Access" application. You want to choose the login keychain. The certificate placed in your keychain should contain a private key named "NewSpring App" if you click the down arrow.
In order to sign the Android APKs for upload, you should copy the androidkey file from the private settings repo, and place it in your $HOME directory as .keystore. So, ~/.keystore.
I'm not sure what the process for this is quite yet, but surely there are some certificates. Once obtained, make sure they are placed in the private settings repo, and add instructions for where to place them.
The launch build command will build the project in to the .build folder in the project root directory, including:
- server tarball (
.build/Holtzman.tar.gz) - iOS project (
.build/ios) - Android project (
.build/android)
Holtzman uses the environment variables NATIVE and WEB to distinguish between the two environments. It's possible to add this to your launch.json file, as launch passes through all of those variables as environment variables to the meteor build tool, but I recommend just prepending the launch command with the version you want. This will prevent confusion around which version is getting built.
You also need to pass the url that the native server will be deployed to, and the path to the settings file.
NATIVE=true launch build https://alpha-app.newspring.io .meteor/settings.jsonCURRENT ANDROID ISSUE
Somewhere in the meteor build process, support for the Crosswalk web view when building as become inconsistent. There are open issues on the Meteor repo, but the launch issue is here:
https://github.com/NewSpring/meteor-launch/issues/102
Basically, the android APKs aren't always generated for some reason. You can get around this by running some additional commands:
rm .build/android/project/AndroidManifest.xml
mv .meteor/local/cordova-build/platforms/android/AndroidManifest.xml ./.build/android/project
./.build/android/project/cordova/build --release
mv ./.build/android/project/build/outputs/apk/project-armv7-release-unsigned.apk ./.build/android/project/build/outputs/apk/android-armv7-release-unsigned.apk
mv ./.build/android/project/build/outputs/apk/project-x86-release-unsigned.apk ./.build/android/project/build/outputs/apk/android-x86-release-unsigned.apk...or, by just running the launch build command a second time. Hopefully, Meteor will be able to fix this issue, but if not we should add it in to the launch project to simplify things.
No additional steps are needed for the iOS project as launch will take care of the signing for you. But for Android, you need one more step:
launch prepareThis will take the APKs out of a deeply nested folder, sign and align them, and place them in .build/android for you.