Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
2019 beta (#6)
Browse files Browse the repository at this point in the history
* Updating to the 5.9.2 release
  • Loading branch information
pjreiniger authored Jan 9, 2019
1 parent 5a41094 commit 7573022
Show file tree
Hide file tree
Showing 44 changed files with 2,209 additions and 1,006 deletions.
17 changes: 11 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,17 @@ script:
- cp -r $HOME/.m2/repository/com/snobot/simulator ../../pjreiniger/maven_repo/com/snobot


# deploy:
# - provider: script
# script: pwd; cd ../../pjreiniger/maven_repo; pwd; ls; chmod +x commit_updates.sh; ./commit_updates.sh
# skip_cleanup: true
# on:
# branch: master
deploy:
- provider: script
script: pwd; cd ../../pjreiniger/maven_repo; pwd; ls; chmod +x commit_updates.sh; ./commit_updates.sh
skip_cleanup: true
on:
branch: master
- provider: script
script: pwd; cd ../../pjreiniger/maven_repo; pwd; ls; chmod +x commit_updates.sh; ./commit_updates.sh
skip_cleanup: true
on:
branch: 2019-beta

env:
global:
Expand Down
159 changes: 88 additions & 71 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@

import org.gradle.api.tasks.testing.logging.TestLogEvent

plugins {
id 'edu.wpi.first.NativeUtils' version '1.7.7'
id "edu.wpi.first.GradleJni" version "0.3.0"
id "cpp"
id "java"
id "eclipse"
id 'edu.wpi.first.NativeUtils' version '2.1.2'
id "edu.wpi.first.GradleJni" version "0.3.1"
id "cpp"
id "java"
id "eclipse"
}

ext.ctre_library_version = "5.3.1.0"
ext.release_version = "V0_" + ctre_library_version
ext.ctre_library_version = "5.9.2"
ext.release_version = "V0_" + ctre_library_version + "_RC"

repositories {
mavenCentral()
Expand All @@ -17,116 +19,131 @@ repositories {
url "http://first.wpi.edu/FRC/roborio/maven/release/"
}
maven {
url 'https://raw.githubusercontent.com/Open-RIO/Maven-Mirror/master/m2'
url 'http://devsite.ctr-electronics.com/maven/release/'
}
}

ext.allwpilibVersion = {
return '2018.4.1'
return '2019.1.1'
}

ext.getWpiUtilVersion = {
return '3.2.0'
return allwpilibVersion()
}

sourceSets {
main {
java {
srcDirs += "ctre_source/main/java"
}
}
main {
java {
srcDirs += "ctre_source/api-java/java"
}
}
}


apply from: "config.gradle"
model {

components {
CtreSimulation(JniNativeLibrarySpec) {
baseName = 'CTRE_PhoenixCCI'

enableCheckTask true
javaCompileTasks << compileJava
jniCrossCompileOptions << JniCrossCompileOptions('athena')
sources {
cpp {
source {
srcDirs = ["src/main/native/cpp"]
includes = ["**/*.cpp"]
}
exportedHeaders {
srcDirs = ["src/main/native/include", "ctre_source/main/native/include"]
}
}
}
}
}
components {
CtreSimulation(JniNativeLibrarySpec) {
baseName = 'CTRE_PhoenixCCI'

enableCheckTask true
javaCompileTasks << compileJava
jniCrossCompileOptions << JniCrossCompileOptions('athena')
sources {
cpp {
source {
srcDirs = ["src/main/native/cpp"]
includes = ["**/*.cpp"]
}
exportedHeaders {
srcDirs = ["src/main/native/include",
"ctre_source/cci/native/include",
"ctre_source/core/native/include"]
}
}
}
}
}
}


task packageNativeFilesInJar(type: Jar) {
destinationDir = project.buildDir
classifier = org.gradle.internal.os.OperatingSystem.current().getFamilyName() + "-" + getCurrentArch();

project.model {
binaries {
withType(SharedLibraryBinarySpec) { binary ->
if (binary.component.name == "CtreSimulation")
{
destinationDir = project.buildDir
classifier = org.gradle.internal.os.OperatingSystem.current().getFamilyName() + getCurrentArch();
if (org.gradle.internal.os.OperatingSystem.current().isMacOsX())
{
classifier = "osx"
}

project.model {
binaries {
withType(SharedLibraryBinarySpec) { binary ->
if (binary.component.name == "CtreSimulation")
{
dependsOn binary.buildTask
from(binary.sharedLibraryFile) {

into NativeUtils.getPlatformPath(binary)
}
}
}
}
}
from(binary.sharedLibraryFile) {

into NativeUtils.getPlatformPath(binary)
}
}
}
}
}
}


dependencies {

testCompile 'edu.wpi.first.wpiutil:wpiutil-java:' + getWpiUtilVersion()
testCompile 'edu.wpi.first.wpiutil:wpiutil-java:' + getWpiUtilVersion()
testCompile 'edu.wpi.first.wpilibj:wpilibj-java:' + allwpilibVersion()
compile 'edu.wpi.first.wpilibj:wpilibj-jni:' + allwpilibVersion() + ":all"

testCompile 'org.junit.jupiter:junit-jupiter-api:5.2.0'
testCompile 'org.junit.jupiter:junit-jupiter-params:5.2.0'
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.2.0'
testRuntime 'org.junit.platform:junit-platform-launcher:1.2.0'
testCompile 'org.junit.jupiter:junit-jupiter-api:5.2.0'
testCompile 'org.junit.jupiter:junit-jupiter-params:5.2.0'
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.2.0'
testRuntime 'org.junit.platform:junit-platform-launcher:1.2.0'

compile 'org.apache.logging.log4j:log4j-api:2.11.0'
compile 'org.apache.logging.log4j:log4j-core:2.11.0'
compile 'org.apache.logging.log4j:log4j-api:2.11.0'
compile 'org.apache.logging.log4j:log4j-core:2.11.0'

testRuntime packageNativeFilesInJar.outputs.files
testCompile "openrio.mirror.third.ctre:CTRE-phoenix-java:" + ctre_library_version
testRuntime packageNativeFilesInJar.outputs.files
testCompile "com.ctre.phoenix:api-java:" + ctre_library_version
testCompile "com.ctre.phoenix:wpiapi-java:" + ctre_library_version
}

test {
useJUnitPlatform {
}
useJUnitPlatform()
testLogging {
events TestLogEvent.FAILED,
TestLogEvent.SKIPPED
//TestLogEvent.STANDARD_OUT
exceptionFormat "full"
}
}

jar {
exclude('com/ctre/**')
exclude('com/ctre/**')
}

javadoc {
failOnError = false
failOnError = false
}


eclipse.classpath.file.whenMerged { classpath ->
classpath.entries.each {
if(it.path.contains("CtreSimulator")) {
it.setNativeLibraryLocation("$rootDir/build/libs/ctreSimulation/shared")
}
}
classpath.entries.each {
if(it.path.contains("CtreSimulator")) {
it.setNativeLibraryLocation("$rootDir/build/libs/ctreSimulation/shared/release")
}
}
}

tasks.withType(Test) {
systemProperty "java.library.path", "$rootDir/build/libs/ctreSimulation/shared"
systemProperty "java.library.path", "$rootDir/build/libs/ctreSimulation/shared/release"
}

wrapper {
gradleVersion = '5.0'
}

apply from: "publish.gradle"
Loading

0 comments on commit 7573022

Please sign in to comment.