Skip to content

Commit

Permalink
it builds and has been published to maven local but hasn't been teste…
Browse files Browse the repository at this point in the history
…d yet due to issues between advantagekit and wpilib versions
  • Loading branch information
minhnguyenbhs committed Dec 27, 2024
1 parent 32b35f9 commit 425299c
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 79 deletions.
106 changes: 32 additions & 74 deletions controls/build.gradle
Original file line number Diff line number Diff line change
@@ -1,88 +1,19 @@
import java.text.SimpleDateFormat
import com.vanniktech.maven.publish.SonatypeHost
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar

plugins {
id "java"
id "maven-publish"
id "com.peterabeles.gversion" version "1.10"
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
id "com.diffplug.spotless" version "6.24.0"
id "com.vanniktech.maven.publish" version "0.30.0"
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

// Set this to true to enable desktop support.
def includeDesktopSupport = true

configurations.all {
// exclude group: "edu.wpi.first.wpilibj"
}

task(checkAkitInstall, dependsOn: "classes", type: JavaExec) {
mainClass = "org.littletonrobotics.junction.CheckInstall"
classpath = sourceSets.main.runtimeClasspath
}
// TODO: Figure out why advantagekit won't let us build the project
//compileJava.finalizedBy checkAkitInstall

// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
// Also defines JUnit 5.
dependencies {

//def akitJson = new groovy.json.JsonSlurper().parseText(new File(projectDir.getAbsolutePath() + "/vendordeps/AdvantageKit.json").text)
//annotationProcessor "org.littletonrobotics.akit.junction:junction-autolog:$akitJson.version"
def akitVersion = "4.0.0-alpha-1"
annotationProcessor "org.littletonrobotics.akit.junction:junction-autolog:$akitVersion"

implementation "org.littletonrobotics.akit.junction:junction-core:$akitVersion"

testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

implementation 'com.googlecode.json-simple:json-simple:1.1.1'
}

test {
useJUnitPlatform()
systemProperty 'junit.jupiter.extensions.autodetection.enabled', 'true'
}

// Configure string concat to always inline compile
tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
}

// 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 {
// Use Maven Central for resolving dependencies.
mavenCentral()
mavenLocal()
maven {
url 'https://frcmaven.wpi.edu/artifactory/release/'
}
maven {
url = uri("https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit")
credentials {
username = "Mechanical-Advantage-Bot"
password = "\u0067\u0068\u0070\u005f\u006e\u0056\u0051\u006a\u0055\u004f\u004c\u0061\u0079\u0066\u006e\u0078\u006e\u0037\u0051\u0049\u0054\u0042\u0032\u004c\u004a\u006d\u0055\u0070\u0073\u0031\u006d\u0037\u004c\u005a\u0030\u0076\u0062\u0070\u0063\u0051"
}
}
gradlePluginPortal()
}


spotless {
// optional: limit format enforcement to just the files changed by this feature branch
ratchetFrom 'origin/main'
Expand All @@ -107,7 +38,34 @@ java {
}
}

// Automatically format code on build.
compileJava.dependsOn 'spotlessApply'


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
}

// Apply a specific Java toolchain to ease working on different environments.
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

tasks.named('test') {
// Use JUnit Platform for unit tests.
useJUnitPlatform()
}

compileJava.dependsOn 'spotlessApply'


Expand All @@ -122,7 +80,7 @@ mavenPublishing {
pom {
name = project.name
inceptionYear = "2024"
description = 'FRC 401 core vision library'
description = 'FRC 401 core controls library'
url = 'http://www.github.com/team401/coppercore'
licenses {
license {
Expand Down
25 changes: 25 additions & 0 deletions parameter_tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,37 @@ plugins {
id 'java-library'
id "com.diffplug.spotless" version "6.24.0"
id "com.vanniktech.maven.publish" version "0.30.0"
id "com.peterabeles.gversion" version "1.10"
}

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
mavenLocal()
maven {
url 'https://frcmaven.wpi.edu/artifactory/release/'
}
maven {
url = uri("https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit")
credentials {
username = "Mechanical-Advantage-Bot"
password = "\u0067\u0068\u0070\u005f\u006e\u0056\u0051\u006a\u0055\u004f\u004c\u0061\u0079\u0066\u006e\u0078\u006e\u0037\u0051\u0049\u0054\u0042\u0032\u004c\u004a\u006d\u0055\u0070\u0073\u0031\u006d\u0037\u004c\u005a\u0030\u0076\u0062\u0070\u0063\u0051"
}
}
gradlePluginPortal()
}

task(checkAkitInstall, dependsOn: "classes", type: JavaExec) {
mainClass = "org.littletonrobotics.junction.CheckInstall"
classpath = sourceSets.main.runtimeClasspath
}

dependencies {

def akitVersion = "4.0.0-alpha-1"
annotationProcessor "org.littletonrobotics.akit.junction:junction-autolog:$akitVersion"
implementation "org.littletonrobotics.akit.junction:junction-core:$akitVersion"

// Use JUnit Jupiter for testing.
testImplementation libs.junit.jupiter

Expand All @@ -29,8 +52,10 @@ dependencies {

}


// Apply a specific Java toolchain to ease working on different environments.
java {

toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions wpilib_interface/src/main/java/frc/robot/BuildConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ public final class BuildConstants {
public static final String MAVEN_GROUP = "io.github.team401.coppercore";
public static final String MAVEN_NAME = "wpilib_interface";
public static final String VERSION = "2025.0.0-beta";
public static final int GIT_REVISION = 45;
public static final String GIT_SHA = "531a9e363639e92e794307ba38162963d2a9cb38";
public static final String GIT_DATE = "2024-12-22 16:56:37 EST";
public static final int GIT_REVISION = 46;
public static final String GIT_SHA = "32b35f9263c6b44e36a674758abfa906d2a37502";
public static final String GIT_DATE = "2024-12-22 23:48:44 EST";
public static final String GIT_BRANCH = "73-add-logged-tunable-number-to-coppercore";
public static final String BUILD_DATE = "2024-12-22 23:43:32 EST";
public static final long BUILD_UNIX_TIME = 1734929012028L;
public static final String BUILD_DATE = "2024-12-26 21:42:39 EST";
public static final long BUILD_UNIX_TIME = 1735267359194L;
public static final int DIRTY = 1;

private BuildConstants() {}
Expand Down

0 comments on commit 425299c

Please sign in to comment.