ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "subes (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (IVY-1176) Problem with resolve (ivy.deps.changed) and timestamp of ivy.xml of dependencies
Date Fri, 12 Mar 2010 12:48:27 GMT

    [ https://issues.apache.org/jira/browse/IVY-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844484#action_12844484
] 

subes edited comment on IVY-1176 at 3/12/10 12:46 PM:
------------------------------------------------------

I've created an ugly workaround for this by running the report target and then checking if
there have been any new downloads in the last resolve:

        <!-- checkifchanged und ivy.deps.changed ist absolut nutzlos https://issues.apache.org/jira/browse/IVY-1176
-->
        <ivy:resolve conf="default,tests,sources" checkIfChanged="true" keep="true" />
        <!-- report muss für den fix vor dem if sein, ansonsten wieder reinpacken -->
        <ivy:report todir="${lib.dir}" graph="false" />
        <if>
            <or>
                <not>
                    <available file="${basedir}/.classpath" />
                </not>
                <!-- workaround für ivy.deps.changed bis jira issue geklärt ist -->
                <equals arg1="ivy.deps.changed" arg2="true" />
                <not>
                    <isfileselected file="${lib.dir}/${projekt.organisation}-${projekt.name}-default.html">
                        <contains text="0 downloaded" />
                    </isfileselected>
                </not>
                <not>
                    <isfileselected file="${lib.dir}/${projekt.organisation}-${projekt.name}-tests.html">
                        <contains text="0 downloaded" />
                    </isfileselected>
                </not>
            </or>
            <then>
                <property name="ivy.deps.changed.true" value="true" />
                <delete dir="${lib.default.dir}" quiet="true" />
                <delete dir="${lib.tests.dir}" quiet="true" />
                <delete dir="${lib.sources.dir}" quiet="true" />
                <ivy:retrieve conf="default" pattern="${lib.default.dir}/${ivy.pattern}"
/>
                <ivy:retrieve conf="tests" pattern="${lib.tests.dir}/${ivy.pattern}" />
                <ivy:retrieve conf="sources" pattern="${lib.sources.dir}/${ivy.pattern}"
/>
                <groovy src="${metaprojekt.ant.groovy.dir}/EclipseClasspath.groovy" />
            </then>
            <else>
                <echo message="Überspringe retrieve für ${projekt.name}." />
            </else>
        </if>

If yes, the changed libs are retrieved to a clean lib dir, the eclipse .classpath file gets
regenerated and a property gets set for the compile target, that it should not be skipped.
With this method, the higher level libs get the information about new downloads recursively,
because lower level libs publish themselves again if a lib has been changed for them.
The lib that changed in the first place won't be responsible for another download, but the
newly published lib will be now. This goes on until the build is complete and duplicate builds
don't happen.
So I get everything I wish for.

Though, if ivy supported this directly, I wouldn't have to run the report target and thus
save some time in my compilation process.
If you don't want to set ivy.libs.changed on new downloads, could you maybe atleast provide
a property that indicates that new downloads have been made?

      was (Author: subes):
    I've created an ugly workaround for this by running the report target and then checking
if there have been any new downloads in the last resolve:

        <!-- checkifchanged und ivy.deps.changed ist absolut nutzlos https://issues.apache.org/jira/browse/IVY-1176
-->
        <ivy:resolve conf="default,tests,sources" checkIfChanged="true" keep="true" />
        <!-- report muss für den fix vor dem if sein, ansonsten wieder reinpacken -->
        <ivy:report todir="${lib.dir}" graph="false" />
        <if>
            <or>
                <!--<equals arg1="true" arg2="true" />-->
                <not>
                    <available file="${basedir}/.classpath" />
                </not>
                <!-- workaround für ivy.deps.changed bis jira issue geklärt ist -->
                <equals arg1="ivy.deps.changed" arg2="true" />
                <not>
                    <isfileselected file="${lib.dir}/${projekt.organisation}-${projekt.name}-default.html">
                        <contains text="0 downloaded" />
                    </isfileselected>
                </not>
                <not>
                    <isfileselected file="${lib.dir}/${projekt.organisation}-${projekt.name}-tests.html">
                        <contains text="0 downloaded" />
                    </isfileselected>
                </not>
            </or>
            <then>
                <property name="ivy.deps.changed.true" value="true" />
                <delete dir="${lib.default.dir}" quiet="true" />
                <delete dir="${lib.tests.dir}" quiet="true" />
                <delete dir="${lib.sources.dir}" quiet="true" />
                <ivy:retrieve conf="default" pattern="${lib.default.dir}/${ivy.pattern}"
/>
                <ivy:retrieve conf="tests" pattern="${lib.tests.dir}/${ivy.pattern}" />
                <ivy:retrieve conf="sources" pattern="${lib.sources.dir}/${ivy.pattern}"
/>
                <groovy src="${metaprojekt.ant.groovy.dir}/EclipseClasspath.groovy" />
            </then>
            <else>
                <echo message="Überspringe retrieve für ${projekt.name}." />
            </else>
        </if>

If yes, the changed libs are retrieved to a clean lib dir, the eclipse .classpath file gets
regenerated and a property gets set for the compile target, that it should not be skipped.
With this method, the higher level libs get the information about new downloads recursively,
because lower level libs publish themselves again if a lib has been changed for them.
The lib that changed in the first place won't be responsible for another download, but the
newly published lib will be now. This goes on until the build is complete and duplicate builds
don't happen.
So I get everything I wish for.

Though, if ivy supported this directly, I wouldn't have to run the report target and thus
save some time in my compilation process.
If you don't want to set ivy.libs.changed on new downloads, could you maybe atleast provide
a property that indicates that new downloads have been made?
  
> Problem with resolve (ivy.deps.changed) and timestamp of ivy.xml of dependencies
> --------------------------------------------------------------------------------
>
>                 Key: IVY-1176
>                 URL: https://issues.apache.org/jira/browse/IVY-1176
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.0
>            Reporter: subes
>            Priority: Blocker
>
> Hi,
> I am having the same Issue as Jan Vissers on the mailing list:
> http://mail-archives.apache.org/mod_mbox/ant-ivy-user/200803.mbox/%3C10985.145.53.56.90.1204817182.squirrel@webmail.xs4all.nl%3E
> http://mail-archives.apache.org/mod_mbox/ant-ivy-user/200803.mbox/%3C47D11E2A.1050704@cumquat.nl%3E
> The problem is, ivy.deps.changed does not get set to true if the timestamp of the dependencies
ivy.xml got updated.
> The call to resolve actually tells me that the new files got downloaded (because of the
updated timestamp), but ivy.deps.changed tells me that the artifacts did not change.
> [ivy:resolve] 	---------------------------------------------------------------------
> [ivy:resolve] 	|                  |            modules            ||   artifacts   |
> [ivy:resolve] 	|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
> [ivy:resolve] 	---------------------------------------------------------------------
> [ivy:resolve] 	|      default     |   26  |   1   |   1   |   0   ||   26  |   1   |
> [ivy:resolve] 	|       tests      |   3   |   1   |   1   |   0   ||   3   |   1   |
> [ivy:resolve] 	|      sources     |   10  |   1   |   1   |   0   ||   10  |   1   |
> [ivy:resolve] 	---------------------------------------------------------------------
> --> ivy.deps.changed is "false"
> This behaviour makes ivy.deps.changed mostly useless for me to implement a lazy build
mechanism in a multi module project.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message