Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 1 | import org.gradle.internal.os.OperatingSystem |
| 2 | |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 3 | if (project.hasProperty('onlylinuxathena')) { |
| 4 | return; |
| 5 | } |
Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 6 | |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 7 | apply plugin: 'cpp' |
| 8 | apply plugin: 'java' |
| 9 | apply plugin: 'visual-studio' |
| 10 | apply plugin: 'edu.wpi.first.NativeUtils' |
Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 11 | |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 12 | if (OperatingSystem.current().isWindows()) { |
| 13 | apply plugin: 'windows-resources' |
| 14 | } |
Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 15 | |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 16 | dependencies { |
| 17 | implementation "com.fasterxml.jackson.core:jackson-annotations:2.15.2" |
| 18 | implementation "com.fasterxml.jackson.core:jackson-core:2.15.2" |
| 19 | implementation "com.fasterxml.jackson.core:jackson-databind:2.15.2" |
| 20 | } |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 21 | |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 22 | ext { |
| 23 | nativeName = 'fieldImages' |
| 24 | baseId = nativeName |
| 25 | groupId = 'edu.wpi.first.fieldImages' |
| 26 | devMain = "edu.wpi.first.fieldImages.DevMain" |
| 27 | } |
Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 28 | |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 29 | apply from: "${rootDir}/shared/resources.gradle" |
| 30 | apply from: "${rootDir}/shared/config.gradle" |
| 31 | apply from: "${rootDir}/shared/java/javacommon.gradle" |
Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 32 | |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 33 | def generateTask = createGenerateResourcesTask('main', 'FIELDS', 'fields', project) |
Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 34 | |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 35 | project(':').libraryBuild.dependsOn build |
| 36 | tasks.withType(CppCompile) { |
| 37 | dependsOn generateTask |
| 38 | } |
Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 39 | |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 40 | sourceSets.main.resources { |
| 41 | srcDirs 'src/main/native/resources' |
| 42 | } |
Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 43 | |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 44 | model { |
| 45 | components { |
| 46 | "${nativeName}"(NativeLibrarySpec) { |
| 47 | baseName = 'fieldImages' |
| 48 | sources { |
| 49 | cpp { |
| 50 | source { |
| 51 | srcDirs 'src/main/native/cpp', "$buildDir/generated/main/cpp" |
| 52 | include '**/*.cpp' |
Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 53 | } |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 54 | exportedHeaders { |
| 55 | srcDirs 'src/main/native/include' |
| 56 | } |
| 57 | } |
| 58 | if (OperatingSystem.current().isWindows()) { |
| 59 | rc.source { |
| 60 | srcDirs 'src/main/native/win' |
| 61 | include '*.rc' |
Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 62 | } |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | } |
Austin Schuh | 75263e3 | 2022-02-22 18:05:32 -0800 | [diff] [blame] | 67 | } |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 68 | |
| 69 | apply from: 'publish.gradle' |