Cheers, 
I did read this and other postings, but was hoping that the "promised" dsl 
improvements maybe would have been addressed by now.- Considering that the 
class in question resides in an .internal package it doesn't feel very future 
proof using it ..- Also when adding it to the default archives configuration it 
pretty much ignores the naming parameter to the constructor (it uses the 
project name regardless)
Anyways I ended up creating my own custom configuration and adding it to that. 
Thus preserving the naming scheme I wanted to use for the dll.
Are there any jira issues related to this subject, or is this more of a roadmap 
thing for the version 1+ release ?
kind regardsMagnus

Date: Mon, 9 May 2011 13:27:34 -0700
From: [email protected]
To: [email protected]
Subject: Re: [gradle-user] uploading a gradle produced dll to maven repo

I remember Rene doing something similar:
http://markmail.org/thread/niseybxbjynckr2c#query:+page:1+mid:pgdhc7hrfn2e27o5+state:results


Basically boils down to adding a snippet like:
[code src="build.gradle"]
import org.gradle.api.internal.artifacts.publish.DefaultPublishArtifact

artifacts {
   archives new DefaultPublishArtifact("something", "dll", "dll", null, new 
Date(), file("path/to/something.dll"))

}
[/code]

On Mon, May 9, 2011 at 8:09 AM, Magnus Rundberget <[email protected]> 
wrote:






Hi, 
I've searched a bit, but couldn't really find a good/descriptive solution on 
how to solve the following.


I have a java project producing a jar. Deploying this to my maven repository 
works a charm.
However the same project also produces a dll based on the jar (using ikvm).

Now I'm struggling on figuring out how to upload the generated dll to my maven 
repo using gradle.
any suggestions on how to proceed ?
(see ikvm task below for reference)


cheersMagnus


---- ikvm task for info ----task ikvm(dependsOn: jar) {    def ikvmHome = 
System.getenv()['IKVM_HOME']    def ikvmExec = "$ikvmHome/bin/ikvmc.exe"
    ikvmOutDir = file("$buildDir/ikvm")    ikvmTmpDir = 
file("$buildDir/ikvm/tmp")    def ikvmDll = new File(ikvmOutDir, 
"${project.name}Ikvm.dll")

    inputs.files configurations.compile    outputs.files ikvmDll


    doFirst {        assert ikvmHome, "Du må sette miljoevariable IKVM_HOME til 
katalog hvor ikvm er installert"
        if (!ikvmOutDir.exists()) {            ikvmOutDir.mkdir()        }      
  if (!ikvmTmpDir.exists()) {
            ikvmOutDir.mkdir()        }    }

    doLast {        copy {            from configurations.runtime
            into ikvmTmpDir        }        new 
ByteArrayOutputStream().withStream { os ->
            def result = exec {                commandLine = [ikvmExec, 
"-out:$ikvmDll", jar.archivePath, "-recurse:build/ikvm/tmp/*.jar"]
                errorOutput = os                ignoreExitValue = true          
  }
            if (result.exitValue != 0) {                def outputAsString = 
os.toString()                println "------ Feil i opprettelse av ikvm dll: 
$ikvmDll -------"
                println outputAsString                
result.assertNormalExitValue()            }
        }    }}build.dependsOn ikvm
                                          


-- 
Learn from the past. Live in the present. Plan for the future.
Blog: http://eric-berry.blogspot.com
jEdit <http://www.jedit.org> - Programmer's Text Editor

Bazaar <http://bazaar.canonical.com> - Version Control for Humans
                                          

Reply via email to