mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user