mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
The deprecation message was:
```
The `archives` configuration added by the `base` plugin has been
deprecated and will be removed in Gradle 10.0.0. Adding artifacts to the
`archives` configuration will now result in a deprecation warning. If
you want the artifact built when running the `assemble` task, you should
add the artifact (or the task that produces it) as a dependency of the
`assemble` task directly.
val specialJar = tasks.register<Jar>("specialJar") {
archiveBaseName.set("special")
from("build/special")
}
tasks.named("assemble") {
dependsOn(specialJar)
}
```
78 lines
1.7 KiB
Groovy
78 lines
1.7 KiB
Groovy
apply plugin: 'maven-publish'
|
|
|
|
def outputsFolder = file("$buildDir/outputs")
|
|
|
|
def baseArtifactId = nativeName
|
|
def artifactGroupId = "edu.wpi.first.${nativeName}"
|
|
def zipBaseName = "_GROUP_edu_wpi_first_${nativeName}_ID_${nativeName}-cpp_CLS"
|
|
|
|
def licenseFile = file("$rootDir/license.md")
|
|
|
|
task cppSourcesZip(type: Zip) {
|
|
destinationDirectory = outputsFolder
|
|
archiveBaseName = zipBaseName
|
|
archiveClassifier = "sources"
|
|
|
|
from(licenseFile) {
|
|
into '/'
|
|
}
|
|
|
|
from('src/main/native/cpp') {
|
|
into '/'
|
|
}
|
|
from("$buildDir/generated/cpp") {
|
|
into '/'
|
|
}
|
|
}
|
|
|
|
task cppHeadersZip(type: Zip) {
|
|
destinationDirectory = outputsFolder
|
|
archiveBaseName = zipBaseName
|
|
archiveClassifier = "headers"
|
|
|
|
from(licenseFile) {
|
|
into '/'
|
|
}
|
|
|
|
ext.includeDirs = [
|
|
project.file('src/main/native/include'),
|
|
project.file('src/generated/main/native/include')
|
|
]
|
|
|
|
ext.includeDirs.each {
|
|
from(it) {
|
|
into '/'
|
|
}
|
|
}
|
|
}
|
|
|
|
artifacts {
|
|
tasks.named("assemble") {
|
|
dependsOn(cppHeadersZip)
|
|
dependsOn(cppSourcesZip)
|
|
}
|
|
}
|
|
|
|
addTaskToCopyAllOutputs(cppSourcesZip)
|
|
addTaskToCopyAllOutputs(cppHeadersZip)
|
|
|
|
model {
|
|
publishing {
|
|
def taskList = createComponentZipTasks($.components, [nativeName], zipBaseName, Zip, project, includeStandardZipFormat)
|
|
|
|
publications {
|
|
cpp(MavenPublication) {
|
|
taskList.each {
|
|
artifact it
|
|
}
|
|
artifact cppHeadersZip
|
|
artifact cppSourcesZip
|
|
|
|
artifactId = "${baseArtifactId}-cpp"
|
|
groupId = artifactGroupId
|
|
version = wpilibVersioning.version.get()
|
|
}
|
|
}
|
|
}
|
|
}
|