import org.gradle.internal.os.OperatingSystem apply plugin: 'maven-publish' apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin' def csFile = file("$buildDir/cameraserver.txt") task outputVersions() { description = 'Prints the version of CameraServer to a file for use by the downstream packaging project' group = 'Build' outputs.files(csFile) doFirst { buildDir.mkdir() } doLast { csFile.write WPILibVersion.version } } task clean(type: Delete) { delete csFile } outputVersions.mustRunAfter clean if (!OperatingSystem.current().isWindows()) { project(':native').build.dependsOn outputVersions } if (project.buildArm) { project(':arm').build.dependsOn outputVersions } // We change what repo we publish to depending on whether this is a development, beta, stable, or full // release. This is set up in the main gradle file. publishing { publications { def nat = project('native') if (!project.hasProperty('skipJava')) { java(MavenPublication) { if (!OperatingSystem.current().isWindows()) { artifact nat.jar artifact nat.cameraserverJavaSource artifact nat.cameraserverJavadoc } if (project.buildArm) { def camArm = project('arm') artifact camArm.jar // If the library is not embedded include it in the repo if (!project.hasProperty('compilerPrefix')) { artifact camArm.cameraserverZip } artifact camArm.armCameraserverUberZip { classifier = 'uberzip' } } if (!OperatingSystem.current().isWindows()) { if (project.hasProperty('makeDesktop')) { artifact nat.jar, { classifier = 'desktop' } } } groupId 'edu.wpi.cameraserver.java' artifactId 'CameraServer' version WPILibVersion.version } } cpp(MavenPublication) { if (!OperatingSystem.current().isWindows()) { artifact nat.cameraserverZip } artifact cameraserverSourceZip if (project.buildArm) { artifact project(':arm').cameraserverZip artifact project(':arm').armCameraserverUberZip { classifier = 'uberzip' } } if (!OperatingSystem.current().isWindows()) { if (project.hasProperty('makeDesktop')) { artifact nat.cameraserverZip, { classifier = 'desktop' } } } groupId 'edu.wpi.cameraserver.cpp' artifactId 'CameraServer' version WPILibVersion.version } } }