mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
Adds publishing for examples and templates so they can be grabbed from eclipse (#674)
This commit is contained in:
committed by
Peter Johnson
parent
a1ea448406
commit
1e528669ff
@@ -110,4 +110,5 @@ if (!project.hasProperty('skipAthena')) {
|
||||
}
|
||||
}
|
||||
}
|
||||
apply from: 'publish.gradle'
|
||||
}
|
||||
|
||||
70
wpilibcExamples/publish.gradle
Normal file
70
wpilibcExamples/publish.gradle
Normal file
@@ -0,0 +1,70 @@
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
|
||||
|
||||
if (!hasProperty('releaseType')) {
|
||||
WPILibVersion {
|
||||
releaseType = 'dev'
|
||||
}
|
||||
}
|
||||
|
||||
def pubVersion
|
||||
if (project.hasProperty("publishVersion")) {
|
||||
pubVersion = project.publishVersion
|
||||
} else {
|
||||
pubVersion = WPILibVersion.version
|
||||
}
|
||||
|
||||
def baseExamplesArtifactId = 'examples'
|
||||
def baseTemplatesArtifactId = 'templates'
|
||||
def artifactGroupId = 'edu.wpi.first.wpilibc'
|
||||
|
||||
def outputsFolder = file("$project.buildDir/outputs")
|
||||
|
||||
task cppExamplesZip(type: Zip) {
|
||||
destinationDir = outputsFolder
|
||||
baseName = 'examples'
|
||||
|
||||
from(licenseFile) {
|
||||
into '/'
|
||||
}
|
||||
|
||||
from('src/main/cpp/examples') {
|
||||
into 'examples'
|
||||
}
|
||||
}
|
||||
|
||||
task cppTemplatesZip(type: Zip) {
|
||||
destinationDir = outputsFolder
|
||||
baseName = 'templates'
|
||||
|
||||
from(licenseFile) {
|
||||
into '/'
|
||||
}
|
||||
|
||||
from('src/main/cpp/templates') {
|
||||
into 'templates'
|
||||
}
|
||||
}
|
||||
|
||||
build.dependsOn cppTemplatesZip
|
||||
build.dependsOn cppExamplesZip
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
examples(MavenPublication) {
|
||||
artifact cppExamplesZip
|
||||
|
||||
artifactId = baseExamplesArtifactId
|
||||
groupId artifactGroupId
|
||||
version pubVersion
|
||||
}
|
||||
|
||||
templates(MavenPublication) {
|
||||
artifact cppTemplatesZip
|
||||
|
||||
artifactId = baseTemplatesArtifactId
|
||||
groupId artifactGroupId
|
||||
version pubVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,3 +26,5 @@ gradle.projectsEvaluated {
|
||||
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" << "-Werror"
|
||||
}
|
||||
}
|
||||
|
||||
apply from: 'publish.gradle'
|
||||
|
||||
70
wpilibjExamples/publish.gradle
Normal file
70
wpilibjExamples/publish.gradle
Normal file
@@ -0,0 +1,70 @@
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
|
||||
|
||||
if (!hasProperty('releaseType')) {
|
||||
WPILibVersion {
|
||||
releaseType = 'dev'
|
||||
}
|
||||
}
|
||||
|
||||
def pubVersion
|
||||
if (project.hasProperty("publishVersion")) {
|
||||
pubVersion = project.publishVersion
|
||||
} else {
|
||||
pubVersion = WPILibVersion.version
|
||||
}
|
||||
|
||||
def baseExamplesArtifactId = 'examples'
|
||||
def baseTemplatesArtifactId = 'templates'
|
||||
def artifactGroupId = 'edu.wpi.first.wpilibj'
|
||||
|
||||
def outputsFolder = file("$project.buildDir/outputs")
|
||||
|
||||
task javaExamplesZip(type: Zip) {
|
||||
destinationDir = outputsFolder
|
||||
baseName = 'examples'
|
||||
|
||||
from(licenseFile) {
|
||||
into '/'
|
||||
}
|
||||
|
||||
from('src/main/java/edu/wpi/first/wpilibj/examples') {
|
||||
into 'examples'
|
||||
}
|
||||
}
|
||||
|
||||
task javaTemplatesZip(type: Zip) {
|
||||
destinationDir = outputsFolder
|
||||
baseName = 'templates'
|
||||
|
||||
from(licenseFile) {
|
||||
into '/'
|
||||
}
|
||||
|
||||
from('src/main/java/edu/wpi/first/wpilibj/templates') {
|
||||
into 'templates'
|
||||
}
|
||||
}
|
||||
|
||||
build.dependsOn javaTemplatesZip
|
||||
build.dependsOn javaExamplesZip
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
examples(MavenPublication) {
|
||||
artifact javaExamplesZip
|
||||
|
||||
artifactId = baseExamplesArtifactId
|
||||
groupId artifactGroupId
|
||||
version pubVersion
|
||||
}
|
||||
|
||||
templates(MavenPublication) {
|
||||
artifact javaTemplatesZip
|
||||
|
||||
artifactId = baseTemplatesArtifactId
|
||||
groupId artifactGroupId
|
||||
version pubVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user