GayaBalan / ivybeans

Automatically exported from code.google.com/p/ivybeans
0 stars 0 forks source link

RFI: Options to publish source and Javadoc as well as class jars #83

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Environment : ivybeans ANY, netbeans 6.9 , OS Windows, jdk 1.6

Description :

I'm doing this currently, but it requires modifying the ivy-impl files for 
every project (as well as ivy.xml) I set up. It would be a lot neater as 
options on the projects ivy properties pane.

My -ivy-publish targets now look like:

    <target name="-ivy-publish" depends="javadoc">
        <mkdir dir="${dist.dir}/source"/>
        <jar destfile="${dist.dir}/source/${ivy.module.name}.jar" compress="true">
            <fileset dir="src">
                <exclude name="**/.svn/**"/>
            </fileset>
        </jar>
        <jar destfile="${dist.dir}/javadoc/${ivy.module.name}.jar">
            <fileset dir="${dist.dir}/javadoc">
                <exclude name="${ivy.module.name}.jar"/>
            </fileset>
        </jar>
        <ivy:settings file="${ivy.settings.file}"/>
        <ivy:resolve file="ivy.xml"/>
        <ivy:publish forcedeliver="true" overwrite="true" resolver="local">
            <artifacts pattern="${basedir}/${dist.dir}/[type]/[artifact].[ext]"/>
            <artifacts pattern="${basedir}/${dist.dir}/[artifact].[ext]"/>
        </ivy:publish>
    </target>

(It would be helpful it you could edit the templates for the ivy files).

Original issue reported on code.google.com by malcolm....@googlemail.com on 14 Oct 2010 at 10:04

GoogleCodeExporter commented 9 years ago
If you build ivybeans from trunk there is now an ant property 
ivy-publish.artifacts.pattern defined which is used for the publish pattern. 
This can be overridden in project properties or elsewhere.

At present (and I can't see how to do otherwise) it only takes a single value, 
so the problem remains of how to massage your build artifacts into names and 
locations so they can be specified with a single pattern.

For your case, if you have m:classifier 
(xmlns:m="http://ant.apache.org/ivy/maven") attributes in your ivy.xml file at 
xpath = /ivy-module/publications/artifact then you could do it like this 
(because traditionally m:classifier is not specified for jar files, but is for 
source and javadoc)

in project.properties or equivalent in build.xml

ivy-publish.artifacts.pattern=${basedir}/${dist.dir}(/[classifier])/[artifact].[
ext]

Does this help?

Original comment by bruce.ch...@gmail.com on 7 Nov 2010 at 10:57

GoogleCodeExporter commented 9 years ago
Well, it's not just the pattern, there's also the extra actions to generate the 
packed source and Javadoc, so it means modifying the ivy build file anyway.

What I'm suggesting is that options to do this kind of thing could be on the 
Ivy panel of project properties.

To improve flexibility, could we use editable prototypes for ivy.xml and 
build-ivy.xml?

Original comment by malcolm....@googlemail.com on 9 Nov 2010 at 9:31

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Finding it difficult to build the project with netbeans 6.9.1. Are there any 
modifications to be made so as to build within Netbeans 6.9.1 ? or do I have to 
build with a lower version of netbeans? 

Original comment by adekunlelukman@gmail.com on 11 Apr 2011 at 2:54