Posted By

laurenceosx on 05/13/13


Tagged

groovy


Versions (?)

install_camel-jgroups_2.11-SNAPSHOT


 / Published in: Groovy
 

URL: http://faroe228.googlecode.com/svn/trunk/SvnAndMvnInstallFor_camel-jgroups_2.11-SNAPSHOT/InstallScript/install_camel-jgroups_2.11-SNAPSHOT.groovy

// file: installcamel-jgroups2.11-SNAPSHOT.groovy // url: http://faroe228.googlecode.com/svn/trunk/SvnAndMvnInstallForcamel-jgroups2.11-SNAPSHOT/InstallScript/installcamel-jgroups2.11-SNAPSHOT.groovy

  1. #!/usr/bin/env groovy
  2.  
  3. // file: install_camel-jgroups_2.11-SNAPSHOT.groovy
  4. // url: http://faroe228.googlecode.com/svn/trunk/SvnAndMvnInstallFor_camel-jgroups_2.11-SNAPSHOT/InstallScript/install_camel-jgroups_2.11-SNAPSHOT.groovy
  5.  
  6. /*
  7.  
  8. // Sample gradle snippet for using installed camel-jgroups:2.11-SNAPSHOT
  9.  
  10. repositories {
  11.   maven { url 'http://repo.grails.org/grails/repo' } // I have found this to be more reliable for spring/hibernate jars than maven central
  12.   maven { url 'http://repository.jboss.org/nexus/content/groups/public-jboss' } // good to have
  13.   maven { url 'http://repo.fusesource.com/nexus/content/groups/public' } // for activemq-all:5.8.0'
  14.  
  15.   mavenCentral()
  16.   mavenLocal() // !!! because we installed camel-jgroups:2.11-SNAPSHOT to m2local
  17. }
  18.  
  19. dependencies {
  20.   compile 'org.apache-extras.camel-extra:camel-jgroups:2.11-SNAPSHOT' // !!!
  21. }
  22.  
  23.   */
  24.  
  25. ant = new AntBuilder()
  26.  
  27. def osWin = System.properties.'os.name'.toLowerCase().contains('windows')
  28. String osShell = osWin ? 'cmd' : 'sh' ; // for ant.exec executable
  29. String osShellFirstArg = osWin ? '/c' : '' ; // for ant.exec arg value
  30. String osShellLinePrefix = osWin ? osShellFirstArg + ' ' : '' ; // for ant.exec arg line
  31.  
  32. String theSrc = "http://faroe228.googlecode.com/svn/trunk/SvnAndMvnInstallFor_camel-jgroups_2.11-SNAPSHOT.zip"
  33. String theDest = theSrc.split('/').last() // e.g. SvnAndMvnInstallFor_camel-jgroups_2.11-SNAPSHOT.zip
  34.  
  35. String explodedZipFolderName = theDest[0 ..< theDest.lastIndexOf('.')]
  36.  
  37. ant.delete( dir: explodedZipFolderName )
  38.  
  39. ant.get(src: theSrc, dest: theDest, skipexisting: 'true')
  40. ant.unzip( src: theDest, dest: '.' )
  41.  
  42. ant.exec( executable: osShell, dir: explodedZipFolderName ) {
  43. arg( line: osShellLinePrefix + "gradlew" )
  44. }

Report this snippet  

You need to login to post a comment.