Skip to content

Commit f853ee6

Browse files
Added Gradle building and fixed comments
1 parent 78b360d commit f853ee6

11 files changed

Lines changed: 386 additions & 21 deletions

File tree

build.gradle

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
plugins {
2+
id "java"
3+
id "edu.wpi.first.GradleRIO" version "2019.1.1"
4+
id "maven-publish"
5+
}
6+
7+
// Set this to true to enable desktop support.
8+
def includeDesktopSupport = false
9+
10+
// Maven central needed for JUnit
11+
repositories {
12+
mavenCentral()
13+
}
14+
15+
javadoc {
16+
source = sourceSets.main.allJava
17+
classpath = configurations.compile
18+
}
19+
20+
// Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries.
21+
// Also defines JUnit 4.
22+
dependencies {
23+
implementation wpi.deps.wpilib()
24+
implementation wpi.deps.vendor.java()
25+
testImplementation 'junit:junit:4.12'
26+
}
27+
28+
ext {
29+
jarToPublish = file( 'pixy2-java-api.jar' )
30+
}
31+
32+
jar {
33+
baseName 'pixy2-java-api'
34+
}
35+
36+
task sourceJar(type: Jar, dependsOn: classes) {
37+
classifier 'sources'
38+
from sourceSets.main.allSource
39+
}
40+
41+
task javadocJar(type: Jar, dependsOn: javadoc) {
42+
classifier = 'javadoc'
43+
from javadoc.destinationDir
44+
}
45+
46+
publishing {
47+
publications {
48+
mavenJava(MavenPublication) {
49+
from components.java
50+
artifact sourceJar
51+
artifact javadocJar
52+
groupId = 'pw.otake.pseudoresonance'
53+
artifactId = 'pixy2-java-api'
54+
version = '1.0'
55+
pom {
56+
name = 'Pixy2JavaAPI'
57+
description = 'Java port of Pixy2 API for FIRST Robotics'
58+
url = 'https://github.com/PseudoResonance/Pixy2JavaAPI/'
59+
licenses {
60+
license {
61+
name = 'GNU General Public License, version 2'
62+
url = 'http://www.gnu.org/licenses/gpl-2.0.html'
63+
}
64+
}
65+
developers {
66+
developer {
67+
id = 'PseudoResonance'
68+
name = 'PseudoResonance'
69+
email = 'kaio11602@gmail.com'
70+
}
71+
}
72+
}
73+
}
74+
}
75+
repositories {
76+
maven {
77+
def releasesRepoUrl = "http://192.168.1.15:8081/repository/maven-releases/"
78+
def snapshotsRepoUrl = "http://192.168.1.15:8081/repository/maven-snapshots/"
79+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
80+
credentials {
81+
username = project.hasProperty('nexus_username') ? nexus_username : ''
82+
password = project.hasProperty('nexus_password') ? nexus_password : ''
83+
}
84+
}
85+
}
86+
}

gradle/wrapper/gradle-wrapper.jar

54.4 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=permwrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=permwrapper/dists

gradlew

Lines changed: 172 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings.gradle

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import org.gradle.internal.os.OperatingSystem
2+
3+
pluginManagement {
4+
repositories {
5+
mavenLocal()
6+
gradlePluginPortal()
7+
String frcYear = '2019'
8+
File frcHome
9+
if (OperatingSystem.current().isWindows()) {
10+
String publicFolder = System.getenv('PUBLIC')
11+
if (publicFolder == null) {
12+
publicFolder = "C:\\Users\\Public"
13+
}
14+
frcHome = new File(publicFolder, "frc${frcYear}")
15+
} else {
16+
def userFolder = System.getProperty("user.home")
17+
frcHome = new File(userFolder, "frc${frcYear}")
18+
}
19+
def frcHomeMaven = new File(frcHome, 'maven')
20+
maven {
21+
name 'frcHome'
22+
url frcHomeMaven
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)