2021-11-09 01:48:16 -05:00
|
|
|
import org.gradle.internal.os.OperatingSystem
|
|
|
|
|
|
2024-11-30 18:04:00 +00:00
|
|
|
if (project.hasProperty('onlylinuxathena') || project.hasProperty('onlylinuxsystemcore')) {
|
2023-09-27 21:45:25 -07:00
|
|
|
return;
|
|
|
|
|
}
|
2021-11-09 01:48:16 -05:00
|
|
|
|
2023-09-27 21:45:25 -07:00
|
|
|
apply plugin: 'cpp'
|
|
|
|
|
apply plugin: 'java'
|
|
|
|
|
apply plugin: 'visual-studio'
|
2025-12-13 21:44:00 -08:00
|
|
|
apply plugin: 'org.wpilib.NativeUtils'
|
2021-11-09 01:48:16 -05:00
|
|
|
|
2023-09-27 21:45:25 -07:00
|
|
|
if (OperatingSystem.current().isWindows()) {
|
|
|
|
|
apply plugin: 'windows-resources'
|
|
|
|
|
}
|
2021-11-09 01:48:16 -05:00
|
|
|
|
2023-09-27 21:45:25 -07:00
|
|
|
dependencies {
|
2026-02-20 18:31:33 -05:00
|
|
|
implementation libs.bundles.jackson
|
2023-09-27 21:45:25 -07:00
|
|
|
}
|
2022-10-06 18:45:07 -04:00
|
|
|
|
2023-09-27 21:45:25 -07:00
|
|
|
ext {
|
2025-11-07 19:55:39 -05:00
|
|
|
nativeName = 'fields'
|
2023-09-27 21:45:25 -07:00
|
|
|
baseId = nativeName
|
2025-11-07 20:00:38 -05:00
|
|
|
groupId = 'org.wpilib.fields'
|
|
|
|
|
devMain = "org.wpilib.fields.DevMain"
|
2023-09-27 21:45:25 -07:00
|
|
|
}
|
2021-11-09 01:48:16 -05:00
|
|
|
|
2023-09-27 21:45:25 -07:00
|
|
|
apply from: "${rootDir}/shared/resources.gradle"
|
|
|
|
|
apply from: "${rootDir}/shared/config.gradle"
|
|
|
|
|
apply from: "${rootDir}/shared/java/javacommon.gradle"
|
2021-11-09 01:48:16 -05:00
|
|
|
|
2025-11-07 20:00:37 -05:00
|
|
|
def generateTask = createGenerateResourcesTask('main', 'FIELDS', 'wpi::fields', project)
|
2021-11-09 01:48:16 -05:00
|
|
|
|
2023-09-27 21:45:25 -07:00
|
|
|
project(':').libraryBuild.dependsOn build
|
|
|
|
|
tasks.withType(CppCompile) {
|
|
|
|
|
dependsOn generateTask
|
|
|
|
|
}
|
2021-11-09 01:48:16 -05:00
|
|
|
|
2023-09-27 21:45:25 -07:00
|
|
|
sourceSets.main.resources {
|
|
|
|
|
srcDirs 'src/main/native/resources'
|
|
|
|
|
}
|
2021-11-09 01:48:16 -05:00
|
|
|
|
2023-09-27 21:45:25 -07:00
|
|
|
model {
|
|
|
|
|
components {
|
|
|
|
|
"${nativeName}"(NativeLibrarySpec) {
|
2025-11-07 19:55:39 -05:00
|
|
|
baseName = 'fields'
|
2023-09-27 21:45:25 -07:00
|
|
|
sources {
|
|
|
|
|
cpp {
|
|
|
|
|
source {
|
|
|
|
|
srcDirs 'src/main/native/cpp', "$buildDir/generated/main/cpp"
|
|
|
|
|
include '**/*.cpp'
|
2021-11-09 01:48:16 -05:00
|
|
|
}
|
2023-09-27 21:45:25 -07:00
|
|
|
exportedHeaders {
|
|
|
|
|
srcDirs 'src/main/native/include'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (OperatingSystem.current().isWindows()) {
|
|
|
|
|
rc.source {
|
|
|
|
|
srcDirs 'src/main/native/win'
|
|
|
|
|
include '*.rc'
|
2021-11-09 01:48:16 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-27 21:45:25 -07:00
|
|
|
|
|
|
|
|
apply from: 'publish.gradle'
|