Looking through DefaultArtifactHandler, I don't think this is going to work
at all.

It seems that 'javascript [whatever]' is expecting 'whatever' to be an
instance of AbstractArchiveTask.

I don't mind creating an instance, but it doesn't really look like it's set
up to handle the possibility of multiple artifacts. It seems that the api's
are set up for a single artifact per configuration.

While, most Javascript libraries I know of only end up having a single
javascript file that they provide for download. I would like to offer the
user the ability of specifying multiple files/artifacts.

I'd like some advice on how best to do this. I'm considering creating an
archive task, and then using a convention to allow user's to specify
additional artifacts.

Eg. By default the archive task will copy and version any file named after
the project.name, or sourceSet.name. If the user wants to specify more than
this, they would need to add this to their build.gradle:
[code src="build.gradle"]
javascript {
   artifacts << ['file_name1_without_extension',
'file_name2_without_extension']
}
[/code]

I'd like user's to be able to use the artifacts closure, as I think most
Gradle user's would expect to. However, I'm not sure how to.

Thanks,
Eric

On Mon, Aug 30, 2010 at 8:51 PM, Eric Berry <[email protected]> wrote:

> Hello,
>    I would like to add some functionality to my Javascript Library plugin
> which would allow user's to specify artifacts for the plugin to version and
> copy over to the lib directory.
>
> Ideally, I would like for user's to be able to do something like:
> [code src="build.gradle"]
> artifacts {
>    javascript ['context_library', 'context2_library']
> }
> [/code]
>
> Where the list are file names which should be versioned and copied to the
> build/libs directory.
>
> Eg. In the case of context2_library, the artifact creation would take the
> file named 'context2_library.js', and then version it and copy it to the
> libs directory, resulting in:
> build/libs/context2_library-[version].js
>
> I'm not sure where to even start on this one. The JavaPlugin seems to need
> to only set up a configuration like this:
> [quote src="JavaPlugin.java:156"]
> Configuration compileConfiguration =
> configurations.add(COMPILE_CONFIGURATION_NAME).setVisible(false).
>                 setDescription("Classpath for compiling the sources.");
> [/quote]
>
> Trying to do this myself doesn't seem to resolve anything, I always get "No
> such property: javascript for class:
> org.gradle.api.internal.artifacts.dsl.DefaultArtifactHandler".
>
> Any help here would be greatly appreciated.
>
> Thanks,
> Eric
>
> --
> Learn from the past. Live in the present. Plan for the future.
> Blog: http://www.townsfolkdesigns.com/blogs/elberry
> jEdit <http://www.jedit.org> - Programmer's Text Editor
> Bazaar <http://bazaar.canonical.com> - Version Control for Humans
>



-- 
Learn from the past. Live in the present. Plan for the future.
Blog: http://www.townsfolkdesigns.com/blogs/elberry
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans

Reply via email to