Hi Sean,

Am 19.01.11 00:05, schrieb Sean Van Buggenum:
> Hi Rene, and thanks for the reply.
>
> What you said here: "with these informations you can resolve your
> artifact from a common maven repository"
>
> Are you saying that I need to understand maven before I can understand
> how to setup gradle?
No you definitely needn't understand the whole maven hell before setting
up your gradle setup. But Gradle adopted some concepts which are are
orginally invented by maven.
One of these concepts is the unique identification of an artifact. As I
told you, take a look at chapter 32 of the gradle userguide.
> And that I need to have some sort of "common maven repository" to do this?
> I am coming from ant, not maven.
No you are not forced to use a maven repository, you can still use
references to a local directory as you did it with ant I suppose. But
it's defnitely worth to take a look on later on ;-).
> Or can I not perhaps set it up like any other custom ant task? (which
> would seem perhaps much easier ... ) ??
You can change the provided example to use plain jar files from a lib
directory. It should look like this:
-----------

repositories {
        flatDir name: 'localRepository', dirs: 'libs'
}

configurations {
    ftpAntTask
}

dependencies {
    ftpAntTask ":ant-commons-net:1.7.0"
    ftpAntTask ":commons-net:1.4.0"
}

task ftp << {
    ant {
        taskdef(name: 'ftp',
                classname: 'org.apache.tools.ant.taskdefs.optional.net.FTP',
                classpath: configurations.ftpAntTask.asPath)
        ftp(server: "ftp.apache.org", userid: "anonymous", password: 
"[email protected]") {
            fileset(dir: "htdocs/manual")
        }
    }
}

-----------
The example above assumes, that you have the files
ant-commons-net-1.7.0.jar and commons-net-1.4.0.jar in the libs
directory of the project.
Gradle needs to know where your thirdparty libs are located. The
repository closure contains a defnition of a flat directory (the libs
folder in your project) to be used by gradle.
After that you define the needed dependencies in the dependencies
closure. The String ":ant-commons-net:1.7.0" referes to an artifact with
the name "ant-commons-net" with the version "1.7.0" As a default, gradle
now looks for a file with the pattern "[name]-[version].jar" in your
libs folder and adds this to the ftpAntTask configuration.

I hope this helps.
>
>
> On 19 January 2011 00:07, Rene Groeschke <[email protected]> wrote:
>> Am Di, 18.01.2011, 10:58, schrieb Sean Van Buggenum:
>>> Hi all,
>>>
>>>
>>> mail is an optional ant task. First i've tried adding the mail.java and
>>> activation.jar files to the appropriate places (in the gradle/lib path)
>>> like I had already before for ant. That didn't work.
>>>
>>>
>>> I've seen an example a similar problem, in the gradle doco
>>>
>>>
>>> http://www.gradle.org/0.8/docs/userguide/organizing_build_logic.html
>>>
>>>
>>> configurations { ftpAntTask }
>>>
>>>
>>> dependencies { ftpAntTask("org.apache.ant:ant-commons-net:1.7.0") {
>>> module("commons-net:commons-net:1.4.1") {
>>> dependencies "oro:oro:2.0.8:jar" }
>>> }
>>> }
>>>
>>>
>>> but I do not quite understand it, and how I can apply it to my problem.
>>>
>>>
>>> What is that string that is used the keyword 'dependencies'
>>> And that string in the module task ("commons-net:commons-net:1.4.1)
>>> What sort of string is this?
>> This string is used as a unique identifier for the artifact you depend on.
>>
>> If you have the snippet:
>> dependencies {
>>   ftpAntTask("org.apache.ant:ant-commons-net:1.7.0")
>> }
>>
>> is just a common shortcut for
>> dependencies {
>>   ftpAntTask(group:"org.apache.ant", name:"ant-commons-net"version:"1.7.0")
>> }
>>
>> with these informations you can resolve your artifact from a common maven
>> repository. if you're not sure about the detailed unique version string,
>> you can have a look at
>> http://mvnrepository.com/artifact/org.apache.ant/ant-javamail/1.8.2
>>
>> This is explained in detail in the gradle user guide (chapter 32) have
>> look at
>> gradle.org/0.9.1/docs/userguide/dependency_management.html#sec:dependency_configurations
>> .
>>
>> regards,
>> René
>>
>>>
>>> I would have to add the mail.jar and activation.jar in this somehow ,
>>> but I don't understand this syntax.
>>>
>>> Would be helpful if someone can tell me what it should look like.
>>> But also, obviously I am new to groovy (as well as gradle) .... and
>>> this is probably the reason why I have no real idea of how to work this out
>>> for myself, without a concrete example. What should I read/look at to
>>> inform myself? Is this groovy knowledge I need in this particular case, or
>>> gradle knowledge only?
>>>
>>> thanks,
>>>
>>> sean
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>
>>> http://xircles.codehaus.org/manage_email
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>


-- 
------------------------------------
Rene Groeschke

[email protected]
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------


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

    http://xircles.codehaus.org/manage_email


Reply via email to