Skip to content

Commit

Permalink
[fieldimages] Fix maven publishing (wpilibsuite#3897)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjreiniger authored Jan 15, 2022
1 parent 4945519 commit ad9f738
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions fieldImages/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxra

ext {
nativeName = 'fieldImages'
baseId = nativeName
groupId = 'edu.wpi.first.fieldImages'
devMain = "edu.wpi.first.fieldImages.DevMain"
}

apply from: "${rootDir}/shared/resources.gradle"
apply from: "${rootDir}/shared/config.gradle"
apply from: "${rootDir}/shared/java/javacommon.gradle"

def generateTask = createGenerateResourcesTask('main', 'FIELDS', 'fields', project)

Expand Down
14 changes: 7 additions & 7 deletions fieldImages/publish.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'maven-publish'

def baseArtifactId = 'fieldImages'
def artifactGroupId = 'edu.wpi.first.fieldImages'
def zipBaseName = '_GROUP_edu_wpi_first_field_images_ID_CLS'
def baseArtifactId = project.nativeName
def artifactGroupId = project.groupId
def cppZipBaseName = "_GROUP_edu_wpi_first_fieldIimages_ID_${baseArtifactId}-cpp_CLS"

def outputsFolder = file("$project.buildDir/outputs")

task cppSourcesZip(type: Zip) {
destinationDirectory = outputsFolder
archiveBaseName = zipBaseName
archiveBaseName = cppZipBaseName
classifier = "sources"

from(licenseFile) {
Expand All @@ -25,7 +25,7 @@ task cppSourcesZip(type: Zip) {

task cppHeadersZip(type: Zip) {
destinationDirectory = outputsFolder
archiveBaseName = zipBaseName
archiveBaseName = cppZipBaseName
classifier = "headers"

from(licenseFile) {
Expand All @@ -51,7 +51,7 @@ addTaskToCopyAllOutputs(cppSourcesZip)

model {
publishing {
def wpilibCTaskList = createComponentZipTasks($.components, ['fieldImages'], zipBaseName, Zip, project, includeStandardZipFormat)
def wpilibCTaskList = createComponentZipTasks($.components, ['fieldImages'], cppZipBaseName, Zip, project, includeStandardZipFormat)

publications {
cpp(MavenPublication) {
Expand All @@ -62,7 +62,7 @@ model {
artifact cppHeadersZip
artifact cppSourcesZip

artifactId = baseArtifactId
artifactId = "${baseArtifactId}-cpp"
groupId artifactGroupId
version wpilibVersioning.version.get()
}
Expand Down

0 comments on commit ad9f738

Please sign in to comment.