blob: aac1e12af2d72b24f17f335ada30e3fdfad17d72 [file] [log] [blame]
Brian Silverman41cdd3e2019-01-19 19:48:58 -08001plugins {
2 id 'base'
3 id 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin' version '2.3'
4 id 'edu.wpi.first.NativeUtils' version '2.1.2'
5 id 'edu.wpi.first.GradleJni' version '0.3.1'
6 id 'edu.wpi.first.GradleVsCode' version '0.7.1'
7 id 'idea'
8 id 'visual-studio'
9 id 'com.gradle.build-scan' version '2.0.2'
10 id 'net.ltgt.errorprone' version '0.6' apply false
11 id 'com.github.johnrengelman.shadow' version '4.0.3' apply false
12}
13
14repositories {
15 mavenCentral()
16}
17
18buildScan {
19 termsOfServiceUrl = 'https://gradle.com/terms-of-service'
20 termsOfServiceAgree = 'yes'
21
22 publishAlways()
23}
24
25ext.licenseFile = files("$rootDir/LICENSE.txt", "$rootDir/ThirdPartyNotices.txt")
26
27// Ensure that the WPILibVersioningPlugin is setup by setting the release type, if releaseType wasn't
28// already specified on the command line
29if (!hasProperty('releaseType')) {
30 WPILibVersion {
31 releaseType = 'dev'
32 }
33}
34
35def pubVersion
36if (project.hasProperty("publishVersion")) {
37 pubVersion = project.publishVersion
38} else {
39 pubVersion = WPILibVersion.version
40}
41
42def outputsFolder = file("$buildDir/allOutputs")
43
44def versionFile = file("$outputsFolder/version.txt")
45
46task outputVersions() {
47 description = 'Prints the versions of wpilib to a file for use by the downstream packaging project'
48 group = 'Build'
49 outputs.files(versionFile)
50
51 doFirst {
52 buildDir.mkdir()
53 outputsFolder.mkdir()
54 }
55
56 doLast {
57 versionFile.write pubVersion
58 }
59}
60
61task libraryBuild() {}
62
63build.dependsOn outputVersions
64
65task copyAllOutputs(type: Copy) {
66 destinationDir outputsFolder
67}
68
69build.dependsOn copyAllOutputs
70copyAllOutputs.dependsOn outputVersions
71
72ext.addTaskToCopyAllOutputs = { task ->
73 copyAllOutputs.dependsOn task
74 copyAllOutputs.inputs.file task.archivePath
75 copyAllOutputs.from task.archivePath
76}
77
78subprojects {
79 apply plugin: 'eclipse'
80 apply plugin: 'idea'
81
82 def subproj = it
83
84 plugins.withType(NativeComponentPlugin) {
85 subproj.apply plugin: MultiBuilds
86 }
87
88 apply from: "${rootDir}/shared/java/javastyle.gradle"
89
90 repositories {
91 mavenCentral()
92 }
93
94 // Disables doclint in java 8.
95 if (JavaVersion.current().isJava8Compatible()) {
96 tasks.withType(Javadoc) {
97 options.addStringOption('Xdoclint:none', '-quiet')
98 }
99 }
100}
101
102wrapper {
103 gradleVersion = '5.0'
104}