Skip to content

Commit e5953f7

Browse files
committed
Update to maven
1 parent 04cbacd commit e5953f7

3 files changed

Lines changed: 60 additions & 7 deletions

File tree

build.gradle

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,65 @@
11
apply plugin: 'groovy'
22
apply plugin: BuildGradle
33

4+
apply plugin: 'maven'
5+
6+
configurations {
7+
deployerJars
8+
}
9+
10+
repositories {
11+
mavenCentral()
12+
}
13+
414
dependencies {
515
compile gradleApi()
616
compile localGroovy()
17+
18+
deployerJars 'org.apache.maven.wagon:wagon-ssh:2.2'
19+
}
20+
21+
group = "jaci.openrio.gradle"
22+
archivesBaseName = "GradleRIO"
23+
version = "1.0.1"
24+
25+
ext.mavenProps = file "../maven.properties"
26+
mavenProps.withReader {
27+
def prop = new Properties()
28+
prop.load(it)
29+
project.ext.mavenProps = new ConfigSlurper().parse prop
30+
}
31+
32+
processResources {
33+
ant.replace(file: 'release/build.gradle', token: "{GRADLERIO_VERSION}", value: version)
34+
}
35+
36+
uploadArchives {
37+
repositories.mavenDeployer {
38+
configuration = configurations.deployerJars
39+
repository(url: mavenProps.jaci.url) {
40+
authentication(userName: mavenProps.jaci.user, password: mavenProps.jaci.auth)
41+
}
42+
43+
pom {
44+
groupId = project.group
45+
version = project.version
46+
artifactId = project.archivesBaseName
47+
project {
48+
name project.archivesBaseName
49+
packaging 'jar'
50+
description 'GradleRIO Build Plugin '
51+
}
52+
}
53+
}
754
}
855

956
class BuildGradle implements Plugin<Project> {
1057
void apply(Project project) {
1158
project.task('release', dependsOn: 'build') << {
12-
ant.copy(file:"build/libs/GradleRIO.jar",
13-
todir: "release/gradle/libs")
59+
//ant.copy(file:"build/libs/GradleRIO.jar",
60+
// todir: "release/gradle/libs")
1461

15-
ant.zip(destfile: "releases/GradleRIO.zip",
62+
ant.zip(destfile: "releases/GradleRIO-${project.version}.zip",
1663
basedir: "release")
1764
}
1865
}

release/build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ Template file for classes using GradleRIO
55

66
buildscript {
77
repositories {
8-
flatDir name: 'libs', dirs: 'gradle/libs'
8+
mavenCentral()
9+
maven {
10+
name = "GradleRIO"
11+
url = "http://dev.sourcecoded.info/jaci/maven"
12+
}
913
}
1014
dependencies {
11-
classpath group: 'jaci.openrio.gradle', name: 'GradleRIO', version: '0.1.0'
15+
classpath group: 'jaci.openrio.gradle', name: 'GradleRIO', version: '1.0.1' //Change this line if you wish to Update GradleRIO
1216
}
1317
}
1418

15-
apply plugin: "GradleRIO" //Apply the GradleRIO plugin
19+
apply plugin: 'GradleRIO' //Apply the GradleRIO plugin
1620
apply plugin: 'java'
1721
apply plugin: 'idea'
1822
apply plugin: 'eclipse'

src/main/groovy/jaci/openrio/gradle/GradleRIO.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class GradleRIO implements Plugin<Project> {
4040
def wpiTask = project.task('wpi') << {
4141
println "Downloading WPILib..."
4242
String pluginDest = System.getProperty("user.home") + "/wpilib/java/plugin/current/"
43-
String from = "http://first.wpi.edu/FRC/roborio/release/eclipse/plugins/edu.wpi.first.wpilib.plugins.java_0.1.0.201501011639.jar"
43+
String from = "http://first.wpi.edu/FRC/roborio/release/eclipse/plugins/edu.wpi.first.wpilib.plugins.java_0.1.0.201501221609.jar"
4444
download(pluginDest, from, "plugin.jar")
4545
println "Extracting WPILib..."
4646

@@ -59,9 +59,11 @@ class GradleRIO implements Plugin<Project> {
5959
def deployTask = project.task('deploy') << {
6060
try {
6161
deploy(rioHost(project))
62+
restartCode(rioHost(project))
6263
} catch (Exception e) {
6364
println "RoboRIO not available... Falling back to IP..."
6465
deploy(rioIP(project))
66+
restartCode(rioIP(project))
6567
}
6668
}
6769
deployTask.dependsOn 'build'

0 commit comments

Comments
 (0)