generated from wpilibsuite/vendor-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4e440b
commit 4b6e46d
Showing
5 changed files
with
155 additions
and
66 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
import java.text.SimpleDateFormat | ||
|
||
plugins { | ||
// Apply the java-library plugin for API and implementation separation. | ||
id 'java-library' | ||
id "edu.wpi.first.GradleRIO" version "2024.3.2" | ||
id "com.peterabeles.gversion" version "1.10" | ||
id "com.diffplug.spotless" version "6.24.0" | ||
id 'org.ajoberstar.grgit' version "5.2.1" | ||
} | ||
|
||
repositories { | ||
// Use Maven Central for resolving dependencies. | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
|
||
def MAIN_CLASS = "coppercore" | ||
|
||
deploy { | ||
targets { | ||
roborio(getTargetTypeClass("RoboRIO")) { | ||
team = project.frc.getTeamOrDefault(401) | ||
debug = project.frc.getDebugOrDefault(false) | ||
|
||
artifacts { | ||
|
||
frcJava(getArtifactTypeClass('FRCJavaArtifact')) { | ||
|
||
} | ||
|
||
frcStaticFileDeploy(getArtifactTypeClass("FileTreeArtifact")) { | ||
files = project.fileTree('lib/src/main/deploy') | ||
directory = "/home/lvuser/deploy" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
def deployArtifact = deploy.targets.roborio.artifacts.frcJava | ||
|
||
def includeDesktopSupport = true | ||
|
||
dependencies { | ||
// Use JUnit Jupiter for testing. | ||
testImplementation libs.junit.jupiter | ||
|
||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
|
||
// This dependency is exported to consumers, that is to say found on their compile classpath. | ||
api libs.commons.math3 | ||
|
||
// This dependency is used internally, and not exposed to consumers on their own compile classpath. | ||
implementation libs.guava | ||
|
||
// WPILIB setup | ||
implementation wpi.java.deps.wpilib() | ||
implementation wpi.java.vendor.java() | ||
|
||
roborioDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio) | ||
roborioDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio) | ||
|
||
roborioRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio) | ||
roborioRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio) | ||
|
||
nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop) | ||
nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.desktop) | ||
simulationDebug wpi.sim.enableDebug() | ||
|
||
nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.desktop) | ||
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop) | ||
simulationRelease wpi.sim.enableRelease() | ||
} | ||
|
||
// Apply a specific Java toolchain to ease working on different environments. | ||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
wpi.sim.addGui().defaultEnabled = true | ||
wpi.sim.addDriverstation() | ||
|
||
tasks.named('test') { | ||
// Use JUnit Platform for unit tests. | ||
useJUnitPlatform() | ||
} | ||
|
||
// adds dependency files to large jar | ||
jar { | ||
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } | ||
from sourceSets.main.allSource | ||
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(MAIN_CLASS) | ||
duplicatesStrategy = DuplicatesStrategy.INCLUDE | ||
} | ||
|
||
// deploy jar + tasks | ||
deployArtifact.jarTask = jar | ||
wpi.java.configureExecutableTasks(jar) | ||
|
||
tasks.withType(JavaCompile) { | ||
options.compilerArgs.add '-XDstringConcat=inline' | ||
} | ||
|
||
project.compileJava.dependsOn(createVersionFile) | ||
gversion { | ||
srcDir = "lib/src/main/java" | ||
classPackage = "coppercore" | ||
dateFormat = "yyyy-MM-dd HH:mm:ss Z" | ||
timeZone = "America/New_York" | ||
indent = " " | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import org.gradle.internal.os.OperatingSystem | ||
|
||
// manage wpilib path structure | ||
pluginManagement { | ||
repositories { | ||
mavenLocal() | ||
gradlePluginPortal() | ||
String frcYear = '2024' | ||
File frcHome | ||
if (OperatingSystem.current().isWindows()) { | ||
String publicFolder = System.getenv('PUBLIC') | ||
if (publicFolder == null) { | ||
publicFolder = "C:\\Users\\Public" | ||
} | ||
def homeRoot = new File(publicFolder, "wpilib") | ||
frcHome = new File(homeRoot, frcYear) | ||
} else { | ||
def userFolder = System.getProperty("user.home") | ||
def homeRoot = new File(userFolder, "wpilib") | ||
frcHome = new File(homeRoot, frcYear) | ||
} | ||
def frcHomeMaven = new File(frcHome, 'maven') | ||
maven { | ||
name 'frcHome' | ||
url frcHomeMaven | ||
} | ||
} | ||
} | ||
|
||
plugins { | ||
// Apply the foojay-resolver plugin to allow automatic download of JDKs | ||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' | ||
} | ||
|
||
rootProject.name = 'coppercore' | ||
include('lib') | ||
|
||
Properties props = System.getProperties(); | ||
props.setProperty("org.gradle.internal.native.headers.unresolved.dependencies.ignore", "true"); |
This file was deleted.
Oops, something went wrong.