Skip to content

Commit

Permalink
still some sort of issue running git here
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandunn committed Mar 15, 2016
1 parent 377f545 commit 401ffb2
Showing 1 changed file with 32 additions and 39 deletions.
71 changes: 32 additions & 39 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//import org.ajoberstar.grgit.*
//import org.ajoberstar.gradle.git.tasks.*



/*
* This build file was auto generated by running the Gradle 'init' task
* by 'nathandunn' at '3/14/16 12:08 PM' with Gradle 2.11
Expand All @@ -13,15 +11,16 @@
*/
ant.importBuild 'build.xml'


// Apply the java plugin to add support for Java
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'idea'

buildscript {
repositories { mavenCentral() }
dependencies { classpath 'org.ajoberstar:gradle-git:1.4.2' }
}
//buildscript {
// repositories { mavenCentral() }
// dependencies { classpath 'org.ajoberstar:gradle-git:1.4.2' }
//}

// In this section you declare where to find the dependencies of your project
repositories {
Expand Down Expand Up @@ -55,7 +54,7 @@ task evaluateJBrowseConfigs {
jbrowsePlugins = jbrowseConfig.plugins
// if apollo-config.groovy exists, read THAT in and apply it as well
File testFile = new File("apollo-config.groovy")
if(testFile){
if (testFile) {
def revisedConfig = new ConfigSlurper().parse(new File("apollo-config.groovy").toURI().toURL())
jbrowseConfig = revisedConfig.jbrowse ?: jbrowseConfig
jbrowsePlugins << revisedConfig.jbrowse.plugins
Expand All @@ -65,7 +64,7 @@ task evaluateJBrowseConfigs {
println "final plugins ${jbrowsePlugins}"
}

task copyResourcesDev(dependsOn:"copy-resources-dev") << {
task copyResourcesDev(dependsOn: "copy-resources-dev") << {

}

Expand All @@ -81,7 +80,7 @@ task installJBrowse(dependsOn: "setup-jbrowse") << {
// copyResourcesDev.execute()
}

task setupJBrowse(dependsOn:"setup-jbrowse") << { }
task setupJBrowse(dependsOn: "setup-jbrowse") << {}

//task cloneGitRepo(type: GitClone) {
// def destination = file("abcd")
Expand All @@ -91,78 +90,72 @@ task setupJBrowse(dependsOn:"setup-jbrowse") << { }
// enabled = !destination.exists() //to clone only once
//}

task cloneGitExec(type: Exec) << {
println "TRYING TO CLOEN ${currentPlugin}"
if(currentPlugin){
task cloneGitExec(type: Exec) {
onlyIf { Task task ->
println "TRYING TO CLOEN ${currentPlugin}"
workingDir "jbrowse-download/plugins/${currentPlugin.key}"

println "CLONNING "
execCommand "git"
commandLine "clone",currentPlugin.value.git
// execCommand "git"
commandLine "git", "clone", currentPlugin.value.git
println "CLONED ABC"
standardOutput = new ByteArrayOutputStream()
println "STARNDARD OUTPUT ${standardOutput}"
}
else{
execCommand ""
return currentPlugin != null
}
}

task installJBrowsePlugins << {

task installJBrowsePlugins << {
println "installing jbrowse plugins ${jbrowsePlugins}"

for(plugin in jbrowsePlugins){
for (plugin in jbrowsePlugins) {
currentPlugin = plugin
println "KEY ${plugin.key}"
println "GIT ${plugin.value}"
def path = pluginsDirectory+"/"+plugin.key
def path = pluginsDirectory + "/" + plugin.key
def pluginExists = confirmPlugin(path)
if(plugin.value.included==true){
if(pluginExists){
if (plugin.value.included == true) {
if (pluginExists) {
println "Plugin ${path} exists and appears valid."
}
else{
} else {
println "ERROR: There is a problem with the plugin at ${path}!"
}
}
else
if(plugin.value.git){
} else if (plugin.value.git) {
println "is GIT"
if(pluginExists){
if (pluginExists) {
println "Plugin ${path} exists and appears valid."
println "git pull if alwaysPull"
println "git checkout proper directory"
}
else{
} else {
println "git clone to the proper directory"
// def grgit = Grgit.clone(dir: pluginsDirectory, uri: '[email protected]:ajoberstar/grgit.git')
println "cloning from ${plugin.value.git} into ${path}"
currentPlugin = plugin
// tasks["cloneGitExec"].execute()
if(currentPlugin){
if (currentPlugin) {
cloneGitExec.execute()
File testFile = new File(".")
"/usr/bin/git clone ${plugin.value.git}".execute(null,testFile)
}
println "CLONED from ${plugin.value.git} into ${path}"

// def grgit = Grgit.clone(dir: path, uri: plugin.value.git)
// def grgit = Grgit.clone(dir: "ASdf", uri: plugin.value.git)
// ["git","clone",plugin.value.git].execute()
}
}
else
if(plugin.value.url==true){
if(!pluginExists){
} else if (plugin.value.url == true) {
if (!pluginExists) {
println "Plugin ${path} exists and appears valid."
}
}
else{
} else {
println "not included . . requiring action"
}
}
}

// root task
task handleJBrowse (dependsOn:['evaluateJBrowseConfigs','installJBrowse','installJBrowsePlugins',"copyResourcesDev"]) <<{
task handleJBrowse(dependsOn: ['evaluateJBrowseConfigs', 'installJBrowse', 'installJBrowsePlugins', "copyResourcesDev"]) << {
println "handling jbrowse ${jbrowseConfig}"

}
Expand Down

0 comments on commit 401ffb2

Please sign in to comment.