Added deploy to local

This commit is contained in:
Tyler Wilcox 2023-01-21 12:02:25 -05:00 committed by Declipsonator
parent f5719f0928
commit 634910e76e
6 changed files with 33 additions and 3 deletions

4
.gitignore vendored
View File

@ -1,5 +1,7 @@
.gradle
/build/
build/
lib/bin
# Ignore Gradle GUI config
gradle-app.setting

View File

@ -5,5 +5,8 @@ The official library for Team 578 R3 - Red Raider Robotics
To include this library in a Java FRC Robot project.
# Building
The project can be built and published to the local Maven repository using `./gradlew pubLocal`
The project can be build and published to the local Maven repository using `./gradlew publishToMavenLocal`
## Updating version
The version tag can be found in `lib/publish.gradle`. When updating the version match the year to the current year, and increment the major and minor version as needed.

View File

@ -1,8 +1,10 @@
import org.gradle.internal.os.OperatingSystem
apply plugin: 'maven-publish'
ext.licenseFile = files("$rootDir/LICENSE.txt")
def pubVersion = '2022.0.1'
def pubVersion = '2023.1.0'
def outputsFolder = file("$buildDir/allOutputs")
@ -25,6 +27,8 @@ task outputVersions() {
task libraryBuild() {}
task pubLocal(dependsOn: 'publishAllPublicationsToFrcHomeRepository') {}
build.dependsOn outputVersions
task copyAllOutputs(type: Copy) {
@ -95,6 +99,22 @@ libraryBuild.dependsOn build
def releasesRepoUrl = "$buildDir/repos/releases"
String frcYear = '2023'
File frcHome
if (OperatingSystem.current().isWindows()) {
String publicFolder = System.getenv('PUBLIC')
if (publicFolder == null) {
publicFolder = "C:\\Users\\Public"
}
def homeRoot = new File(publicFolder, "wpilib")
frcHome = new File(homeRoot, frcYear)
} else {
def userFolder = System.getProperty("user.home")
def homeRoot = new File(userFolder, "wpilib")
frcHome = new File(homeRoot, frcYear)
}
def frcHomeMaven = new File(frcHome, 'maven')
publishing {
repositories {
maven {
@ -105,6 +125,11 @@ publishing {
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
maven {
name 'frcHome'
url frcHomeMaven
}
}
}