From 4d612bc82d22b5ec6de3d80d5b3a77794ac31cdc Mon Sep 17 00:00:00 2001 From: Ben Scholar Date: Tue, 6 Nov 2018 17:31:52 -0800 Subject: [PATCH 1/9] added travis to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0a30ca6..40e17b0 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![CircleCI](https://circleci.com/gh/team5499/frc-template.svg?style=svg)](https://circleci.com/gh/team5499/frc-template) +(https://api.travis-ci.org/team5499/frc-template.svg) + Cookiecutter template for our FRC/WPILib projects ## Usage From fd8d41eb93a4b18d5d50a071a6627d73c3365863 Mon Sep 17 00:00:00 2001 From: Ben Scholar Date: Tue, 6 Nov 2018 17:33:17 -0800 Subject: [PATCH 2/9] fixed now? --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 40e17b0..e8698fc 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![CircleCI](https://circleci.com/gh/team5499/frc-template.svg?style=svg)](https://circleci.com/gh/team5499/frc-template) -(https://api.travis-ci.org/team5499/frc-template.svg) +[![TravisCI](https://api.travis-ci.org/team5499/frc-template.svg)] Cookiecutter template for our FRC/WPILib projects From 30c315a7e02e200580b5e66b1782e0b1930ce5ce Mon Sep 17 00:00:00 2001 From: Ben Scholar Date: Tue, 6 Nov 2018 17:34:08 -0800 Subject: [PATCH 3/9] maybe now? --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e8698fc..8080218 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![CircleCI](https://circleci.com/gh/team5499/frc-template.svg?style=svg)](https://circleci.com/gh/team5499/frc-template) -[![TravisCI](https://api.travis-ci.org/team5499/frc-template.svg)] +![TravisCI](https://api.travis-ci.org/team5499/frc-template.svg) Cookiecutter template for our FRC/WPILib projects From 85d2d99b6e58ef1967d06506fb928b37f3409ec9 Mon Sep 17 00:00:00 2001 From: Ben Scholar Date: Tue, 6 Nov 2018 17:34:46 -0800 Subject: [PATCH 4/9] finally --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 8080218..3574755 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # frc-template -[![CircleCI](https://circleci.com/gh/team5499/frc-template.svg?style=svg)](https://circleci.com/gh/team5499/frc-template) - ![TravisCI](https://api.travis-ci.org/team5499/frc-template.svg) Cookiecutter template for our FRC/WPILib projects From 2e95e32fb0c15e5417d39d002b3a1818a8aa761b Mon Sep 17 00:00:00 2001 From: Ben Scholar Date: Tue, 6 Nov 2018 17:44:33 -0800 Subject: [PATCH 5/9] fixed merge issues and added link --- README.md | 4 +++- {{cookiecutter.repo_name}}/.pre-commit-config.yaml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3574755..1d6999c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # frc-template -![TravisCI](https://api.travis-ci.org/team5499/frc-template.svg) +[![TravisCI](https://api.travis-ci.org/team5499/frc-template.svg)] +(https://travis-ci.org/team5499/frc-template) + Cookiecutter template for our FRC/WPILib projects diff --git a/{{cookiecutter.repo_name}}/.pre-commit-config.yaml b/{{cookiecutter.repo_name}}/.pre-commit-config.yaml index 34ff6ec..197058f 100644 --- a/{{cookiecutter.repo_name}}/.pre-commit-config.yaml +++ b/{{cookiecutter.repo_name}}/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: args: [--autofix] - id: trailing-whitespace - repo: https://github.com/team5499/pre-commit-hooks - rev: v0.3.1 + rev: v0.3.2 hooks: - id: ktlint-wrapper args: [--color, --format, --relative, --verbose] From b9d196d9084a9a8a040da93fdb2ad3756f2a946f Mon Sep 17 00:00:00 2001 From: Ben Scholar Date: Tue, 6 Nov 2018 17:46:50 -0800 Subject: [PATCH 6/9] trying... --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1d6999c..84ae8b8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # frc-template -[![TravisCI](https://api.travis-ci.org/team5499/frc-template.svg)] -(https://travis-ci.org/team5499/frc-template) +[![TravisCI](https://api.travis-ci.org/team5499/frc-template.svg)](https://travis-ci.org/team5499/frc-template) + Cookiecutter template for our FRC/WPILib projects From 62c8b797b7f77a860accd566e6087ec9d5e1016c Mon Sep 17 00:00:00 2001 From: Ben Scholar Date: Thu, 25 Apr 2019 18:04:30 -0700 Subject: [PATCH 7/9] added new version of gradleRIO --- .gitignore | 1 + {{cookiecutter.repo_name}}/build.gradle | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ac96206 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.gradle/ \ No newline at end of file diff --git a/{{cookiecutter.repo_name}}/build.gradle b/{{cookiecutter.repo_name}}/build.gradle index af13f9c..5c5cb4e 100644 --- a/{{cookiecutter.repo_name}}/build.gradle +++ b/{{cookiecutter.repo_name}}/build.gradle @@ -1,6 +1,6 @@ plugins { - id "org.jetbrains.kotlin.jvm" version "1.3.0" - id "edu.wpi.first.GradleRIO" version "2019.0.0-alpha-3" + id "org.jetbrains.kotlin.jvm" version "1.3.20" + id "edu.wpi.first.GradleRIO" version "2019.3.2" } def ROBOT_CLASS = "frc.team{{cookiecutter.team_number}}.{{cookiecutter.repo_name}}.Robot" @@ -38,7 +38,7 @@ dependencies { compile ctre() // We need to add the Kotlin stdlib in order to use most Kotlin language features. - compile "org.jetbrains.kotlin:kotlin-stdlib" + compile "org.jetbrains.kotlin:kotlin-stdlib:1.3.20" } // Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar') From 10e277e8fbd31e5e4257cbaa842c3251acc8d255 Mon Sep 17 00:00:00 2001 From: Ben Scholar Date: Thu, 25 Apr 2019 18:05:59 -0700 Subject: [PATCH 8/9] added main file --- .../{{cookiecutter.repo_name}}/Main.kt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 {{cookiecutter.repo_name}}/src/main/kotlin/frc/team{{cookiecutter.team_number}}/{{cookiecutter.repo_name}}/Main.kt diff --git a/{{cookiecutter.repo_name}}/src/main/kotlin/frc/team{{cookiecutter.team_number}}/{{cookiecutter.repo_name}}/Main.kt b/{{cookiecutter.repo_name}}/src/main/kotlin/frc/team{{cookiecutter.team_number}}/{{cookiecutter.repo_name}}/Main.kt new file mode 100644 index 0000000..21c9a6b --- /dev/null +++ b/{{cookiecutter.repo_name}}/src/main/kotlin/frc/team{{cookiecutter.team_number}}/{{cookiecutter.repo_name}}/Main.kt @@ -0,0 +1,20 @@ +package frc.team{{cookiecutter.team_number}}.{{cookiecutter.repo_name}} + +import edu.wpi.first.wpilibj.RobotBase + +import java.util.function.Supplier + +public class Main { + + /** + * Main initialization function. Do not perform any initialization here. + * + *

If you change your main robot class, change the parameter type. + */ + companion object { + @JvmStatic + public fun main(args: Array) { + RobotBase.startRobot(Supplier { Robot() }) + } + } +} From 159a89d50ddc5f05e8fee938364e11a870159565 Mon Sep 17 00:00:00 2001 From: Ben Scholar Date: Fri, 26 Apr 2019 15:44:55 -0700 Subject: [PATCH 9/9] maybe works --- {{cookiecutter.repo_name}}/build.gradle | 62 ++++++++++++++++++------- 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/{{cookiecutter.repo_name}}/build.gradle b/{{cookiecutter.repo_name}}/build.gradle index 5c5cb4e..29bebd3 100644 --- a/{{cookiecutter.repo_name}}/build.gradle +++ b/{{cookiecutter.repo_name}}/build.gradle @@ -3,50 +3,80 @@ plugins { id "edu.wpi.first.GradleRIO" version "2019.3.2" } -def ROBOT_CLASS = "frc.team{{cookiecutter.team_number}}.{{cookiecutter.repo_name}}.Robot" +def ROBOT_MAIN_CLASS = "frc.team{{cookiecutter.team_number}}.{{cookiecutter.repo_name}}.Main" // Define my targets (RoboRIO) and artifacts (deployable files) // This is added by GradleRIO's backing project EmbeddedTools. deploy { targets { - target("roborio", edu.wpi.first.gradlerio.frc.RoboRIO) { - // Team can be overridden by command line, for use with VSCode - team = getTeamOrDefault({{cookiecutter.team_number}}) + roboRIO("roborio") { + // Team number is loaded either from the .wpilib/wpilib_preferences.json + // or from command line. If not found an exception will be thrown. + // You can use getTeamOrDefault(team) instead of getTeamNumber if you + // want to store a team number in this file. + team = frc.getTeamOrDefault({{cookiecutter.team_number}}) } } artifacts { // We still use FRCJavaArtifact since kotlin does respond as a Java build. - artifact('frcKotlin', edu.wpi.first.gradlerio.frc.FRCJavaArtifact) { + frcJavaArtifact('frcKotlin') { targets << "roborio" // Debug can be overridden by command line, for use with VSCode - debug = getDebugOrDefault(false) + debug = frc.getDebugOrDefault(false) + } + // Built in artifact to deploy arbitrary files to the roboRIO. + fileTreeArtifact('frcStaticFileDeploy') { + // The directory below is the local directory to deploy + files = fileTree(dir: 'src/main/deploy') + // Deploy to RoboRIO target, into /home/lvuser/deploy + targets << "roborio" + directory = '/home/lvuser/deploy' } } } +def includeDesktopSupport = true + repositories { mavenLocal() mavenCentral() + maven { + url 'https://maven.team5499.org' + } + maven { + url "http://devsite.ctr-electronics.com/maven/release/" + } + maven { + url "https://repo1.maven.org/maven2/" + } } + // Defining my dependencies. In this case, WPILib (+ friends) dependencies { - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.1' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.1' + // We need to add the Kotlin stdlib in order to use most Kotlin language features. + compile 'org.jetbrains.kotlin:kotlin-stdlib:1.3.20' - compile wpilib() - compile ctre() + compile 'org.tinylog:tinylog-api:2.0.0-M3' + compile 'org.tinylog:tinylog-impl:2.0.0-M3' - // We need to add the Kotlin stdlib in order to use most Kotlin language features. - compile "org.jetbrains.kotlin:kotlin-stdlib:1.3.20" + // wpilib specific + compile wpi.deps.wpilib() + compile wpi.deps.vendor.java() + nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio) + nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop) + + // test framework = JUnit5 + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.1' } // Setting up my Jar File. In this case, adding all libraries into the main jar ('fat jar') // in order to make them all available at runtime. Also adding the manifest so WPILib // knows where to look for our Robot Class. jar { - from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } - manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_CLASS) + from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS) } test { @@ -83,7 +113,7 @@ task tox { task install_hooks(dependsOn: 'tox') compileTestJava { - sourceCompatibility = 1.8 - targetCompatibility = 1.8 + sourceCompatibility = 1.11 + targetCompatibility = 1.11 options.compilerArgs += '-parameters' }