diff --git a/docs/source/docs/contributing/building-photon.md b/docs/source/docs/contributing/building-photon.md index fe0cc86925..6f23b4802d 100644 --- a/docs/source/docs/contributing/building-photon.md +++ b/docs/source/docs/contributing/building-photon.md @@ -137,6 +137,8 @@ An architecture override is required to specify the deploy target's architecture The `deploy` command is tested against Raspberry Pi coprocessors. Other similar coprocessors may work too. +The `deploy` command also supports a custom username and password, via the `user` and `password` flags. If you want to build the UI while deploying, pass in the `withBuildAndCopyUI` flag. + ### Using PhotonLib Builds The build process automatically generates a vendordep JSON of your local build at `photon-lib/build/generated/vendordeps/photonlib.json`. diff --git a/photon-server/build.gradle b/photon-server/build.gradle index e78ad07c75..cae9cd6398 100644 --- a/photon-server/build.gradle +++ b/photon-server/build.gradle @@ -44,6 +44,10 @@ tasks.register('copyClientUIToResources', Copy) { into "${projectDir}/src/main/resources/web/" } +tasks.named('processResources') { + dependsOn 'copyClientUIToResources' +} + tasks.register("buildAndCopyUI") { dependsOn "npm_run_build" finalizedBy "copyClientUIToResources" @@ -74,7 +78,13 @@ remotes { task findDeployTarget { doLast { - if(project.hasProperty('tgtIP')){ + if(project.hasProperty('tgtIP') && project.hasProperty('user') && project.hasProperty('password')){ + //If user specified IP, user, and password, use those to deploy + findDeployTarget.ext.rmt = remotes.pi + findDeployTarget.ext.rmt.host = tgtIP + findDeployTarget.ext.rmt.user = user + findDeployTarget.ext.rmt.password = password + } else if(project.hasProperty('tgtIP')){ //If user specified IP, default to using the PI profile // but adjust hostname to match the provided IP address findDeployTarget.ext.rmt = remotes.pi @@ -106,9 +116,13 @@ task findDeployTarget { } task deploy { + if(project.hasProperty("withBuildAndCopyUI")){ + dependsOn 'buildAndCopyUI' + } dependsOn findDeployTarget dependsOn 'shadowJar' + doLast { println 'Starting deployment to ' + findDeployTarget.rmt.host println 'targetArch = ' + wpilibTools.platformMapper.currentPlatform.platformName