blob: 476dd3c3098ae6bda00f0c7e10981cdec7121150 [file] [log] [blame]
Austin Schuh75263e32022-02-22 18:05:32 -08001import org.gradle.internal.os.OperatingSystem
2
3if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxraspbian') && !project.hasProperty('onlylinuxaarch64bionic')) {
4
5 apply plugin: 'cpp'
6 apply plugin: 'c'
7 apply plugin: 'java'
8 apply plugin: 'google-test-test-suite'
9 apply plugin: 'visual-studio'
10 apply plugin: 'edu.wpi.first.NativeUtils'
11
12 if (OperatingSystem.current().isWindows()) {
13 apply plugin: 'windows-resources'
14 }
15
16 ext {
17 nativeName = 'fieldImages'
18 baseId = nativeName
19 groupId = 'edu.wpi.first.fieldImages'
20 devMain = "edu.wpi.first.fieldImages.DevMain"
21 }
22
23 apply from: "${rootDir}/shared/resources.gradle"
24 apply from: "${rootDir}/shared/config.gradle"
25 apply from: "${rootDir}/shared/java/javacommon.gradle"
26
27 def generateTask = createGenerateResourcesTask('main', 'FIELDS', 'fields', project)
28
29 project(':').libraryBuild.dependsOn build
30 tasks.withType(CppCompile) {
31 dependsOn generateTask
32 }
33
34 sourceSets {
35 main {
36 resources {
37 srcDirs 'src/main/native/resources'
38 }
39 }
40 }
41
42 model {
43 components {
44 "${nativeName}"(NativeLibrarySpec) {
45 baseName = 'fieldImages'
46 sources {
47 cpp {
48 source {
49 srcDirs "$buildDir/generated/main/cpp"
50 include '**/*.cpp'
51 }
52 exportedHeaders {
53 srcDirs 'src/main/native/include'
54 }
55 }
56 if (OperatingSystem.current().isWindows()) {
57 rc {
58 source {
59 srcDirs 'src/main/native/win'
60 include '*.rc'
61 }
62 }
63 }
64 }
65 }
66 }
67 }
68
69 apply from: 'publish.gradle'
70}