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.
Merge pull request #12 from team401/8-fix-ci-artifacts
Fix CI and JitPack
- Loading branch information
Showing
10 changed files
with
442 additions
and
87 deletions.
There are no files selected for viewing
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
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
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
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,20 @@ | ||
allprojects { | ||
version = '0.0' | ||
group = 'com.github.team401' | ||
} | ||
|
||
subprojects { | ||
apply plugin: 'java' | ||
apply plugin: 'maven-publish' | ||
|
||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
groupId project.group | ||
artifactId project.name | ||
version project.version | ||
from components.java | ||
} | ||
} | ||
} | ||
} |
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,2 @@ | ||
jdk: | ||
- openjdk17 |
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
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 |
---|---|---|
@@ -1,41 +1,84 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
* | ||
* This generated file contains a sample Java library project to get you started. | ||
* For more details on building Java & JVM projects, please refer to https://docs.gradle.org/8.7/userguide/building_java_projects.html in the Gradle documentation. | ||
*/ | ||
import java.text.SimpleDateFormat | ||
|
||
plugins { | ||
// Apply the java-library plugin for API and implementation separation. | ||
id 'java-library' | ||
id "java" | ||
id "maven-publish" | ||
id "com.peterabeles.gversion" version "1.10" | ||
id "com.diffplug.spotless" version "6.24.0" | ||
} | ||
|
||
repositories { | ||
// Use Maven Central for resolving dependencies. | ||
mavenCentral() | ||
java { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
// Set this to true to enable desktop support. | ||
def includeDesktopSupport = true | ||
|
||
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. | ||
// Also defines JUnit 5. | ||
dependencies { | ||
// Use JUnit Jupiter for testing. | ||
testImplementation libs.junit.jupiter | ||
implementation 'edu.wpi.first.wpilibj:wpilibj-java:2024.3.2' | ||
implementation 'edu.wpi.first.wpilibNewCommands:wpilibNewCommands-java:2024.3.2' | ||
|
||
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' | ||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
|
||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
implementation 'com.googlecode.json-simple:json-simple:1.1.1' | ||
} | ||
|
||
// This dependency is exported to consumers, that is to say found on their compile classpath. | ||
api libs.commons.math3 | ||
test { | ||
useJUnitPlatform() | ||
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true' | ||
} | ||
|
||
// This dependency is used internally, and not exposed to consumers on their own compile classpath. | ||
implementation libs.guava | ||
// Configure string concat to always inline compile | ||
tasks.withType(JavaCompile) { | ||
options.compilerArgs.add '-XDstringConcat=inline' | ||
} | ||
|
||
// Apply a specific Java toolchain to ease working on different environments. | ||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(17) | ||
} | ||
project.compileJava.dependsOn(createVersionFile) | ||
gversion { | ||
srcDir = "src/main/java/" | ||
classPackage = "frc.robot" | ||
className = "BuildConstants" | ||
dateFormat = "yyyy-MM-dd HH:mm:ss z" | ||
timeZone = "America/New_York" | ||
indent = " " | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
maven { | ||
url 'https://frcmaven.wpi.edu/artifactory/release/' | ||
} | ||
gradlePluginPortal() | ||
} | ||
|
||
tasks.named('test') { | ||
// Use JUnit Platform for unit tests. | ||
useJUnitPlatform() | ||
spotless { | ||
// optional: limit format enforcement to just the files changed by this feature branch | ||
ratchetFrom 'origin/main' | ||
|
||
format 'misc', { | ||
// define the files to apply `misc` to | ||
target '*.gradle', '.gitattributes', '.gitignore' | ||
|
||
// define the steps to apply to those files | ||
trimTrailingWhitespace() | ||
indentWithTabs() // or spaces. Takes an integer argument if you don't like 4 | ||
endWithNewline() | ||
} | ||
java { | ||
// don't need to set target, it is inferred from java | ||
// Allow ignoring certain parts in formatting. | ||
toggleOffOn() | ||
// apply a specific flavor of google-java-format | ||
googleJavaFormat('1.19.2').aosp().reflowLongStrings() | ||
// fix formatting of type annotations | ||
formatAnnotations() | ||
} | ||
} | ||
|
||
// Automatically format code on build. | ||
compileJava.dependsOn 'spotlessApply' |
Oops, something went wrong.