mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-23 01:21:40 +00:00
Update maven URL to reposilite (#1330)
Also bumps to new builds of artifacts (NFC)
This commit is contained in:
17
build.gradle
17
build.gradle
@@ -13,8 +13,9 @@ allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { url = "https://maven.photonvision.org/repository/internal/" }
|
||||
maven { url = "https://maven.photonvision.org/repository/snapshots/" }
|
||||
maven { url = "https://maven.photonvision.org/releases" }
|
||||
maven { url = "https://maven.photonvision.org/snapshots" }
|
||||
maven { url = "https://jogamp.org/deployment/maven/" }
|
||||
}
|
||||
wpilibRepositories.addAllReleaseRepositories(it)
|
||||
wpilibRepositories.addAllDevelopmentRepositories(it)
|
||||
@@ -27,12 +28,12 @@ ext {
|
||||
wpilibVersion = "2024.3.2-139-gfbfef85"
|
||||
wpimathVersion = wpilibVersion
|
||||
openCVversion = "4.8.0-2"
|
||||
joglVersion = "2.4.0-rc-20200307"
|
||||
joglVersion = "2.4.0"
|
||||
javalinVersion = "5.6.2"
|
||||
libcameraDriverVersion = "dev-v2023.1.0-10-g2693ec0"
|
||||
rknnVersion = "dev-v2024.0.0-64-gc0836a6"
|
||||
libcameraDriverVersion = "dev-v2023.1.0-11-g2b7036f"
|
||||
rknnVersion = "dev-v2024.0.1-4-g0db16ac"
|
||||
frcYear = "2024"
|
||||
mrcalVersion = "dev-v2024.0.0-23-g9620baa";
|
||||
mrcalVersion = "dev-v2024.0.0-24-gc1efcf0";
|
||||
|
||||
|
||||
pubVersion = versionString
|
||||
@@ -50,6 +51,10 @@ ext {
|
||||
println("Building for platform " + jniPlatform + " wpilib: " + wpilibNativeName)
|
||||
println("Using Wpilib: " + wpilibVersion)
|
||||
println("Using OpenCV: " + openCVversion)
|
||||
|
||||
|
||||
photonMavenURL = 'https://maven.photonvision.org/' + (isDev ? 'snapshots' : 'releases');
|
||||
println("Publishing Photonlib to " + photonMavenURL)
|
||||
}
|
||||
|
||||
spotless {
|
||||
|
||||
@@ -1,199 +0,0 @@
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
ext.licenseFile = files("$rootDir/LICENSE")
|
||||
|
||||
def outputsFolder = file("$buildDir/outputs")
|
||||
def allOutputsFolder = file("$buildDir/allOutputs")
|
||||
|
||||
def versionFile = file("$allOutputsFolder/version.txt")
|
||||
|
||||
task outputVersions() {
|
||||
description = 'Prints the versions of wpilib to a file for use by the downstream packaging project'
|
||||
group = 'Build'
|
||||
outputs.files(versionFile)
|
||||
|
||||
doFirst {
|
||||
buildDir.mkdir()
|
||||
outputsFolder.mkdir()
|
||||
allOutputsFolder.mkdir()
|
||||
}
|
||||
|
||||
doLast {
|
||||
versionFile.write pubVersion
|
||||
}
|
||||
}
|
||||
|
||||
task libraryBuild() {}
|
||||
|
||||
build.dependsOn outputVersions
|
||||
|
||||
task copyAllOutputs(type: Copy) {
|
||||
destinationDir allOutputsFolder
|
||||
}
|
||||
|
||||
build.dependsOn copyAllOutputs
|
||||
copyAllOutputs.dependsOn outputVersions
|
||||
|
||||
ext.addTaskToCopyAllOutputs = { task ->
|
||||
copyAllOutputs.dependsOn task
|
||||
copyAllOutputs.inputs.file task.archivePath
|
||||
copyAllOutputs.from task.archivePath
|
||||
}
|
||||
|
||||
def artifactGroupId = 'org.photonvision'
|
||||
def baseArtifactId = 'PhotonLib'
|
||||
def zipBaseName = "_GROUP_org_photonvision_photonlib_ID_${baseArtifactId}-cpp_CLS"
|
||||
def javaBaseName = "_GROUP_org_photonvision_photonlib_ID_${baseArtifactId}-java_CLS"
|
||||
|
||||
task cppHeadersZip(type: Zip) {
|
||||
destinationDirectory = outputsFolder
|
||||
archiveBaseName = zipBaseName
|
||||
classifier = "headers"
|
||||
|
||||
duplicatesStrategy = "warn"
|
||||
|
||||
from(licenseFile) {
|
||||
into '/'
|
||||
}
|
||||
|
||||
from('src/main/native/include/') {
|
||||
into '/'
|
||||
}
|
||||
}
|
||||
|
||||
task cppSourcesZip(type: Zip) {
|
||||
destinationDirectory = outputsFolder
|
||||
archiveBaseName = zipBaseName
|
||||
classifier = "sources"
|
||||
|
||||
from(licenseFile) {
|
||||
into '/'
|
||||
}
|
||||
|
||||
from('src/main/native/cpp') {
|
||||
into '/'
|
||||
}
|
||||
}
|
||||
|
||||
build.dependsOn cppHeadersZip
|
||||
addTaskToCopyAllOutputs(cppHeadersZip)
|
||||
build.dependsOn cppSourcesZip
|
||||
addTaskToCopyAllOutputs(cppSourcesZip)
|
||||
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
||||
classifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
}
|
||||
|
||||
task outputJar(type: Jar, dependsOn: classes) {
|
||||
archiveBaseName = javaBaseName
|
||||
destinationDirectory = outputsFolder
|
||||
from sourceSets.main.output
|
||||
}
|
||||
|
||||
task outputSourcesJar(type: Jar, dependsOn: classes) {
|
||||
archiveBaseName = javaBaseName
|
||||
destinationDirectory = outputsFolder
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
task outputJavadocJar(type: Jar, dependsOn: javadoc) {
|
||||
archiveBaseName = javaBaseName
|
||||
destinationDirectory = outputsFolder
|
||||
classifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
}
|
||||
|
||||
def vendorJson = artifacts.add('archives', file("$photonlibFileOutput"))
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
archives outputJar
|
||||
archives outputSourcesJar
|
||||
archives outputJavadocJar
|
||||
}
|
||||
|
||||
addTaskToCopyAllOutputs(outputSourcesJar)
|
||||
addTaskToCopyAllOutputs(outputJavadocJar)
|
||||
addTaskToCopyAllOutputs(outputJar)
|
||||
|
||||
build.dependsOn outputSourcesJar
|
||||
build.dependsOn outputJavadocJar
|
||||
build.dependsOn outputJar
|
||||
|
||||
libraryBuild.dependsOn build
|
||||
|
||||
def releasesRepoUrl = "$buildDir/repos/releases"
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
url = releasesRepoUrl
|
||||
}
|
||||
maven {
|
||||
url ('https://maven.photonvision.org/repository/' + (isDev ? 'snapshots' : 'internal'))
|
||||
credentials {
|
||||
username 'ghactions'
|
||||
password System.getenv("ARTIFACTORY_API_KEY")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(PublishToMavenRepository) {
|
||||
doFirst {
|
||||
println("Publishing to " + repository.url);
|
||||
}
|
||||
}
|
||||
|
||||
task cleanReleaseRepo(type: Delete) {
|
||||
delete releasesRepoUrl
|
||||
}
|
||||
|
||||
tasks.matching {it != cleanReleaseRepo}.all {it.dependsOn cleanReleaseRepo}
|
||||
|
||||
model {
|
||||
publishing {
|
||||
def taskList = createComponentZipTasks($.components, ['Photon'], zipBaseName, Zip, project, includeStandardZipFormat)
|
||||
|
||||
publications {
|
||||
cpp(MavenPublication) {
|
||||
taskList.each {
|
||||
artifact it
|
||||
}
|
||||
artifact cppHeadersZip
|
||||
artifact cppSourcesZip
|
||||
|
||||
artifactId = "${baseArtifactId}-cpp"
|
||||
groupId artifactGroupId
|
||||
version pubVersion
|
||||
}
|
||||
java(MavenPublication) {
|
||||
artifact jar
|
||||
artifact sourcesJar
|
||||
artifact javadocJar
|
||||
|
||||
artifactId = "${baseArtifactId}-java"
|
||||
groupId artifactGroupId
|
||||
version pubVersion
|
||||
}
|
||||
vendorjson(MavenPublication) {
|
||||
artifact vendorJson
|
||||
|
||||
artifactId = "${baseArtifactId}-json"
|
||||
groupId = artifactGroupId
|
||||
version "1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishToMavenLocal.dependsOn libraryBuild
|
||||
publish.dependsOn libraryBuild
|
||||
@@ -6,7 +6,7 @@ allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { url = "https://maven.photonvision.org/repository/internal/" }
|
||||
maven { url = "https://maven.photonvision.org/releases" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ allprojects {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { url = "https://maven.photonvision.org/repository/internal/" }
|
||||
maven { url = "https://maven.photonvision.org/releases" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ publishing {
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url ('https://maven.photonvision.org/repository/' + (isDev ? 'snapshots' : 'internal'))
|
||||
url(photonMavenURL)
|
||||
credentials {
|
||||
username 'ghactions'
|
||||
password System.getenv("ARTIFACTORY_API_KEY")
|
||||
|
||||
@@ -77,7 +77,7 @@ model {
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url ('https://maven.photonvision.org/repository/' + (isDev ? 'snapshots' : 'internal'))
|
||||
url(photonMavenURL)
|
||||
credentials {
|
||||
username 'ghactions'
|
||||
password System.getenv("ARTIFACTORY_API_KEY")
|
||||
|
||||
Reference in New Issue
Block a user