6
  1. We would like to have a script that does "svn update" and if the depedency.gradle file is in that list of updates, we would like to run a task that ONLY updates dependencies so the developers machine is up to date. What would that task be? I don't see it when running "gradle tasks". Looking for an updatejars or something.

  2. When we build our project, we don't want it to check for jar updates at all!!!! most because that only needs to be done in 2 situations which are #1 above and when someone is updating the dependency.gradle file themselves. For the second thing, they can just run "gradle updatejars" once I know the answer to question #1 that is.

Any ideas? I am just getting into gradle and we really want to keep a consistent environment where when we run our update script, it gets the source code AND the jars in one atomic sweep and we are no longer bothered by checking the repositories every build.

It would be nice to know how to do it by changing the build.gradle file if possible. If not, is there a command line option? (The build.gradle obviously would give me a command line option which is why I prefer that method as I could say compile does not depend on downloading jars).

simont
  • 68,704
  • 18
  • 117
  • 136
Dean Hiller
  • 19,235
  • 25
  • 129
  • 212

2 Answers2

12

Regarding the second question. As far as I understand, Gradle will not attempt to do remote lookups or try to download the jar if it is already in the local cache. This should be true for jars declared with a static version, e.g. testCompile 'junit:junit:4.10'.

If you have dynamic versions, e.g. 1.+ or 1.0-SNAPSHOT, etc. then Gradle has to do a check every now and then. You can fine tune the cache expiry for such dependencies.

To make sure Gradle does not do remote lookups you can also use --offline option. See this doc for details.

With regard to svn update, you have at least 3 options:

  1. Try to use an SvnKit plugin for Gradle

  2. Use the ant svn task (here's how to do svn checkout)

  3. Run external command from Gradle. Use the ExecPlugin or just implement it yourself using Groovy API.

Community
  • 1
  • 1
rodion
  • 14,729
  • 3
  • 53
  • 55
0

Looks like the 1st question I can do with the answer in this post

how to tell gradle to download all the source jars

so I can just gradle eclipse and it will download new jars and update my classpath...nice.

Community
  • 1
  • 1
Dean Hiller
  • 19,235
  • 25
  • 129
  • 212