Skip to content

Instantly share code, notes, and snippets.

@ysb33r
Created August 27, 2014 10:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ysb33r/9f95bab338b912c45986 to your computer and use it in GitHub Desktop.
Save ysb33r/9f95bab338b912c45986 to your computer and use it in GitHub Desktop.
Faking Repositories in Gradle
repositories {
ivy {
url 'http://somewhere.example/root'
layout ('pattern') {
artifact '[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier])(.[ext])'
}
}
}
$ gradle -btryIt.gradle --info tryIt
Starting Build
Settings evaluated using empty settings script.
Projects loaded. Root project using build file '/home/me/tryIt.gradle'.
Included projects: [root project 'me']
Evaluating root project 'me' using build file '/home/me/tryIt.gradle'.
Compiling build file '/home/me/tryIt.gradle' using StatementExtractingScriptTransformer.
Compiling build file '/home/me/tryIt.gradle' using BuildScriptTransformer.
All projects evaluated.
Selected primary task 'DefaultTaskParameter{taskName='tryIt',projectPath='null'}'
Tasks to be executed: [task ':tryIt']
:hello (Thread[main,5,main]) started.
:hello
Executing task ':tryIt' (up-to-date check took 0.002 secs) due to:
Task has not declared any outputs.
Resource missing. [HTTP GET: http://download.sourceforge.net/project/libusb/libusb-1.0/ivy-1.0.19/ivy-1.0.19.xml]
Download http://download.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.19/libusb-1.0.19.tar.bz2
[/home/me/.gradle/caches/modules-2/files-2.1/libusb/libusb/1.0.19/c5d14ced155233ceeb5107c7eb3b94b16649ae05/libusb-1.0.19.tar.bz2]
:me (Thread[main,5,main]) completed. Took 4.055 secs.
repositories {
ivy {
url 'http://download.sourceforge.net/project'
layout ('pattern') {
artifact '[organisation]/[module]-1.0/[artifact]-[revision]/[artifact]-[revision].[ext]'
}
}
}
repositories {
ivy {
url 'http://download.sourceforge.net/project'
layout ('pattern') {
artifact '[organisation]/[module]-1.0/[artifact]-[revision]/[artifact]-[revision].[ext]'
}
}
}
configurations {
foo
}
dependencies {
foo 'libusb:libusb:1.0.19@tar.bz2'
}
task tryIt << {
println configurations.foo.files
}
@mojavelinux
Copy link

I'm not quite getting how to link this to gem ':asciidoctor-bespoke:0@gem'. What do I do after Gradle downloads the Ivy dependency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment