diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 00000000..b50b2267 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,55 @@ +name: Nightly + +on: + workflow_dispatch: + schedule: + - cron: '13 12 * * *' + +jobs: + nightly: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + artifact-name: Linux + build-options: "-PlinuxBuild" + - os: macos-latest + artifact-name: macOS + build-options: "-PmacBuild" + - os: windows-latest + artifact-name: Win64 + build-options: "" + + name: "Build - ${{ matrix.artifact-name }}" + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: actions/setup-java@v1 + with: + java-version: 11 + + - uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.100 + + - uses: actions/setup-node@v1 + with: + node-version: '10.x' + + - name: Setup Development Artifacts + shell: bash + run: ./automation/nightly_setup.sh + + - name: Build Installer + shell: bash + run: ./gradlew generateInstallers -PjenkinsBuild ${{ matrix.build-options }} + + - uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact-name }} + path: build/pubOutputs/ diff --git a/WPILibShortcutCreator/ShortcutData.json b/WPILibShortcutCreator/ShortcutData.json index e2d70c73..d1b791ef 100644 --- a/WPILibShortcutCreator/ShortcutData.json +++ b/WPILibShortcutCreator/ShortcutData.json @@ -2,8 +2,8 @@ "IsAdmin": false, "DesktopShortcuts": [ { - "Path": "C:\\Users\\Public\\wpilib\\2021\\vscode\\Code.exe", - "Name": "FRC 2021\\FRC VS Code 2021", + "Path": "C:\\Users\\Public\\wpilib\\2022\\vscode\\Code.exe", + "Name": "FRC 2022\\FRC VS Code 2022", "Description": "Shortcut for FRC VS Code" } ], @@ -15,5 +15,5 @@ "AddToPath": [ ], - "IconLocation": "C:\\Users\\Public\\wpilib\\2021\\frccode\\wpilib-256.ico" + "IconLocation": "C:\\Users\\Public\\wpilib\\2022\\frccode\\wpilib-256.ico" } diff --git a/automation/nightly_setup.sh b/automation/nightly_setup.sh new file mode 100755 index 00000000..2be3a324 --- /dev/null +++ b/automation/nightly_setup.sh @@ -0,0 +1,78 @@ +#!/bin/bash + +# This script sets up the nightly build, including building development +# artifacts for GradleRIO and VS Code Extension from their respective main +# branches. + +set -e + +# Detect the operating system and store OS-specific commands in variables +# to be evaluated later. +NPM_PACKAGE_CMD="" +NPM_PACKAGE_LOC="" +SED_CMD="sed -i" +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + NPM_PACKAGE_CMD="npm run packageLinux && tar -C build/wpilibutility-linux-x64 -pcvzf wpilibutility-linux.tar.gz ." + NPM_PACKAGE_LOC="wpilibutility-linux.tar.gz" +elif [[ "$OSTYPE" == "darwin"* ]]; then + NPM_PACKAGE_CMD="npm run packageMac && tar -C build/wpilibutility-darwin-x64 -pcvzf wpilibutility-mac.tar.gz ." + NPM_PACKAGE_LOC="wpilibutility-mac.tar.gz" + SED_CMD="sed -i {}" +else + NPM_PACKAGE_CMD="npm run packageWindows && powershell -Command \"Compress-Archive -Path build\wpilibutility-win32-ia32\* -DestinationPath wpilibutility-windows.zip\"" + NPM_PACKAGE_LOC="wpilibutility-windows.zip" +fi + +# First, a version number for the nightly is generated. +LATEST_TAG=$(git describe --abbrev=0) +LATEST_TAG_TRIMMED=${LATEST_TAG:1} +DATE=$(date +"%Y%m%d") +VERSION="$LATEST_TAG_TRIMMED-$DATE" + +# Next, we will clone the latest versions of GradleRIO and VS Code +# Extension repositories. +function clone() { + if [ ! -d $1 ]; then + git clone "https://github.com/wpilibsuite/$1" + else + cd $1 + git reset --hard + git pull + cd .. + fi +} +clone "GradleRIO" +clone "vscode-wpilib" + +# Publish a development version of GradleRIO. +cd GradleRIO + +# Temporarily use 2020 ni-libraries while 2022 runtime is still not available. +# eval "$SED_CMD \"13s/+/2020.+/\"" versionupdates.gradle + +./gradlew updateVersions -PuseDevelopment +./gradlew publishToMavenLocal -x patchExamples -PpublishVersion=$VERSION +cd .. + +# Publish a development version of the VS Code Extension. +cd vscode-wpilib +echo "$VERSION" > vscode-wpilib/resources/gradle/version.txt +./gradlew updateVersions updateAllDependencies -PbuildServer -PpublishVersion=$VERSION + +cd vscode-wpilib +npm install +npm run gulp +npm run webpack +npm run vscePackage + +cd ../wpilib-utility-standalone +npm install +npm run compile +eval "$NPM_PACKAGE_CMD" +cd ../.. + +# Update the version numbers in the installer and set the VS Code Extension +# and Standalone Utility location. +echo "gradleRioVersion: $VERSION" >gradle.properties +echo "vscodeLoc: vscode-wpilib/vscode-wpilib/vscode-wpilib-$VERSION.vsix" >>gradle.properties +echo "standaloneLoc: vscode-wpilib/wpilib-utility-standalone/$NPM_PACKAGE_LOC" >> gradle.properties diff --git a/build.gradle b/build.gradle index 6dcf6164..8a6aa770 100644 --- a/build.gradle +++ b/build.gradle @@ -11,8 +11,8 @@ buildscript { plugins { id 'java' id 'cpp' - id "de.undercouch.download" version "4.1.1" apply false - id "com.github.johnrengelman.shadow" version "6.0.0" apply false + id "de.undercouch.download" version "4.1.2" apply false + id "com.github.johnrengelman.shadow" version "7.0.0" apply false } apply from: "automation/macos_notarization.gradle" @@ -71,7 +71,7 @@ if (project.hasProperty('linuxBuild')) { project.ext.dotnetRuntime = 'win-x64' } -ext.frcYear = '2021' +ext.frcYear = '2022' apply from: 'scripts/gradlew.gradle' apply from: 'scripts/installer.gradle' @@ -411,5 +411,5 @@ tasks.register('generateInstallers', Task) { } wrapper { - gradleVersion = '6.6.1' + gradleVersion = '7.1.1' } diff --git a/gradle.properties b/gradle.properties index 255b04eb..4a2ba53d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -gradleRioVersion: 2021.3.1 +gradleRioVersion: 2022.0.0 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c0..7454180f 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 12d38de6..05679dc3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradleriobase/build.gradle b/gradleriobase/build.gradle index d561cb50..7db3fd0e 100644 --- a/gradleriobase/build.gradle +++ b/gradleriobase/build.gradle @@ -1,5 +1,4 @@ import org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier -import jaci.gradle.nativedeps.NativeDepsSpec import com.google.gson.GsonBuilder buildscript { @@ -15,39 +14,51 @@ plugins { id "edu.wpi.first.GradleRIO" } +wpi.java.debugJni = false dependencies { - implementation wpi.deps.wpilib() - nativeZip wpi.deps.wpilibJni(wpi.platforms.roborio) - nativeDesktopZip wpi.deps.wpilibJni(wpi.platforms.desktop) + implementation wpi.java.deps.wpilib() + implementation wpi.java.vendor.java() + nativeDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.roborio) + nativeDebug wpi.java.vendor.jniDebug(wpi.platforms.roborio) - implementation wpi.deps.vendor.java() - nativeZip wpi.deps.vendor.jni(wpi.platforms.roborio) - nativeDesktopZip wpi.deps.vendor.jni(wpi.platforms.desktop) + nativeRelease wpi.java.deps.wpilibJniRelease(wpi.platforms.roborio) + nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.roborio) - simulation wpi.deps.sim.gui(wpi.platforms.desktop, false) - simulation wpi.deps.sim.gui(wpi.platforms.desktop, true) - simulation wpi.deps.sim.driverstation(wpi.platforms.desktop, false) - simulation wpi.deps.sim.driverstation(wpi.platforms.desktop, true) - simulation wpi.deps.sim.ws_server(wpi.platforms.desktop, false) - simulation wpi.deps.sim.ws_server(wpi.platforms.desktop, true) - simulation wpi.deps.sim.ws_client(wpi.platforms.desktop, false) - simulation wpi.deps.sim.ws_client(wpi.platforms.desktop, true) + 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() - implementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.12' + + // simulation wpi.deps.sim.gui(wpi.platforms.desktop, false) + // simulation wpi.deps.sim.gui(wpi.platforms.desktop, true) + // simulation wpi.deps.sim.driverstation(wpi.platforms.desktop, false) + // simulation wpi.deps.sim.driverstation(wpi.platforms.desktop, true) + // simulation wpi.deps.sim.ws_server(wpi.platforms.desktop, false) + // simulation wpi.deps.sim.ws_server(wpi.platforms.desktop, true) + // simulation wpi.deps.sim.ws_client(wpi.platforms.desktop, false) + // simulation wpi.deps.sim.ws_client(wpi.platforms.desktop, true) // commands - implementation "edu.wpi.first.wpilibNewCommands:wpilibNewCommands-java:${wpi.wpilibVersion}" - implementation "edu.wpi.first.wpilibOldCommands:wpilibOldCommands-java:${wpi.wpilibVersion}" + implementation "edu.wpi.first.wpilibNewCommands:wpilibNewCommands-java:${wpi.versions.wpilibVersion.get()}" + implementation "edu.wpi.first.wpilibOldCommands:wpilibOldCommands-java:${wpi.versions.wpilibVersion.get()}" if (project(":").ext.buildClassifier == 'Windows32') { - implementation "edu.wpi.first.msvc:runtime:${project(':gradleriobase').wpi.wpilibVersion}:x86@zip" + implementation "edu.wpi.first.msvc:runtime:${project(':gradleriobase').wpi.versions.wpilibVersion.get()}:x86@zip" } else if (project(":").ext.buildClassifier == 'Windows64') { - implementation "edu.wpi.first.msvc:runtime:${project(':gradleriobase').wpi.wpilibVersion}:x64@zip" + implementation "edu.wpi.first.msvc:runtime:${project(':gradleriobase').wpi.versions.wpilibVersion.get()}:x64@zip" } } +// TODO add the rest of simulation +wpi.sim.addGui() +wpi.sim.addDriverstation() + model { components { frcUserProgram(NativeExecutableSpec) { @@ -55,38 +66,38 @@ model { targetPlatform wpi.platforms.desktop // Defining the dependencies. - wpi.deps.wpilib(it) - wpi.deps.googleTest(it) + wpi.cpp.deps.wpilib(it) + wpi.cpp.deps.googleTest(it) - wpi.useLibrary(it, 'wpilib_new_commands_shared') - wpi.useLibrary(it, 'wpilib_old_commands_shared') + wpi.cpp.deps.useLibrary(it, 'wpilib_new_commands_shared') + wpi.cpp.deps.useLibrary(it, 'wpilib_old_commands_shared') } frcUserProgramStatic(NativeExecutableSpec) { targetPlatform wpi.platforms.roborio targetPlatform wpi.platforms.desktop // Defining the dependencies. - wpi.deps.wpilibStatic(it) - wpi.deps.googleTest(it) + wpi.cpp.deps.wpilibStatic(it) + wpi.cpp.deps.googleTest(it) } } } -class WPIDepsGrabber implements Plugin { - void apply(Project project) { +// class WPIDepsGrabber implements Plugin { +// void apply(Project project) { - } +// } - static class WPIDepGrabberRules extends RuleSource { +// static class WPIDepGrabberRules extends RuleSource { - @Mutate - void triggerDeps(ModelMap tasks, NativeDepsSpec deps) { - System.out.println('Model triggered') - } - } -} +// @Mutate +// void triggerDeps(ModelMap tasks, NativeDepsSpec deps) { +// System.out.println('Model triggered') +// } +// } +// } -apply plugin: WPIDepsGrabber +// apply plugin: WPIDepsGrabber tasks.register('modelEvaluationTrigger') { diff --git a/gradlew b/gradlew index 4f906e0c..744e882e 100755 --- a/gradlew +++ b/gradlew @@ -72,7 +72,7 @@ case "`uname`" in Darwin* ) darwin=true ;; - MINGW* ) + MSYS* | MINGW* ) msys=true ;; NONSTOP* ) diff --git a/scripts/jdk.gradle b/scripts/jdk.gradle index 88e94345..a8177fdd 100644 --- a/scripts/jdk.gradle +++ b/scripts/jdk.gradle @@ -43,9 +43,9 @@ configurations { dependencies { if (project.ext.buildClassifier == 'Windows32') { - runtimex86 "edu.wpi.first.msvc:runtime:${project(':gradleriobase').wpi.wpilibVersion}:x86@zip" + runtimex86 "edu.wpi.first.msvc:runtime:${project(':gradleriobase').wpi.versions.wpilibVersion}:x86@zip" } else if (project.ext.buildClassifier == 'Windows64') { - runtimex64 "edu.wpi.first.msvc:runtime:${project(':gradleriobase').wpi.wpilibVersion}:x64@zip" + runtimex64 "edu.wpi.first.msvc:runtime:${project(':gradleriobase').wpi.versions.wpilibVersion}:x64@zip" } } diff --git a/scripts/maven.gradle b/scripts/maven.gradle index 4832b2ae..7ed6dedb 100644 --- a/scripts/maven.gradle +++ b/scripts/maven.gradle @@ -28,12 +28,12 @@ def cppToolsArtifacts = [ ] dependencies { - documentationCpp "edu.wpi.first.wpilibc:documentation:${project(':gradleriobase').wpi.wpilibVersion}@zip" - documentationJava "edu.wpi.first.wpilibj:documentation:${project(':gradleriobase').wpi.wpilibVersion}@zip" + documentationCpp "edu.wpi.first.wpilibc:documentation:${project(':gradleriobase').wpi.versions.wpilibVersion.get()}@zip" + documentationJava "edu.wpi.first.wpilibj:documentation:${project(':gradleriobase').wpi.versions.wpilibVersion.get()}@zip" if (project.ext.buildClassifier == 'Windows32') { - runtimex86 "edu.wpi.first.msvc:runtime:${project(':gradleriobase').wpi.wpilibVersion}:x86@zip" + runtimex86 "edu.wpi.first.msvc:runtime:${project(':gradleriobase').wpi.versions.wpilibVersion.get()}:x86@zip" } else if (project.ext.buildClassifier == 'Windows64') { - runtimex64 "edu.wpi.first.msvc:runtime:${project(':gradleriobase').wpi.wpilibVersion}:x64@zip" + runtimex64 "edu.wpi.first.msvc:runtime:${project(':gradleriobase').wpi.versions.wpilibVersion.get()}:x64@zip" } } diff --git a/scripts/toolchain.gradle b/scripts/toolchain.gradle index e6b786b3..5707cd20 100644 --- a/scripts/toolchain.gradle +++ b/scripts/toolchain.gradle @@ -1,31 +1,42 @@ -def gitTag = 'v2021-2' +def gitTag = 'v2022-1' def baseUrl = "https://github.com/wpilibsuite/roborio-toolchain/releases/download/$gitTag/" def gccVersion = '7.3.0' -def fileName = 'FRC-2021-Windows-Toolchain-7.3.0.zip' +def fileName32 = 'FRC-2022-Windows32-Toolchain-7.3.0.zip' +def fileName64 = 'FRC-2022-Windows64-Toolchain-7.3.0.zip' -def downloadUrl = baseUrl + fileName -def fileWin = file("$buildDir/$fileName") +def downloadUrl32 = baseUrl + fileName32 +def fileWin32 = file("$buildDir/$fileName32") -def fileNameMac = 'FRC-2021-Mac-Toolchain-7.3.0.tar.gz' +def downloadUrl64 = baseUrl + fileName64 +def fileWin64 = file("$buildDir/$fileName64") + +def fileNameMac = 'FRC-2022-Mac-Toolchain-7.3.0.tar.gz' def downloadUrlMac = baseUrl + fileNameMac def fileMac = file("$buildDir/$fileNameMac") -def fileNameLinux = 'FRC-2021-Linux-Toolchain-7.3.0.tar.gz' +def fileNameLinux = 'FRC-2022-Linux-Toolchain-7.3.0.tar.gz' def downloadUrlLinux = baseUrl + fileNameLinux def fileLinux = file("$buildDir/$fileNameLinux") apply plugin: 'de.undercouch.download' -def downloadTask = tasks.register('downloadToolchain', Download) { - src downloadUrl +def downloadTask32 = tasks.register('downloadToolchain32', Download) { + src downloadUrl32 dest buildDir overwrite false } +def downloadTask64 = tasks.register('downloadToolchain64', Download) { + src downloadUrl64 + dest buildDir + overwrite false +} + + def downloadTaskMac = tasks.register('downloadToolchainMac', Download) { src downloadUrlMac @@ -41,7 +52,7 @@ def downloadTaskLinux = tasks.register('downloadToolchainLinux', Download) { ext.toolchainConfigTaskSetup = { return new Tuple2({ task-> - task.inputs.property 'toolchainName', fileName + task.inputs.property 'toolchainName', fileName64 }, { config-> def toolchainConfig = [:]; @@ -61,7 +72,7 @@ ext.toolchainZipSetup = { AbstractArchiveTask zip-> zip.from(project.tarTree(project.resources.gzip(fileLinux))) { eachFile { f-> - f.path = f.path.replace('frc2021/roborio/', 'roborio/') + f.path = f.path.replace('frc2022/roborio/', 'roborio/') } includeEmptyDirs = false @@ -75,20 +86,33 @@ ext.toolchainZipSetup = { AbstractArchiveTask zip-> zip.from(project.tarTree(project.resources.gzip(fileMac))) { eachFile { f-> - f.path = f.path.replace('frc2021/roborio/', 'roborio/') + f.path = f.path.replace('frc2022/roborio/', 'roborio/') + } + + includeEmptyDirs = false + } + } else if (project.hasProperty('windows32')) { + zip.dependsOn downloadTask32 + + zip.inputs.file fileWin32 + + zip.from(project.zipTree(fileWin32)) { + + eachFile { f-> + f.path = f.path.replace('frc2022/roborio/', 'roborio/') } includeEmptyDirs = false } } else { - zip.dependsOn downloadTask + zip.dependsOn downloadTask64 - zip.inputs.file fileWin + zip.inputs.file fileWin64 - zip.from(project.zipTree(fileWin)) { + zip.from(project.zipTree(fileWin64)) { eachFile { f-> - f.path = f.path.replace('frc2021/roborio/', 'roborio/') + f.path = f.path.replace('frc2022/roborio/', 'roborio/') } includeEmptyDirs = false diff --git a/scripts/vscode.gradle b/scripts/vscode.gradle index 9916ff56..c7f45e86 100644 --- a/scripts/vscode.gradle +++ b/scripts/vscode.gradle @@ -1,7 +1,7 @@ def vscodeFile = file("$buildDir/vscodeConfig.json") -def vsCodeVersion = '1.52.1' +def vsCodeVersion = '1.60.2' def wpilibVersion = gradleRioVersion