Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ sudo: required
services:
- docker
script:
- docker run -v $(pwd):/code:rw team5499/frc-testing-image sh -c "cd /code && ./test.sh"
- docker run -v $(pwd):/code:rw team5499/frc-testing-image:frc2019 sh -c "cd /code && ./test.sh"
2 changes: 1 addition & 1 deletion cookiecutter.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"repo_name": "frc20XX",
"year": "20xx",
"team_number": "5499"
}
167 changes: 167 additions & 0 deletions frc-{{cookiecutter.year}}/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# Created by https://www.gitignore.io/api/c++,java,linux,macos,gradle,windows,visualstudiocode

### C++ ###
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

### Java ###
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

### Gradle ###
.gradle
/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

# # VS Code Specific Java Settings
.classpath
.project
.settings/
bin/


# End of https://www.gitignore.io/api/c++,java,linux,macos,gradle,windows,visualstudiocode

# team5499 specific

*.iml
.idea
.tox/
virtualenv_run/
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@ repos:
rev: v1.4.0
hooks:
- id: check-json
exclude: .vscode/launch.json
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: end-of-file-fixer
- id: file-contents-sorter
files: .gitignore
- id: mixed-line-ending
- id: pretty-format-json
args: [--autofix]
exclude: >
(?x)^(
.vscode/launch.json|
.vscode/settings.json|
.wpilib/wpilib_preferences.json
)$
- id: trailing-whitespace
- repo: https://github.com/team5499/pre-commit-hooks
rev: v0.3.2
Expand Down
21 changes: 21 additions & 0 deletions frc-{{cookiecutter.year}}/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"type": "wpilib",
"name": "WPILib Desktop Debug",
"request": "launch",
"desktop": true,
},
{
"type": "wpilib",
"name": "WPILib roboRIO Debug",
"request": "launch",
"desktop": false,
}
]
}
14 changes: 14 additions & 0 deletions frc-{{cookiecutter.year}}/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"bin/": true,
".classpath": true,
".project": true
},
"wpilib.online": true
}
6 changes: 6 additions & 0 deletions frc-{{cookiecutter.year}}/.wpilib/wpilib_preferences.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"enableCppIntellisense": false,
"currentLanguage": "java",
"projectYear": "{{cookiecutter.year}}",
"teamNumber": {{cookiecutter.team_number}}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# {{cookiecutter.repo_name}}
# frc-{{cookiecutter.year}}
## Getting started
### Pre-commit
First, install the project's [pre-commit](http://pre-commit.com/) hooks (**do this immediately after cloning!**)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,52 +1,72 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "1.3.0"
id "edu.wpi.first.GradleRIO" version "2019.0.0-alpha-3"
id "edu.wpi.first.GradleRIO" version "2019.1.1"
}

def ROBOT_CLASS = "frc.team{{cookiecutter.team_number}}.{{cookiecutter.repo_name}}.Robot"
def ROBOT_MAIN_CLASS = "org.team{{cookiecutter.team_number}}.frc{{cookiecutter.year}}.Robot"

// 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.getTeamNumber()
}
}
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'
}
}
}

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

// Maven central needed for JUnit
repositories {
mavenLocal()
mavenCentral()
}

// Defining my dependencies. In this case, WPILib (+ friends)
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
// Also defines JUnit 4.
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.0"

compile wpilib()
compile ctre()
// 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)

// We need to add the Kotlin stdlib in order to use most Kotlin language features.
compile "org.jetbrains.kotlin:kotlin-stdlib"
// 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 {
Expand Down Expand Up @@ -83,7 +103,7 @@ task tox {
task install_hooks(dependsOn: 'tox')

compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 1.11
targetCompatibility = 1.11
options.compilerArgs += '-parameters'
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pluggy==0.8.0
pre-commit==1.12.0
py==1.7.0
pytest==3.10.0
PyYAML==3.13
PyYAML==4.2b2
requirements-tools==1.2.0
scandir==1.9.0
setuptools==40.5.0
Expand Down
25 changes: 25 additions & 0 deletions frc-{{cookiecutter.year}}/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import org.gradle.internal.os.OperatingSystem

pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
String frcYear = '{{cookiecutter.year}}'
File frcHome
if (OperatingSystem.current().isWindows()) {
String publicFolder = System.getenv('PUBLIC')
if (publicFolder == null) {
publicFolder = "C:\\Users\\Public"
}
frcHome = new File(publicFolder, "frc${frcYear}")
} else {
def userFolder = System.getProperty("user.home")
frcHome = new File(userFolder, "frc${frcYear}")
}
def frcHomeMaven = new File(frcHome, 'maven')
maven {
name 'frcHome'
url frcHomeMaven
}
}
}
3 changes: 3 additions & 0 deletions frc-{{cookiecutter.year}}/src/main/deploy/example.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Files placed in this directory will be deployed to the RoboRIO into the
'deploy' directory in the home folder. Use the 'FileUtilities.getFilePath' wpilib function
to get a proper path relative to the deploy directory.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package frc.team{{cookiecutter.team_number}}.{{cookiecutter.repo_name}}
package org.team{{cookiecutter.team_number}}.frc{{cookiecutter.year}}

import edu.wpi.first.wpilibj.TimedRobot

Expand Down
File renamed without changes.
Loading