mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
SourceLink embeds the git repo and hash into the pdbs, which allows VS to get the source files exactly matching a pdb directly from github. Only VS and WinDbg are supported currently, but there are issues in the vscode tools repo to enable it there.
115 lines
2.7 KiB
Groovy
115 lines
2.7 KiB
Groovy
import edu.wpi.first.toolchain.*
|
|
|
|
plugins {
|
|
id 'base'
|
|
id 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin' version '4.0.1'
|
|
id 'edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin' version '2020.2'
|
|
id 'edu.wpi.first.NativeUtils' apply false
|
|
id 'edu.wpi.first.GradleJni' version '0.10.1'
|
|
id 'edu.wpi.first.GradleVsCode' version '0.11.0'
|
|
id 'idea'
|
|
id 'visual-studio'
|
|
id 'net.ltgt.errorprone' version '1.1.1' apply false
|
|
id 'com.github.johnrengelman.shadow' version '5.2.0' apply false
|
|
}
|
|
|
|
if (project.hasProperty('buildServer')) {
|
|
wpilibVersioning.buildServerMode = true
|
|
}
|
|
|
|
if (project.hasProperty('releaseMode')) {
|
|
wpilibVersioning.releaseMode = true
|
|
}
|
|
|
|
allprojects {
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
if (project.hasProperty('releaseMode')) {
|
|
wpilibRepositories.addAllReleaseRepositories(it)
|
|
} else {
|
|
wpilibRepositories.addAllDevelopmentRepositories(it)
|
|
}
|
|
}
|
|
|
|
buildScan {
|
|
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
|
|
termsOfServiceAgree = 'yes'
|
|
|
|
publishAlways()
|
|
}
|
|
|
|
ext.licenseFile = files("$rootDir/LICENSE.md", "$rootDir/ThirdPartyNotices.txt")
|
|
|
|
if (project.hasProperty("publishVersion")) {
|
|
wpilibVersioning.version.set(project.publishVersion)
|
|
}
|
|
|
|
wpilibVersioning.version.finalizeValue()
|
|
|
|
def outputsFolder = file("$buildDir/allOutputs")
|
|
|
|
def versionFile = file("$outputsFolder/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()
|
|
}
|
|
|
|
doLast {
|
|
versionFile.write wpilibVersioning.version.get()
|
|
}
|
|
}
|
|
|
|
task libraryBuild() {}
|
|
|
|
build.dependsOn outputVersions
|
|
|
|
task copyAllOutputs(type: Copy) {
|
|
destinationDir outputsFolder
|
|
}
|
|
|
|
build.dependsOn copyAllOutputs
|
|
copyAllOutputs.dependsOn outputVersions
|
|
|
|
ext.addTaskToCopyAllOutputs = { task ->
|
|
copyAllOutputs.dependsOn task
|
|
copyAllOutputs.inputs.file task.archivePath
|
|
copyAllOutputs.from task.archivePath
|
|
}
|
|
|
|
subprojects {
|
|
apply plugin: 'eclipse'
|
|
apply plugin: 'idea'
|
|
|
|
def subproj = it
|
|
|
|
plugins.withType(NativeComponentPlugin) {
|
|
subproj.apply plugin: MultiBuilds
|
|
}
|
|
|
|
apply from: "${rootDir}/shared/java/javastyle.gradle"
|
|
|
|
// Disables doclint in java 8.
|
|
if (JavaVersion.current().isJava8Compatible()) {
|
|
tasks.withType(Javadoc) {
|
|
if (project.name != "docs") {
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
ext.getCurrentArch = {
|
|
return NativePlatforms.desktop
|
|
}
|
|
|
|
wrapper {
|
|
gradleVersion = '6.0.1'
|
|
}
|