Skip to content

Getting started (new developer)

Andrew Leader edited this page Nov 19, 2022 · 11 revisions

Here's detailed instructions on how to set up a fresh machine (assuming a Windows PC, not Mac) to build Power Planner.

1. Install Visual Studio 2022

The community version should be fine. When installing, make sure to select the following two workloads...

  • Universal Windows Platform
  • Mobile development with .NET (Xamarin)

Workloads

That's it!

Optional: Enable Windows Hyper-V

If you're going to build the Android app AND want to use the emulator rather than your physical device, you need to enable Hyper-V...

  1. Open Start, search for "Turn Windows features on or off"
  2. Enable "Windows Hypervisor Platform"

2. Install GitHub for Desktop

This is sometimes my preferred Git client, you can use something else if you'd like. Install it here: https://desktop.github.com/

3. Install git

You'll need command-line git access, so install git if you haven't: https://git-scm.com/downloads

REBOOT after installation, otherwise git won't be in your command path.

4. Clone repository

Go to https://github.com/powerplanner/powerplannerapps and click Clone or Download and then click Open in Desktop. Complete cloning in the desktop app.

5. Create a topic branch

Create a new branch for your work. The most popular naming convention is yourusername/yourfeature.

image

6. Clone submodules

In the GitHub Desktop app, go to Repository -> Open in Command Prompt

image

Then, in the command prompt, type

git submodule update --init --recursive

Go ahead and close the command prompt.

7. Apply secrets

First, you have to allow PowerShell scrips on your PC...

Open PowerShell as an admin, and execute...

Set-ExecutionPolicy -ExecutionPolicy Unrestricted

Then, in the GitHub Desktop app, go to Repository -> Show in Explorer

image

Then, right click ApplySecrets.ps1 and click Run with PowerShell.

image

8. Open the solution

Launch PowerPlannerApps.sln (ignore the UWP solution, even if you're developing UWP, it's just for the build server).

9. Select startup project and deploy!

image

Make sure correct configuration and start up project is selected. You'll be able to build and deploy Android and Windows (UWP), but you won't be able to build or deploy iOS (that requires a Mac computer).

UWP

  1. Set the start up project to PowerPlannerUWP (Universal Windows), and ensure the build config is set to Debug and architecture is one of x86 or x64
  2. Click Local Machine to deploy!

Android

  1. Set the start up project to PowerPlannerDroid, and ensure the build config is set to Debug (Droid) (important that it must be the (Droid) config) and architecture is Any CPU
  2. Click Local Machine to deploy!

iOS

  1. Set the start up project to PowerPlanneriOS, and ensure the build config is set to Debug and architecture is Any CPU
  2. Note that you'll also need a Mac paired with Visual Studio for Mac and XCode
  3. Click Local Machine to deploy!