I asked a question on stackoverflow on how to use custom
configurations [1] to switch I got a good answer from Hans however I
still have some problems which may or may not be related.

Rather than the normal "compile", "runtime" configurations the
configurations I use (for historical reasons) are main, test etc...

Unfortunately when I try and customize the classpath to use this
configurations instead I'm running into problems.  My build (shown
below) has a customization to the sourceSets to achieve this.
Unfortunately when I run it I get an error.  Anyone able to share what
I'm doing wrong?

==========================================

$ gradle compileJava

FAILURE: Build failed with an exception.

* What went wrong:
Circular dependency between tasks. Cycle includes [task ':classes',
task ':compileJava'].

* Try:
Run with -s or -d option to get more details. Run with -S option to
get the full (very verbose) stacktrace.

BUILD FAILED

Total time: 5.917 secs

==========================================



==========================================

defaultTasks 'compileJava'

repositories {
   ... unimportant details chopped ...
}

apply plugin: 'java'

configurations {
  testx  /* Using test as a configuration name does not seem to work */
  main
  web
  lock
  dao
  conf
  tools
}

dependencies {

  main group: "apache", name: "log4j", version: "1.2.15",
configurations: ["default"]
  main group: "google", name: "guice", version: "2.0", configurations:
["default","servlet","spring"]
  main group: "jcip", name: "jcip-annotations", version: "1.0",
configurations: ["default"]

   ... unimportant details chopped ...
}

sourceSets {
  main {
    java {
      srcDir 'gen/java'
      srcDir 'src/java'
    }
    resources {
      srcDir 'src/resources'
    }

    compileClasspath = sourceSets.main.classes + configurations.main
  }

  test {
    java {
      srcDir 'src/test'
    }
  }
}

==========================================


[1] 
http://stackoverflow.com/questions/3437613/alternative-configurations-in-gradle-for-compiling-java/3441717#3441717

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to