Skip to content

Commit

Permalink
Update to maven
Browse files Browse the repository at this point in the history
  • Loading branch information
JaciBrunning committed Feb 6, 2015
1 parent 04cbacd commit e5953f7
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 7 deletions.
53 changes: 50 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,65 @@
apply plugin: 'groovy'
apply plugin: BuildGradle

apply plugin: 'maven'

configurations {
deployerJars
}

repositories {
mavenCentral()
}

dependencies {
compile gradleApi()
compile localGroovy()

deployerJars 'org.apache.maven.wagon:wagon-ssh:2.2'
}

group = "jaci.openrio.gradle"
archivesBaseName = "GradleRIO"
version = "1.0.1"

ext.mavenProps = file "../maven.properties"
mavenProps.withReader {
def prop = new Properties()
prop.load(it)
project.ext.mavenProps = new ConfigSlurper().parse prop
}

processResources {
ant.replace(file: 'release/build.gradle', token: "{GRADLERIO_VERSION}", value: version)
}

uploadArchives {
repositories.mavenDeployer {
configuration = configurations.deployerJars
repository(url: mavenProps.jaci.url) {
authentication(userName: mavenProps.jaci.user, password: mavenProps.jaci.auth)
}

pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
project {
name project.archivesBaseName
packaging 'jar'
description 'GradleRIO Build Plugin '
}
}
}
}

class BuildGradle implements Plugin<Project> {
void apply(Project project) {
project.task('release', dependsOn: 'build') << {
ant.copy(file:"build/libs/GradleRIO.jar",
todir: "release/gradle/libs")
//ant.copy(file:"build/libs/GradleRIO.jar",
// todir: "release/gradle/libs")

ant.zip(destfile: "releases/GradleRIO.zip",
ant.zip(destfile: "releases/GradleRIO-${project.version}.zip",
basedir: "release")
}
}
Expand Down
10 changes: 7 additions & 3 deletions release/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ Template file for classes using GradleRIO

buildscript {
repositories {
flatDir name: 'libs', dirs: 'gradle/libs'
mavenCentral()
maven {
name = "GradleRIO"
url = "http://dev.sourcecoded.info/jaci/maven"
}
}
dependencies {
classpath group: 'jaci.openrio.gradle', name: 'GradleRIO', version: '0.1.0'
classpath group: 'jaci.openrio.gradle', name: 'GradleRIO', version: '1.0.1' //Change this line if you wish to Update GradleRIO
}
}

apply plugin: "GradleRIO" //Apply the GradleRIO plugin
apply plugin: 'GradleRIO' //Apply the GradleRIO plugin
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
Expand Down
4 changes: 3 additions & 1 deletion src/main/groovy/jaci/openrio/gradle/GradleRIO.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class GradleRIO implements Plugin<Project> {
def wpiTask = project.task('wpi') << {
println "Downloading WPILib..."
String pluginDest = System.getProperty("user.home") + "/wpilib/java/plugin/current/"
String from = "http://first.wpi.edu/FRC/roborio/release/eclipse/plugins/edu.wpi.first.wpilib.plugins.java_0.1.0.201501011639.jar"
String from = "http://first.wpi.edu/FRC/roborio/release/eclipse/plugins/edu.wpi.first.wpilib.plugins.java_0.1.0.201501221609.jar"
download(pluginDest, from, "plugin.jar")
println "Extracting WPILib..."

Expand All @@ -59,9 +59,11 @@ class GradleRIO implements Plugin<Project> {
def deployTask = project.task('deploy') << {
try {
deploy(rioHost(project))
restartCode(rioHost(project))
} catch (Exception e) {
println "RoboRIO not available... Falling back to IP..."
deploy(rioIP(project))
restartCode(rioIP(project))
}
}
deployTask.dependsOn 'build'
Expand Down

0 comments on commit e5953f7

Please sign in to comment.