Skip to content

Instantly share code, notes, and snippets.

@ysb33r
Created Aug 27, 2014
Embed
What would you like to do?
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

mojavelinux commented May 13, 2016

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